compiler/
lib/
scripts/
seed/
sublime/
test/
vim/
radiance.vim
2.6 KiB
ras.vim
2.2 KiB
ril.vim
2.2 KiB
.gitignore
366 B
.gitsigners
112 B
LICENSE
1.1 KiB
Makefile
3.6 KiB
README
2.5 KiB
STYLE
2.5 KiB
std.lib
1.2 KiB
std.lib.test
347 B
vim/ras.vim
raw
| 1 | " ras.vim |
| 2 | " Syntax for Radiance Assembly (.ras) files |
| 3 | " |
| 4 | if exists("b:current_syntax") |
| 5 | finish |
| 6 | endif |
| 7 | |
| 8 | syntax clear |
| 9 | |
| 10 | " Comments |
| 11 | syntax match rasComment "//.*$" |
| 12 | syntax keyword rasTodo TODO FIXME contained containedin=rasComment |
| 13 | |
| 14 | " Directives |
| 15 | syntax match rasDirective "\.\%(align\|ascii\|byte\|constant\|data\|dword\|global\|space\|text\|word\)\>" |
| 16 | |
| 17 | " Labels |
| 18 | syntax match rasLabel "@[A-Za-z_][A-Za-z0-9_]*\%(::[A-Za-z_][A-Za-z0-9_]*\)*" |
| 19 | |
| 20 | " Mnemonics |
| 21 | syntax keyword rasMnemonic add addi addiw addw and andi auipc |
| 22 | syntax keyword rasMnemonic beq beqz bge bgeu bgt ble blt bltu bne bnez |
| 23 | syntax keyword rasMnemonic call csrc csrr csrrw csrsi csrw |
| 24 | syntax keyword rasMnemonic div divu divuw divw |
| 25 | syntax keyword rasMnemonic ebreak ecall |
| 26 | syntax keyword rasMnemonic j jal jalr la lb lbu ld lh lhu li lui lw lwu |
| 27 | syntax keyword rasMnemonic mret mul mulh mulhsu mulhu mulw mv |
| 28 | syntax keyword rasMnemonic neg nop not or ori |
| 29 | syntax keyword rasMnemonic rem remu remuw remw ret |
| 30 | syntax keyword rasMnemonic sb sd seqz sh sll slli slliw sllw slt slti sltiu sltu snez |
| 31 | syntax keyword rasMnemonic sra srai sraiw sraw srl srli srliw srlw sub subw sw |
| 32 | syntax keyword rasMnemonic tail wfi xor xori |
| 33 | |
| 34 | " Registers |
| 35 | syntax match rasRegister "%\%(a[0-7]\|fp\|gp\|ra\|s[0-9]\|s10\|s11\|sp\|t[0-6]\|tp\|zero\)\>" |
| 36 | |
| 37 | " CSR names |
| 38 | syntax keyword rasCsr mcause mepc mhartid mie mip mscratch mstatus mtval mtvec |
| 39 | |
| 40 | " Numbers and literals |
| 41 | syntax match rasNumber "\%([+-]\)\=\<0[xX][0-9A-Fa-f]\+\>" |
| 42 | syntax match rasNumber "\%([+-]\)\=\<\d\+\>" |
| 43 | syntax region rasString start=+"+ skip=+\\"+ end=+"+ |
| 44 | syntax region rasChar start=+'+ skip=+\\'+ end=+'+ |
| 45 | |
| 46 | " Namespaced symbols and punctuation |
| 47 | syntax match rasNamespaceSep "::" |
| 48 | syntax match rasPunct "[(),;:+\-*/]" |
| 49 | |
| 50 | highlight default link rasComment Comment |
| 51 | highlight default link rasTodo Todo |
| 52 | highlight default link rasDirective Special |
| 53 | highlight default link rasLabel Label |
| 54 | highlight default link rasMnemonic Keyword |
| 55 | highlight default link rasRegister Identifier |
| 56 | highlight default link rasCsr Type |
| 57 | highlight default link rasNumber Number |
| 58 | highlight default link rasString String |
| 59 | highlight default link rasChar Character |
| 60 | highlight default link rasNamespaceSep Delimiter |
| 61 | highlight default link rasPunct Delimiter |
| 62 | |
| 63 | let b:current_syntax = "ras" |