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/ril.vim
raw
| 1 | " ril.vim |
| 2 | " Syntax for Radiance IL (.ril) files |
| 3 | " (c) Alexis Sellier |
| 4 | " |
| 5 | if exists("b:current_syntax") |
| 6 | finish |
| 7 | endif |
| 8 | |
| 9 | syntax clear |
| 10 | |
| 11 | " Comments (Radiance style) |
| 12 | syntax match rilComment "//.*$" |
| 13 | syntax keyword rilTodo TODO FIXME contained containedin=rilComment |
| 14 | |
| 15 | " Keywords |
| 16 | syntax keyword rilKeyword fn data extern mut align |
| 17 | |
| 18 | " Instructions (memory) |
| 19 | syntax keyword rilInstr reserve load sload store blit copy |
| 20 | " Instructions (arithmetic) |
| 21 | syntax keyword rilInstr add sub mul sdiv udiv srem urem neg |
| 22 | " Instructions (comparison) |
| 23 | syntax keyword rilInstr eq ne slt sge ult uge |
| 24 | " Instructions (bitwise) |
| 25 | syntax keyword rilInstr and or xor shl sshr ushr not |
| 26 | " Instructions (conversions) |
| 27 | syntax keyword rilInstr zext sext |
| 28 | " Instructions (calls and terminators) |
| 29 | syntax keyword rilInstr call ret jmp switch unreachable |
| 30 | " Instructions (intrinsics) |
| 31 | syntax keyword rilInstr ecall ebreak |
| 32 | |
| 33 | " Branch instructions (br.eq, br.ne, br.slt, br.ult) |
| 34 | syntax match rilBranch "\<br\.\(eq\|ne\|slt\|ult\)\>" |
| 35 | |
| 36 | " Data items |
| 37 | syntax keyword rilDataItem str sym undef |
| 38 | |
| 39 | " Types |
| 40 | syntax keyword rilType w8 w16 w32 void |
| 41 | |
| 42 | " Block labels (@identifier0, @eq#foobar1) |
| 43 | syntax match rilLabel "@[A-Za-z_][A-Za-z0-9_#]*" |
| 44 | |
| 45 | " Symbol names ($name or $"qualified::name") |
| 46 | syntax match rilSymbol "\$[A-Za-z_][$A-Za-z0-9_]*" |
| 47 | syntax match rilSymbol '\$"[^"]*"' |
| 48 | |
| 49 | " Registers (%0, %1, etc.) |
| 50 | syntax match rilReg "%\d\+" |
| 51 | |
| 52 | " Numbers |
| 53 | syntax match rilNumber "\<-\?\d\+\>" |
| 54 | syntax match rilNumber "\<0[xX][a-fA-F0-9]\+\>" |
| 55 | |
| 56 | " Strings |
| 57 | syntax region rilString start=+"+ skip=+\\"+ end=+"+ |
| 58 | |
| 59 | " Punctuation |
| 60 | syntax match rilPunct "[{}();:,]" |
| 61 | syntax match rilOperator "\*" |
| 62 | |
| 63 | " Define highlighting |
| 64 | highlight default link rilKeyword Keyword |
| 65 | highlight default link rilInstr Statement |
| 66 | highlight default link rilBranch Statement |
| 67 | highlight default link rilDataItem Special |
| 68 | highlight default link rilType Type |
| 69 | highlight default link rilComment Comment |
| 70 | highlight default link rilTodo Todo |
| 71 | highlight default link rilLabel Label |
| 72 | highlight default link rilSymbol Function |
| 73 | highlight default link rilReg Identifier |
| 74 | highlight default link rilNumber Number |
| 75 | highlight default link rilString String |
| 76 | highlight default link rilPunct Delimiter |
| 77 | highlight default link rilOperator Operator |
| 78 | |
| 79 | let b:current_syntax = "ril" |