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