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