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