robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
a412a4a846
master
1" Vim syntax file 2" Language: Zir 3" Upstream: https://codeberg.org/ziglang/zig.vim 4 5if exists ( "b:current_syntax" ) 6finish 7endif 8let b: current_syntax = "zir" 9 10syn region zirCommentLine start = "; "end = "$ "contains = zirTodo , @Spell 11 12syn region zirBlock start = "{ "end = "} "transparent fold 13 14syn keyword zirKeyword primitive fntype int str as ptrtoint fieldptr deref asm unreachable export ref fn 15 16syn keyword zirTodo contained TODO 17 18syn region zirString start = +c\?" +skip = +\\\\\|\\" +end = +" +oneline contains = zirEscape , zirEscapeUnicode , zirEscapeError , @Spell 19 20syn match zirEscapeError display contained /\\. / 21syn match zirEscape display contained /\\\( [ nrt\\'" ] \|x\x\{2}\) / 22syn match zirEscapeUnicode display contained /\\\(u\x\{4}\|U\x\{6}\) / 23 24syn match zirDecNumber display "\< [ 0-9 ] \+\%(. [ 0-9 ] \+\)\=\%( [ eE ][ +- ] \? [ 0-9 ] \+\)\= " 25syn match zirHexNumber display "\<0x [ a-fA-F0-9 ] \+\%( [ a-fA-F0-9 ] \+\%( [ pP ][ +- ] \? [ 0-9 ] \+\)\?\)\= " 26syn match zirOctNumber display "\<0o [ 0-7 ] \+ " 27syn match zirBinNumber display "\<0b [ 01 ] \+\%(. [ 01 ] \+\%( [ eE ][ +- ] \? [ 0-9 ] \+\)\?\)\= " 28 29syn match zirGlobal display "[ ^a-zA-Z0-9_ ] \?\zs@ [ a-zA-Z0-9_ ] \+ " 30syn match zirLocal display "[ ^a-zA-Z0-9_ ] \?\zs% [ a-zA-Z0-9_ ] \+ " 31 32hi def link zirCommentLine Comment 33hi def link zirTodo Todo 34 35hi def link zirKeyword Keyword 36 37hi def link zirString Constant 38 39hi def link zirEscape Special 40hi def link zirEscapeUnicode zirEscape 41hi def link zirEscapeError Error 42 43hi def link zirDecNumber Constant 44hi def link zirHexNumber Constant 45hi def link zirOctNumber Constant 46hi def link zirBinNumber Constant 47 48hi def link zirGlobal Identifier 49hi def link zirLocal Identifier