| ... | ... | @@ -7,14 +7,22 @@ if exists("b:current_syntax") |
| 7 | 7 | finish |
| 8 | 8 | endif |
| 9 | 9 | |
| 10 | | syn keyword zigKeyword fn return mut const extern unreachable export pub as use while asm |
| 11 | | syn keyword zigKeyword if else let void goto type enum struct continue break match volatile |
| 12 | | syn keyword zigType bool i8 u8 i16 u16 i32 u32 i64 u64 isize usize f32 f64 f128 string |
| 10 | syn keyword zigOperator as |
| 11 | syn keyword zigStorage const var extern volatile export pub |
| 12 | syn keyword zigStructure struct enum type |
| 13 | syn keyword zigStatement goto break return continue asm |
| 14 | syn keyword zigConditional if else match |
| 15 | syn keyword zigRepeat while for |
| 13 | 16 | |
| 14 | | syn keyword zigConstant null |
| 17 | syn keyword zigKeyword fn unreachable use void |
| 18 | syn keyword zigType bool i8 u8 i16 u16 i32 u32 i64 u64 isize usize f32 f64 f128 string |
| 15 | 19 | |
| 16 | 20 | syn keyword zigBoolean true false |
| 17 | 21 | |
| 22 | syn match zigOperator display "\%(+\|-\|/\|*\|=\|\^\|&\||\|!\|>\|<\|%\)=\?" |
| 23 | syn match zigOperator display "&&\|||" |
| 24 | syn match zigArrowCharacter display "->" |
| 25 | |
| 18 | 26 | syn match zigDecNumber display "\<[0-9][0-9_]*\%([iu]\%(size\|8\|16\|32\|64\)\)\=" |
| 19 | 27 | syn match zigHexNumber display "\<0x[a-fA-F0-9_]\+\%([iu]\%(size\|8\|16\|32\|64\)\)\=" |
| 20 | 28 | syn match zigOctNumber display "\<0o[0-7_]\+\%([iu]\%(size\|8\|16\|32\|64\)\)\=" |
| ... | ... | @@ -36,8 +44,7 @@ syn match zigEscape display contained /\\\([nrt0\\'"]\|x\x\{2}\)/ |
| 36 | 44 | syn match zigEscapeUnicode display contained /\\\(u\x\{4}\|U\x\{8}\)/ |
| 37 | 45 | syn match zigEscapeUnicode display contained /\\u{\x\{1,6}}/ |
| 38 | 46 | syn match zigStringContinuation display contained /\\\n\s*/ |
| 39 | | syn region zigString start=+b"+ skip=+\\\\\|\\"+ end=+"+ contains=zigEscape,zigEscapeError,zigStringContinuation |
| 40 | | syn region zigString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=zigEscape,zigEscapeUnicode,zigEscapeError,zigStringContinuation,@Spell |
| 47 | syn region zigString start=+c\?"+ skip=+\\\\\|\\"+ end=+"+ contains=zigEscape,zigEscapeUnicode,zigEscapeError,zigStringContinuation,@Spell |
| 41 | 48 | syn region zigString start='b\?r\z(#*\)"' end='"\z1' contains=@Spell |
| 42 | 49 | |
| 43 | 50 | let b:current_syntax = "zig" |
| ... | ... | @@ -63,3 +70,10 @@ hi def link zigEscapeError Error |
| 63 | 70 | hi def link zigBoolean Boolean |
| 64 | 71 | hi def link zigConstant Constant |
| 65 | 72 | hi def link zigNumber Number |
| 73 | hi def link zigArrowCharacter zigOperator |
| 74 | hi def link zigOperator Operator |
| 75 | hi def link zigStorage StorageClass |
| 76 | hi def link zigStructure Structure |
| 77 | hi def link zigStatement Statement |
| 78 | hi def link zigConditional Conditional |
| 79 | hi def link zigRepeat Repeat |