source: tools/cfa.nanorc @ 478dade

Last change on this file since 478dade was 3be6ef3, checked in by Andrew Beach <ajbeach@…>, 9 months ago

Added a few more missing keywords to the cfa.nanorc.

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