Add sample syntax files

This commit is contained in:
Zachary Yedidia
2017-02-15 21:24:42 -05:00
parent 0f34a2d8ba
commit 5ea5788f25
4 changed files with 174 additions and 0 deletions
+51
View File
@@ -0,0 +1,51 @@
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: []
- constant.string:
start: "\""
end: "\""
rules:
- constant.specialChar: "\\\\."
- constant.specialChar: "%."
- constant.string:
start: "'"
end: "'"
rules:
- preproc: "..+"
- constant.specialChar: "%."
- constant.specialChar: "\\\\."
- constant.string:
start: "`"
end: "`"
rules: []