Rename "syntax" package to "lexers"

This commit is contained in:
2025-06-15 16:15:38 -04:00
parent 17be28e6b2
commit 21f55dd55e
44 changed files with 56 additions and 54 deletions
+37
View File
@@ -0,0 +1,37 @@
//go:build stxToml || stxAll
package lexers
func init() {
syntaxMap["toml"] = &lazySyntax{init: func() []byte {
return []byte(`filetype: toml
rules:
- statement: "(.*)[[:space:]]="
- special: "="
- special: "(\\[|\\])"
- constant.number: "\\b([0-9]+|0x[0-9a-fA-F]*)\\b|'.'"
- constant.number: "\\\\([0-7]{3}|x[A-Fa-f0-9]{2}|u[A-Fa-f0-9]{4}|U[A-Fa-f0-9]{8})"
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- constant.string:
start: "'"
end: "'"
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- constant.string:
start: "` + "`" + `"
end: "` + "`" + `"
rules:
- constant.specialChar: "\\\\."
- comment:
start: "#"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME):?"`)
}}
}