rules:
# Conditionals and control flow
- - 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"
+ - special: "\\b(break|case|continue|default|go|goto|range|return|println|fallthrough)\\b"
+ - statement: "\\b(else|for|if|switch|select)\\b"
+ - preproc: "\\b(package|import|const|var|type|struct|func|defer|iota|make|new|copy|len|cap|panic|append|close|delete|print|recover)\\b"
- symbol.operator: "[-+/*=<>!~%&|^]|:="
# Types
- - special: "[a-zA-Z0-9]*\\("
- symbol: "(,|\\.)"
- 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"
- ##I'm... not sure, but aren't structs a type?
- type.keyword: "\\b(struct)\\b"
- constant.bool: "\\b(true|false|nil)\\b"
- constant.string:
start: "\""
- end: "(?<!\\\\)\""
+ end: "\""
+ skip: "\\\\."
rules:
- constant.specialChar: "%."
- constant.specialChar: "\\\\[abfnrtv'\\\"\\\\]"
- constant.string:
start: "'"
- end: "(?<!\\\\)'"
+ end: "'"
+ skip: "\\\\."
rules:
- error: "..+"
- constant.specialChar: "%."