From b1934f206b3590cf6c7436f50e2bf6dba653c04c Mon Sep 17 00:00:00 2001 From: lemon Date: Fri, 19 Aug 2022 12:37:11 +0200 Subject: fix vim syntax --- bootstrap/test2.cff | 2 ++ misc/cff.vim | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/bootstrap/test2.cff b/bootstrap/test2.cff index c4aedd9..c120d05 100644 --- a/bootstrap/test2.cff +++ b/bootstrap/test2.cff @@ -45,6 +45,7 @@ extern fn main() void { x = X + 1 + Y; let const v= Value:None; +#{ switch v { case None; case Int i; @@ -79,3 +80,4 @@ extern fn main() void { Bit:foo(3); Bit:foo(3); } +} diff --git a/misc/cff.vim b/misc/cff.vim index 5c8b0d2..1c6ca50 100644 --- a/misc/cff.vim +++ b/misc/cff.vim @@ -20,7 +20,7 @@ syn keyword Operator alignof sizeof as and or offsetof syn match PreProc "#\i*\>" syn match PreProc "#?\>" -syn match PreProc "#'\k\+\>" +syn match PreProc "#'\k\+\>" syn region PreProc start="#\[" end="\]" extend syn case ignore @@ -30,9 +30,11 @@ syn match cNumber display contained "0x\x\+\%(\vu|u8|i8|u16|i32|u32|i64|u64|z|z syn match cFloat display contained "\d\+\.\d*\%(f\|f32\|f64\)\?\>" syn region String start=+"+ skip=+\\\\\|\\"+ end=+"+ extend -syn region Character start=+'+ skip=+\\\\\|\\'+ end=+'+ extend +syn match mCommentLabel contained "#'\k\+\>" +syn region Character start=+'+ skip=+\\\\\|\\'+ end=+'+ syn region Comment start="//" end="$" -syn region mComment start="#{" end="}" contains=mComment,mCommentBraces,String,Character +syn region mComment start="#{" end="}" contains=mComment,mCommentBraces,String,mCommentLabel,Character syn region mCommentBraces contained start=+[^'"#]{+ end="}" contains=mCommentBraces,String hi link mComment Comment hi link mCommentBraces Comment +hi link mCommentLabel Comment -- cgit v1.2.3