source: tools/cfa.nanorc @ 46aa60e

Last change on this file since 46aa60e 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
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)\>"
[58daf53]12color green "\<((s?size)|one|zero|((u_?)?int(8|16|32|64|ptr)))_t\>"
[3be6ef3]13color green "\<(static|const|extern|(un)?signed|inline)\>"
14color green "\<(typeof|vtable|sizeof|alignof)\>"
[f2e746d]15
16# Declarations
[2bb2efa9]17color brightgreen "\<(struct|union|typedef|trait|coroutine|generator)\>"
[f11296a]18color brightgreen "\<(monitor|thread|with|exception)\>"
[f2e746d]19
20# Control Flow Structures
21color brightyellow "\<(if|else|while|do|for|switch|choose|case|default)\>"
[2bb2efa9]22color brightyellow "\<(disable|enable|waitfor|when|timeout|suspend)\>"
[307a732]23color brightyellow "\<(try|catch(Resume)?|finally)\>"
[f2e746d]24
25# Control Flow Statements
[307a732]26color magenta "\<(goto|return|break|continue|fallthr(u|ough)|throw(Resume)?)\>"
[f2e746d]27
[d21d01e5]28# Escaped Keywords, now Identifiers.
[3d78a58]29color white "``\w+"
[d21d01e5]30
[f2e746d]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
[0f3d844]40color cyan "__attribute__[[:space:]]*\(\(([^)]|[^)]\))*\)\)"
[ca78437]41##color cyan "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__"
[f2e746d]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
[58daf53]47# Booleans
48color blue "\<(true|false)\>"
[f2e746d]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
[fe5c01d]53color yellow ""([^"]|\\")*"" "<[^[:blank:]=]*>"
[f2e746d]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.