~lmarz/nano-hare

ref: cc99577de37ec5eabb9bbfdff059648bf921259b nano-hare/hare.nanorc -rw-r--r-- 898 bytes
cc99577dLeon Marz Apply further recommendations 8 months ago
                                                                                
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
## Syntax highlighting for hare files.

syntax hare "\.ha$"
comment "//"

# Imports
color yellow "^use .+;"

# Keywords and types
color blue "\<(as|break|const|continue|def|defer|else|enum|export|fconst|fn|for|iconst|if|is|let|match|rconst|return|static|struct|switch|type|union|yield|_)\>"
color blue "\<(abort|alloc|append|assert|delete|free|insert|len|offset|vastart|vaarg|vaend)\>"
color lightyellow "@(fini|init|noreturn|offset|symbol|test)\>"
color cyan "\<(bool|char|f32|f64|false|i16|i32|i64|i8|int|null|nullable|rune|size|str|true|u16|u32|u64|u8|uint|uintptr|valist|void)\>"

# Strings and numbers
color italic,pink "\".*\""
color slate "[[:digit:]]+(.[[:digit:]]+)?(u|i|z|f32|f64|i16|i32|i64|i8|u16|u32|u64|u8)?"
# Remove highlighting in variables and function calls
color normal "[[:alpha:]][[:digit:]]+.?"

# Comments
color grey "//.*"

# Trailing whitespace
color ,red "[[:space:]]+$"