]> git.lizzy.rs Git - micro.git/blob - runtime/syntax/c.micro
convert tex.micro to use micro's colorscheme feature
[micro.git] / runtime / syntax / c.micro
1 ## Here is an example for C/C++.
2 ##
3 syntax "c" "\.(c(c|pp|xx)?|C)$" "\.(h(h|pp|xx)?|H)$" "\.ii?$" "\.(def)$"
4 color identifier "\b[A-Z_][0-9A-Z_]+\b" 
5 color type "\b(float|double|bool|char|int|short|long|sizeof|enum|void|static|const|struct|union|typedef|extern|(un)?signed|inline)\b"
6 color type "\b((s?size)|((u_?)?int(8|16|32|64|ptr)))_t\b"
7 color statement "\b(class|namespace|template|public|protected|private|typename|this|friend|virtual|using|mutable|volatile|register|explicit)\b"
8 color statement "\b(for|if|while|do|else|case|default|switch)\b"
9 color statement "\b(try|throw|catch|operator|new|delete)\b"
10 color statement "\b(goto|continue|break|return)\b"
11 color preproc "^[[:space:]]*#[[:space:]]*(define|include|(un|ifn?)def|endif|el(if|se)|if|warning|error)"
12 color constant "'([^'\\]|(\\["'abfnrtv\\]))'" "'\\(([0-3]?[0-7]{1,2}))'" "'\\x[0-9A-Fa-f]{1,2}'"
13
14 ##
15 ## GCC builtins
16 color statement "__attribute__[[:space:]]*\(\([^)]*\)\)" "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__"
17
18 #Operator Color
19 color statement "[.:;,+*|=!\%]" "<" ">" "/" "-" "&" 
20
21 #Parenthetical Color
22 # color magenta "[(){}]" "\[" "\]"
23
24 color constant.number "\b[0-9]+\b" "\b0x[0-9A-Fa-f]+\b"
25
26 ##
27 ## String highlighting.  You will in general want your brightblacks and
28 ## strings to come last, because syntax highlighting rules will be
29 ## applied in the order they are read in.
30 color constant.string ""(\\.|[^"])*""
31 ##
32 ## This string is VERY resource intensive!
33 #color cyan start=""(\\.|[^"])*\\[[:space:]]*$" end="^(\\.|[^"])*""
34
35 ## Comment highlighting
36 color comment "//.*"
37 color comment start="/\*" end="\*/"
38
39 ## Trailing whitespace
40 #color ,green "[[:space:]]+$"