]> git.lizzy.rs Git - micro.git/blob - runtime/syntax/go.yaml
fe98124bcc5c5050aa2610748dbb4cee6ffc8472
[micro.git] / runtime / syntax / go.yaml
1 filetype: go
2
3 detect: 
4     filename: "\\.go$"
5
6 rules:
7     - special: "\\b(break|case|continue|default|go|goto|range|return)\\b"
8     - statement: "\\b(else|for|if|switch)\\b"
9     - preproc: "\\b(package|import|const|var|type|struct|func|go|defer|iota)\\b"
10     - symbol.operator: "[-+/*=<>!~%&|^]|:="
11     - special: "[a-zA-Z0-9]*\\("
12     - symbol: "(,|\\.)"
13     - type: "\\b(u?int(8|16|32|64)?|float(32|64)|complex(64|128))\\b"
14     - type: "\\b(uintptr|byte|rune|string|interface|bool|map|chan|error)\\b"
15     - type.keyword: "\\b(struct)\\b"
16     - constant.bool: "\\b(true|false|nil)\\b"
17     - symbol.brackets: "(\\{|\\})"
18     - symbol.brackets: "(\\(|\\))"
19     - symbol.brackets: "(\\[|\\])"
20     - constant.number: "\\b([0-9]+|0x[0-9a-fA-F]*)\\b|'.'"
21     - constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'"
22     - constant.specialChar: "\\\\[abfnrtv'\\\"\\\\]"
23     - constant.specialChar: "\\\\([0-7]{3}|x[A-Fa-f0-9]{2}|u[A-Fa-f0-9]{4}|U[A-Fa-f0-9]{8})"
24     - constant.string: "`[^`]*`"
25     - comment: "(^|[[:space:]])//.*"
26     - comment:
27         start: "/\\*"
28         end: "\\*/"
29         rules: []
30
31     - todo: "(TODO|XXX|FIXME):?"