1 Star 0 Fork 0

pidan/chroma

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
toml.go 802 Bytes
一键复制 编辑 原始数据 按行查看 历史
package t
import (
. "github.com/alecthomas/chroma" // nolint
"github.com/alecthomas/chroma/lexers/internal"
)
var TOML = internal.Register(MustNewLexer(
&Config{
Name: "TOML",
Aliases: []string{"toml"},
Filenames: []string{"*.toml"},
MimeTypes: []string{"text/x-toml"},
},
Rules{
"root": {
{`\s+`, Text, nil},
{`#.*`, Comment, nil},
{Words(``, `\b`, `true`, `false`), KeywordConstant, nil},
{`\d\d\d\d-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d\+)?(Z|[+-]\d{2}:\d{2})`, LiteralDate, nil},
{`[+-]?[0-9](_?\d)*\.\d+`, LiteralNumberFloat, nil},
{`[+-]?[0-9](_?\d)*`, LiteralNumberInteger, nil},
{`"(\\\\|\\"|[^"])*"`, StringDouble, nil},
{`'(\\\\|\\'|[^'])*'`, StringSingle, nil},
{`[.,=\[\]]`, Punctuation, nil},
{`[^\W\d]\w*`, NameOther, nil},
},
},
))
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/pidanpidan/chroma.git
git@gitee.com:pidanpidan/chroma.git
pidanpidan
chroma
chroma
v0.6.0

搜索帮助