micro/runtime/syntax/c.micro

40 lines
1.6 KiB
Text
Raw Normal View History

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