source: tools/cfa.nanorc @ a254fa56

ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since a254fa56 was d21d01e5, checked in by Andrew Beach <ajbeach@…>, 6 years ago

Updated cfa.nanorc for some missing keywords and keyword escapes.

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