]> git.lizzy.rs Git - micro.git/blob - runtime/syntax/c++.yaml
better top
[micro.git] / runtime / syntax / c++.yaml
1 filetype: c++
2
3 detect: 
4     filename: "\\.c(c|pp|xx)$|\\.h(h|pp|xx)$|\\.ii?$|\\.(def)$"
5
6 rules:
7     - identifier: "\\b[A-Z_][0-9A-Z_]+\\b"
8     - type: "\\b(auto|float|double|bool|char|int|short|long|sizeof|enum|void|static|const|constexpr|struct|union|typedef|extern|(un)?signed|inline)\\b"
9     - type: "\\b((s?size)|((u_?)?int(8|16|32|64|ptr)))_t\\b"
10     - statement: "\\b(class|namespace|template|public|protected|private|typename|this|friend|virtual|using|mutable|volatile|register|explicit)\\b"
11     - statement: "\\b(for|if|while|do|else|case|default|switch)\\b"
12     - statement: "\\b(try|throw|catch|operator|new|delete)\\b"
13     - special: "\\b(goto|continue|break|return)\\b"
14     - preproc: "^[[:space:]]*#[[:space:]]*(define|pragma|include|(un|ifn?)def|endif|el(if|se)|if|warning|error)"
15     - constant: "'([^'\\\\]|(\\\\[\"'abfnrtv\\\\]))'|'\\\\(([0-3]?[0-7]{1,2}))'|'\\\\x[0-9A-Fa-f]{1,2}'"
16     - statement: "__attribute__[[:space:]]*\\(\\([^)]*\\)\\)|__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__"
17     - symbol.operator: "[.:;,+*|=!\\%]|<|>|/|-|&"
18     - symbol.brackets: "[(){}]|\\[|\\]"
19     - constant.number: "\\b[0-9]+\\b|\\b0x[0-9A-Fa-f]+\\b"
20     - constant.bool: "\\b(true|false)\\b|NULL"
21     - constant.string: "\"(\\\\.|[^\"])*\""
22     - comment: "//.*"
23     - comment:
24         start: "/\\*"
25         end: "\\*/"
26         rules: []
27
28     - indent-char.whitespace: "[[:space:]]+$"