2017-02-18 23:17:07 +03:00
|
|
|
filetype: go
|
|
|
|
|
2017-03-21 22:07:39 +03:00
|
|
|
detect:
|
2017-02-26 01:02:39 +03:00
|
|
|
filename: "\\.go$"
|
2017-02-18 23:17:07 +03:00
|
|
|
|
|
|
|
rules:
|
2017-03-21 22:07:39 +03:00
|
|
|
# Conditionals and control flow
|
2017-03-21 21:55:22 +03:00
|
|
|
- special: "\\b(break|case|continue|default|go|goto|range|return)\\b"
|
|
|
|
- statement: "\\b(else|for|if|switch)\\b"
|
|
|
|
- preproc: "\\b(package|import|const|var|type|struct|func|go|defer|iota)\\b"
|
|
|
|
- symbol.operator: "[-+/*=<>!~%&|^]|:="
|
2017-03-21 22:07:39 +03:00
|
|
|
|
|
|
|
# Types
|
2017-03-21 21:55:22 +03:00
|
|
|
- special: "[a-zA-Z0-9]*\\("
|
|
|
|
- symbol: "(,|\\.)"
|
2017-02-18 23:17:07 +03:00
|
|
|
- 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"
|
2017-03-21 22:07:39 +03:00
|
|
|
##I'm... not sure, but aren't structs a type?
|
2017-03-21 21:55:22 +03:00
|
|
|
- type.keyword: "\\b(struct)\\b"
|
|
|
|
- constant.bool: "\\b(true|false|nil)\\b"
|
2017-03-21 22:07:39 +03:00
|
|
|
|
|
|
|
# Brackets
|
2017-03-21 21:55:22 +03:00
|
|
|
- symbol.brackets: "(\\{|\\})"
|
|
|
|
- symbol.brackets: "(\\(|\\))"
|
|
|
|
- symbol.brackets: "(\\[|\\])"
|
2017-03-21 22:07:39 +03:00
|
|
|
|
|
|
|
# Numbers and strings
|
2017-03-21 21:55:22 +03:00
|
|
|
- constant.number: "\\b([0-9]+|0x[0-9a-fA-F]*)\\b|'.'"
|
2017-03-21 22:07:39 +03:00
|
|
|
|
|
|
|
- constant.string:
|
|
|
|
start: "\""
|
2017-03-28 03:53:08 +03:00
|
|
|
end: "\""
|
2017-03-21 22:07:39 +03:00
|
|
|
rules:
|
|
|
|
- constant.specialChar: "%."
|
|
|
|
- constant.specialChar: "\\\\[abfnrtv'\\\"\\\\]"
|
|
|
|
- constant.specialChar: "\\\\([0-7]{3}|x[A-Fa-f0-9]{2}|u[A-Fa-f0-9]{4}|U[A-Fa-f0-9]{8})"
|
|
|
|
|
|
|
|
- constant.string:
|
|
|
|
start: "'"
|
2017-03-28 03:53:08 +03:00
|
|
|
end: "'"
|
2017-03-21 22:07:39 +03:00
|
|
|
rules:
|
|
|
|
- error: "..+"
|
|
|
|
- constant.specialChar: "%."
|
|
|
|
- constant.specialChar: "\\\\[abfnrtv'\\\"\\\\]"
|
|
|
|
- constant.specialChar: "\\\\([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: "`"
|
|
|
|
rules: []
|
|
|
|
|
|
|
|
- comment:
|
|
|
|
start: "//"
|
|
|
|
end: "$"
|
|
|
|
rules:
|
|
|
|
- todo: "(TODO|XXX|FIXME):?"
|
|
|
|
|
2017-02-18 23:17:07 +03:00
|
|
|
- comment:
|
|
|
|
start: "/\\*"
|
|
|
|
end: "\\*/"
|
2017-03-21 22:07:39 +03:00
|
|
|
rules:
|
|
|
|
- todo: "(TODO|XXX|FIXME):?"
|