[f2e746d] | 1 | ## Cforall syntax colouring. |
---|
| 2 | ## WIP |
---|
| 3 | |
---|
[d21d01e5] | 4 | syntax "cfa" "\.(c|h)fa" |
---|
[f2e746d] | 5 | |
---|
| 6 | # Macros |
---|
| 7 | color brightred "\<[A-Z_][0-9A-Z_]+\>" |
---|
| 8 | |
---|
| 9 | # Types |
---|
[ea91c42] | 10 | color green "\<(forall|trait|(o|d|f|t)type|mutex|_Bool|volatile|virtual)\>" |
---|
[d21d01e5] | 11 | color green "\<(float|double|bool|char|int|short|long|enum|void|auto)\>" |
---|
[58daf53] | 12 | color green "\<((s?size)|one|zero|((u_?)?int(8|16|32|64|ptr)))_t\>" |
---|
[3be6ef3] | 13 | color green "\<(static|const|extern|(un)?signed|inline)\>" |
---|
| 14 | color green "\<(typeof|vtable|sizeof|alignof)\>" |
---|
[f2e746d] | 15 | |
---|
| 16 | # Declarations |
---|
[2bb2efa9] | 17 | color brightgreen "\<(struct|union|typedef|trait|coroutine|generator)\>" |
---|
[f11296a] | 18 | color brightgreen "\<(monitor|thread|with|exception)\>" |
---|
[f2e746d] | 19 | |
---|
| 20 | # Control Flow Structures |
---|
| 21 | color brightyellow "\<(if|else|while|do|for|switch|choose|case|default)\>" |
---|
[2bb2efa9] | 22 | color brightyellow "\<(disable|enable|waitfor|when|timeout|suspend)\>" |
---|
[307a732] | 23 | color brightyellow "\<(try|catch(Resume)?|finally)\>" |
---|
[f2e746d] | 24 | |
---|
| 25 | # Control Flow Statements |
---|
[307a732] | 26 | color magenta "\<(goto|return|break|continue|fallthr(u|ough)|throw(Resume)?)\>" |
---|
[f2e746d] | 27 | |
---|
[d21d01e5] | 28 | # Escaped Keywords, now Identifiers. |
---|
[3d78a58] | 29 | color white "``\w+" |
---|
[d21d01e5] | 30 | |
---|
[f2e746d] | 31 | # Operator Names |
---|
| 32 | color blue "\^?\?\{\}|\?\[\?\]|\?\(\)" "\?(\+\+|--)" "(\+\+?|--?|\*|~|!)\?" |
---|
| 33 | color blue "\?(=|\+|-|\*|/|%|\&|\||\^|<<?|>>?)=?\?" "\?!=\?" |
---|
| 34 | |
---|
| 35 | ## The <...> in attributes can be coloured as strings. (??) |
---|
| 36 | ## color red "\<<?[[:alpha:]][[:alnum:]_]*>?![[:lower:]]+\>" |
---|
| 37 | |
---|
| 38 | ## Update/Redistribute |
---|
| 39 | # GCC builtins |
---|
[0f3d844] | 40 | color cyan "__attribute__[[:space:]]*\(\(([^)]|[^)]\))*\)\)" |
---|
[ca78437] | 41 | ##color cyan "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__" |
---|
[f2e746d] | 42 | |
---|
| 43 | # Preprocesser Directives |
---|
| 44 | color brightcyan "^[[:space:]]*#[[:space:]]*(include(_next)?|define|(ifn?|un)def|if|el(if|se)|endif|error|warning|pragma)" |
---|
| 45 | |
---|
| 46 | # Values |
---|
[58daf53] | 47 | # Booleans |
---|
| 48 | color blue "\<(true|false)\>" |
---|
[f2e746d] | 49 | # Characters |
---|
| 50 | color brightmagenta "'([^'\]|(\\")|(\\['abfnrtv\\]))'" |
---|
| 51 | color brightmagenta "'\\(([0-3]?[0-7]{1,2}))'" "'\\x[0-9A-Fa-f]{1,2}'" |
---|
| 52 | # Strings and Angle Strings |
---|
[fe5c01d] | 53 | color yellow ""([^"]|\\")*"" "<[^[:blank:]=]*>" |
---|
[f2e746d] | 54 | # Multiline Strings: This regex is VERY expencive and often too strong. |
---|
| 55 | ###color brightyellow start=""(\\.|[^"])*\\[[:space:]]*$" end="^(\\.|[^"])*"" |
---|
| 56 | |
---|
| 57 | # Comments |
---|
| 58 | color brightblue "//.*" |
---|
| 59 | color brightblue start="/\*" end="\*/" |
---|
| 60 | |
---|
| 61 | # Reminders |
---|
| 62 | color ,yellow "\<(FIXME|TODO|XXX)\>" |
---|
| 63 | |
---|
| 64 | # Trailing Whitespace |
---|
| 65 | color ,green "[[:space:]]+$" |
---|