compiler/
lib/
scripts/
seed/
test/
vim/
radiance.vim
2.6 KiB
ril.vim
2.2 KiB
.gitignore
353 B
.gitsigners
112 B
LICENSE
1.1 KiB
Makefile
3.1 KiB
README
2.5 KiB
std.lib
987 B
std.lib.test
252 B
vim/radiance.vim
raw
| 1 | " radiance.vim |
| 2 | " Syntax for the Radiance language |
| 3 | " (c) Alexis Sellier |
| 4 | " |
| 5 | " Quit when a syntax file was already loaded |
| 6 | if exists("b:current_syntax") |
| 7 | finish |
| 8 | endif |
| 9 | |
| 10 | syntax clear |
| 11 | |
| 12 | " Comments |
| 13 | syntax match radianceComment "//.*$" |
| 14 | syntax match radianceComment "--.*$" |
| 15 | syntax keyword radianceTodo TODO FIXME contained containedin=radianceComment |
| 16 | |
| 17 | " Keywords |
| 18 | syntax keyword radianceKeyword mod fn return if else while true false and or not case align static |
| 19 | syntax keyword radianceKeyword pub extern break continue use loop in for match nil undefined |
| 20 | syntax keyword radianceKeyword let mut as register device const log record union trait instance |
| 21 | syntax keyword radianceKeyword throws throw try catch panic assert super |
| 22 | syntax keyword radianceType i8 i16 i32 i64 u8 u16 u32 u64 f32 void bool bit opaque |
| 23 | |
| 24 | " Double-quoted strings |
| 25 | syntax region radianceString start=/"/ skip=/\\"/ end=/"/ contains=radianceEscape |
| 26 | " Characters |
| 27 | syntax region radianceCharacter start=/'/ skip=/\\'|\\\\/ end=/'/ oneline contains=radianceEscape |
| 28 | " String escapes |
| 29 | syntax match radianceEscape contained /\\["'nrtvfab\\]/ |
| 30 | " Compiler built-in |
| 31 | syntax match radianceBuiltin "@\h\w\+" |
| 32 | |
| 33 | " Numbers |
| 34 | syntax match radianceNumber "\<0[xX][a-fA-F0-9]\+\>" |
| 35 | syntax match radianceNumber "\<0[bB][01]\+\>" |
| 36 | syntax match radianceNumber "\<\d\+\>" |
| 37 | syntax match radiancePlaceholder "\<_\>" |
| 38 | |
| 39 | " Function names |
| 40 | syntax match radianceFunction "\<\h\w*\>\s*?(" |
| 41 | |
| 42 | " Operators |
| 43 | syntax match radianceOperator "[:!?&\-+*/=<>]" |
| 44 | syntax match radianceOperator "/" contains=radianceComment |
| 45 | |
| 46 | " Namespaced identifiers. |
| 47 | syntax match radianceNamespaceSep "::" contained |
| 48 | syntax match radianceNamespaceAccess "\<\u\w*\%(::\u\w*\)\+" contains=radianceNamespaceSep |
| 49 | |
| 50 | " Braces, parentheses and brackets |
| 51 | syntax match radianceBraces "[{}]" |
| 52 | syntax match radianceParens "[()]" |
| 53 | syntax match radianceBrackets "[\[\]]" |
| 54 | |
| 55 | " Define highlighting |
| 56 | highlight default link radianceKeyword Keyword |
| 57 | highlight default link radianceBuiltin Special |
| 58 | highlight default link radianceType Type |
| 59 | highlight default link radianceComment Comment |
| 60 | highlight default link radianceTodo Todo |
| 61 | highlight default link radianceNumber Number |
| 62 | highlight default link radianceFunction Function |
| 63 | highlight default link radianceOperator Operator |
| 64 | highlight default link radiancePlaceholder Delimiter |
| 65 | highlight default link radianceNamespaceSep Delimiter |
| 66 | highlight default link radianceBraces Delimiter |
| 67 | highlight default link radianceParens Delimiter |
| 68 | highlight default link radianceBrackets Delimiter |
| 69 | highlight default link radianceString String |
| 70 | highlight default link radianceCharacter Character |
| 71 | highlight default link radianceEscape SpecialChar |
| 72 | highlight default link radianceNamespaceAccess Normal |
| 73 | |
| 74 | let b:current_syntax = "radiance" |