mirror of
https://github.com/rwinkhart/go-highlite.git
synced 2026-09-03 23:57:13 -04:00
Support initial batch of languages
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
//go:build stxCaddyfile || stxAll
|
||||
|
||||
package syntax
|
||||
|
||||
func init() {
|
||||
syntaxMap["caddyfile"] = &lazySyntax{init: func() []byte {
|
||||
return []byte(`filetype: caddyfile
|
||||
|
||||
detect:
|
||||
filename: "Caddyfile"
|
||||
|
||||
rules:
|
||||
- identifier: "^\\s*\\S+(\\s|$)"
|
||||
- type: "^([\\w.:/-]+,? ?)+[,{]$"
|
||||
- constant.specialChar: "\\s{$"
|
||||
- constant.specialChar: "^\\s*}$"
|
||||
- constant.string:
|
||||
start: "\""
|
||||
end: "\""
|
||||
skip: "\\\\."
|
||||
rules:
|
||||
- constant.specialChar: "\\\\."
|
||||
|
||||
- preproc: "\\{(\\w+|\\$\\w+|%\\w+%)\\}"
|
||||
- comment:
|
||||
start: "#"
|
||||
end: "$"
|
||||
rules: []`)
|
||||
}}
|
||||
}
|
||||
Reference in New Issue
Block a user