| ... | @@ -7,9 +7,21 @@ if exists("b:current_syntax") | ... | @@ -7,9 +7,21 @@ 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 if else let void goto | 10 | syn keyword zigKeyword fn return mut const extern unreachable export pub as use while |
| | 11 | syn keyword zigKeyword if else let void goto type enum struct continue break match |
| 11 | syn keyword zigType bool i8 u8 i16 u16 i32 u32 i64 u64 isize usize f32 f64 f128 | 12 | syn keyword zigType bool i8 u8 i16 u16 i32 u32 i64 u64 isize usize f32 f64 f128 |
| 12 | | 13 | |
| | 14 | syn keyword zigConstant null |
| | 15 | |
| | 16 | syn keyword zigBoolean true false |
| | 17 | |
| | 18 | 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\)\)\=" |
| | 20 | syn match zigOctNumber display "\<0o[0-7_]\+\%([iu]\%(size\|8\|16\|32\|64\)\)\=" |
| | 21 | syn match zigBinNumber display "\<0b[01_]\+\%([iu]\%(size\|8\|16\|32\|64\)\)\=" |
| | 22 | |
| | 23 | syn match zigShebang /\%^#![^[].*/ |
| | 24 | |
| 13 | syn region zigCommentLine start="//" end="$" contains=zigTodo,@Spell | 25 | syn region zigCommentLine start="//" end="$" contains=zigTodo,@Spell |
| 14 | syn region zigCommentLineDoc start="//\%(//\@!\|!\)" end="$" contains=zigTodo,@Spell | 26 | syn region zigCommentLineDoc start="//\%(//\@!\|!\)" end="$" contains=zigTodo,@Spell |
| 15 | syn region zigCommentBlock matchgroup=zigCommentBlock start="/\*\%(!\|\*[*/]\@!\)\@!" end="\*/" contains=zigTodo,zigCommentBlockNest,@Spell | 27 | syn region zigCommentBlock matchgroup=zigCommentBlock start="/\*\%(!\|\*[*/]\@!\)\@!" end="\*/" contains=zigTodo,zigCommentBlockNest,@Spell |
| ... | @@ -30,8 +42,14 @@ syn region zigString start='b\?r\z(#*\)"' end='"\z1' contains=@Spell | ... | @@ -30,8 +42,14 @@ syn region zigString start='b\?r\z(#*\)"' end='"\z1' contains=@Spell |
| 30 | | 42 | |
| 31 | let b:current_syntax = "zig" | 43 | let b:current_syntax = "zig" |
| 32 | | 44 | |
| | 45 | hi def link zigDecNumber zigNumber |
| | 46 | hi def link zigHexNumber zigNumber |
| | 47 | hi def link zigOctNumber zigNumber |
| | 48 | hi def link zigBinNumber zigNumber |
| | 49 | |
| 33 | hi def link zigKeyword Keyword | 50 | hi def link zigKeyword Keyword |
| 34 | hi def link zigType Type | 51 | hi def link zigType Type |
| | 52 | hi def link zigShebang Comment |
| 35 | hi def link zigCommentLine Comment | 53 | hi def link zigCommentLine Comment |
| 36 | hi def link zigCommentLineDoc SpecialComment | 54 | hi def link zigCommentLineDoc SpecialComment |
| 37 | hi def link zigCommentBlock zigCommentLine | 55 | hi def link zigCommentBlock zigCommentLine |
| ... | @@ -42,3 +60,6 @@ hi def link zigString String | ... | @@ -42,3 +60,6 @@ hi def link zigString String |
| 42 | hi def link zigEscape Special | 60 | hi def link zigEscape Special |
| 43 | hi def link zigEscapeUnicode zigEscape | 61 | hi def link zigEscapeUnicode zigEscape |
| 44 | hi def link zigEscapeError Error | 62 | hi def link zigEscapeError Error |
| | 63 | hi def link zigBoolean Boolean |
| | 64 | hi def link zigConstant Constant |
| | 65 | hi def link zigNumber Number |