-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaqua.kak
39 lines (29 loc) · 1.3 KB
/
aqua.kak
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
hook global BufCreate .*\.aqua %{
set-option buffer filetype aqua
}
hook global WinSetOption filetype=aqua %{
require-module aqua
}
hook -group aqua-highlight global WinSetOption filetype=aqua %{
add-highlighter window/aqua ref aqua
}
provide-module aqua %{
add-highlighter shared/aqua regions
add-highlighter shared/aqua/code default-region group
# comments
add-highlighter shared/aqua/comment region -- $ fill comment
# literals
add-highlighter shared/aqua/string region (?<!'\\)(?<!')" (?<!\\)(\\\\)*" fill string
add-highlighter shared/aqua/code/numbers regex \b\d+\b 0:value
# types
add-highlighter shared/aqua/code/types regex \b(string|bool|u8|u16|u32|u64|i8|i16|i32|i64|f32|f64)\b 0:attribute
add-highlighter shared/aqua/code/data_types regex \b[A-Z]\w*\b 0:type
# operators
add-highlighter shared/aqua/code/operators regex (<-|<<-|->|\?=|=|\?|\[\]|==) 0:operator
# keywords
add-highlighter shared/aqua/code/control_flow regex \b(try|catch|par|if|else|otherwise|for|co|join)\b 0:keyword
add-highlighter shared/aqua/code/topology regex \b(on|via|use|func|service|data|alias|const)\b 1:keyword
add-highlighter shared/aqua/code/import regex \b(import|export|module|declares|from|as)\b 1:keyword
# function declaraions
add-highlighter shared/aqua/code/func_decl regex (?:func\h+)(\w+)\( 1:function
}