source: tools/cfa.nanorc @ ded6c2a6

ast-experimental
Last change on this file since ded6c2a6 was f11296a, checked in by Andrew Beach <ajbeach@…>, 2 years ago

Updated the nanorc file to include some missing keywords (exception and vtable).

  • Property mode set to 100644
File size: 2.1 KB
RevLine 
[f2e746d]1## Cforall syntax colouring.
2## WIP
3
[d21d01e5]4syntax "cfa" "\.(c|h)fa"
[f2e746d]5
6# Macros
7color brightred "\<[A-Z_][0-9A-Z_]+\>"
8
9# Types
[ea91c42]10color green "\<(forall|trait|(o|d|f|t)type|mutex|_Bool|volatile|virtual)\>"
[d21d01e5]11color green "\<(float|double|bool|char|int|short|long|enum|void|auto)\>"
[f11296a]12color green "\<(static|const|extern|(un)?signed|inline|sizeof|vtable)\>"
[58daf53]13color green "\<((s?size)|one|zero|((u_?)?int(8|16|32|64|ptr)))_t\>"
[f2e746d]14
15# Declarations
[2bb2efa9]16color brightgreen "\<(struct|union|typedef|trait|coroutine|generator)\>"
[f11296a]17color brightgreen "\<(monitor|thread|with|exception)\>"
[f2e746d]18
19# Control Flow Structures
20color brightyellow "\<(if|else|while|do|for|switch|choose|case|default)\>"
[2bb2efa9]21color brightyellow "\<(disable|enable|waitfor|when|timeout|suspend)\>"
[307a732]22color brightyellow "\<(try|catch(Resume)?|finally)\>"
[f2e746d]23
24# Control Flow Statements
[307a732]25color magenta "\<(goto|return|break|continue|fallthr(u|ough)|throw(Resume)?)\>"
[f2e746d]26
[d21d01e5]27# Escaped Keywords, now Identifiers.
[3d78a58]28color white "``\w+"
[d21d01e5]29
[f2e746d]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
[0f3d844]39color cyan "__attribute__[[:space:]]*\(\(([^)]|[^)]\))*\)\)"
[ca78437]40##color cyan "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__"
[f2e746d]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
[58daf53]46# Booleans
47color blue "\<(true|false)\>"
[f2e746d]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
[fe5c01d]52color yellow ""([^"]|\\")*"" "<[^[:blank:]=]*>"
[f2e746d]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.