-
Notifications
You must be signed in to change notification settings - Fork 31
/
asteria.nanorc
43 lines (33 loc) · 1.25 KB
/
asteria.nanorc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
## Highlighting Rules for Asteria
## https://github.com/lhmouse/asteria
syntax asteria "\.ast$"
comment "//"
# Declarations
color green "\<(var|const|ref|func|each)\>"
# Statements
color brightyellow "\<(if|else|switch|case|default|do|while|for|try|catch)\>"
color brightmagenta "\<(break|continue|throw|return)\>"
color brightred "\<(assert|defer)\>"
# Values
color yellow "\<(null|true|false|nan|NaN|infinity|Infinity|this)\>"
color yellow "\<__(file|line|func|varg|this|backtrace)\>"
# Operators
color cyan "[].+*/%=&|!^~?:,;(){}<>$[-]"
color brightgreen "\<(unset|(count|type)of|and|or|not|import)\>"
color brightgreen "\<__(sqrt|is(nan|inf)|abs|sign|(add|sub|mul)[ms]|fma)\>"
color brightgreen "\<__(i?(round|floor|ceil|trunc)|vcall|(lz|tz|pop)cnt)\>"
# Modifiers
color brightcyan "\<(extern)\>"
# Literals
color yellow "'[^']*?'" ""(\\.|[^\\"])*?""
icolor yellow "\<0b([01]`?)+(\.([01]`?)+)?([ep][-+]?([0-9]`?)+)?\>"
icolor yellow "\<([0-9]`?)+(\.([0-9]`?)+)?([ep][-+]?([0-9]`?)+)?\>"
icolor yellow "\<0x([0-9a-f]`?)+(\.([0-9a-f]`?)+)?(p[-+]?([0-9]`?)+)?\>"
# Comments
color brightblue "//.*"
color brightblue start="/\*" end="\*/"
color brightblue "^#!.*"
# Reminders
color red,yellow "\<(FIXME|TODO|XXX)\>"
# Trailing whitespace
color ,green "[[:space:]]+$"