53 lines
1.4 KiB
YAML
53 lines
1.4 KiB
YAML
filetype: go
|
|
|
|
detect:
|
|
filename: "\\.go$"
|
|
|
|
rules:
|
|
- statement: "\\b(break|case|continue|default|else|for|go|goto|if|range|return|switch)\\b"
|
|
- statement: "\\b(package|import|const|var|type|struct|func|go|defer|iota)\\b"
|
|
- statement: "[-+/*=<>!~%&|^]|:="
|
|
- identifier: "[a-zA-Z0-9]*\\("
|
|
- type: "\\b(u?int(8|16|32|64)?|float(32|64)|complex(64|128))\\b"
|
|
- type: "\\b(uintptr|byte|rune|string|interface|bool|map|chan|error)\\b"
|
|
- constant: "\\b(true|false|nil)\\b"
|
|
- statement: "(\\{|\\})"
|
|
- statement: "(\\(|\\))"
|
|
- statement: "(\\[|\\])"
|
|
- statement: "!"
|
|
- statement: ","
|
|
- constant.number: "\\b([0-9]+|0x[0-9a-fA-F]*)\\b"
|
|
- constant.specialChar: "\\([0-7]{3|x[A-Fa-f0-9]{2}|u[A-Fa-f0-9]{4}|U[A-Fa-f0-9]{8})"
|
|
|
|
- comment:
|
|
start: "//"
|
|
end: "$"
|
|
rules:
|
|
- todo: "(TODO|XXX|FIXME):?"
|
|
|
|
- comment:
|
|
start: "/\\*"
|
|
end: "\\*/"
|
|
rules:
|
|
- todo: "(TODO|XXX|FIXME):?"
|
|
|
|
- constant.string:
|
|
start: "\""
|
|
end: "\""
|
|
rules:
|
|
- constant.specialChar: "\\\\."
|
|
- constant.specialChar: "%."
|
|
|
|
- constant.string:
|
|
start: "'"
|
|
end: "'"
|
|
rules:
|
|
- preproc: "..+"
|
|
- constant.specialChar: "%."
|
|
- constant.specialChar: "\\\\."
|
|
|
|
- constant.string:
|
|
start: "`"
|
|
end: "`"
|
|
rules: []
|