Imported Upstream version 2.3.1
[platform/upstream/nano.git] / doc / syntax / c.nanorc
1 ## Here is an example for C/C++.
2 ##
3 syntax "c" "\.(c(c|pp|xx)?|C)$" "\.(h(h|pp|xx)?|H)$" "\.ii?$"
4 magic "ASCII C(\+\+)? program text"
5 color brightred "\<[A-Z_][0-9A-Z_]+\>" 
6 color green "\<(float|double|bool|char|int|short|long|sizeof|enum|void|static|const|struct|union|typedef|extern|(un)?signed|inline)\>"
7 color green "\<((s?size)|((u_?)?int(8|16|32|64|ptr)))_t\>"
8 color green "\<(class|namespace|template|public|protected|private|typename|this|friend|virtual|using|mutable|volatile|register|explicit)\>"
9 color brightyellow "\<(for|if|while|do|else|case|default|switch)\>"
10 color brightyellow "\<(try|throw|catch|operator|new|delete)\>"
11 color magenta "\<(goto|continue|break|return)\>"
12 color brightcyan "^[[:space:]]*#[[:space:]]*(define|include(_next)?|(un|ifn?)def|endif|el(if|se)|if|warning|error|pragma)"
13 color brightmagenta "'([^'\]|(\\["'abfnrtv\\]))'" "'\\(([0-3]?[0-7]{1,2}))'" "'\\x[0-9A-Fa-f]{1,2}'"
14 ##
15 ## GCC builtins
16 color cyan "__attribute__[[:space:]]*\(\([^)]*\)\)" "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__"
17 ##
18 ## String highlighting.  You will in general want your comments and
19 ## strings to come last, because syntax highlighting rules will be
20 ## applied in the order they are read in.
21 color brightyellow "<[^=        ]*>" ""(\\.|[^"])*""
22 ##
23 ## This string is VERY resource intensive!
24 color brightyellow start=""(\\.|[^"])*\\[[:space:]]*$" end="^(\\.|[^"])*""
25
26 ## Comment highlighting
27 color brightblue "//.*"
28 color brightblue start="/\*" end="\*/"
29
30 ## Trailing whitespace
31 color ,green "[[:space:]]+$"