robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
53170579ce
master
1" Vim syntax file 2" Language: Zimbu 3" Maintainer: The·Vim·Project·<https://github.com/vim/vim> 4" Last Change: 2023 Aug 13 5" Note: Zimbu seems to be dead :( 6 7if exists ( "b:current_syntax" ) 8finish 9endif 10 11syn include @Ccode syntax/c.vim 12 13syn keyword zimbuTodo TODO FIXME XXX contained 14syn match zimbuNoBar "| "contained 15syn match zimbuParam "| [ ^| ] \+| "contained contains = zimbuNoBar 16syn match zimbuNoBacktick "` "contained 17syn match zimbuCode "` [ ^` ] \+` "contained contains = zimbuNoBacktick 18syn match zimbuComment "#. * $ "contains = zimbuTodo , zimbuParam , zimbuCode , @Spell 19syn match zimbuComment "/\*.\{-}\*/ "contains = zimbuTodo , zimbuParam , zimbuCode , @Spell 20 21syn match zimbuChar "'\\\=.' " 22 23syn keyword zimbuBasicType bool status 24syn keyword zimbuBasicType int1 int2 int3 int4 int5 int6 int7 25syn keyword zimbuBasicType int9 int10 int11 int12 int13 int14 int15 26syn keyword zimbuBasicType int int8 int16 int32 int64 bigInt 27syn keyword zimbuBasicType nat nat8 byte nat16 nat32 nat64 bigNat 28syn keyword zimbuBasicType nat1 nat2 nat3 nat4 nat5 nat6 nat7 29syn keyword zimbuBasicType nat9 nat10 nat11 nat12 nat13 nat14 nat15 30syn keyword zimbuBasicType float float32 float64 float80 float128 31syn keyword zimbuBasicType fixed1 fixed2 fixed3 fixed4 fixed5 fixed6 32syn keyword zimbuBasicType fixed7 fixed8 fixed9 fixed10 fixed11 fixed12 33syn keyword zimbuBasicType fixed13 fixed14 fixed15 34 35syn keyword zimbuCompType string varString 36syn keyword zimbuCompType byteString varByteString 37syn keyword zimbuCompType tuple array list dict dictList set callback 38syn keyword zimbuCompType sortedList multiDict multiDictList multiSet 39syn keyword zimbuCompType complex complex32 complex64 complex80 complex128 40syn keyword zimbuCompType proc func def thread evalThread lock cond pipe 41 42syn keyword zimbuType VAR dyn type USE GET 43syn match zimbuType "IO.File " 44syn match zimbuType "IO.Stat " 45 46syn keyword zimbuStatement IF ELSE ELSEIF IFNIL WHILE REPEAT FOR IN TO STEP 47syn keyword zimbuStatement DO UNTIL SWITCH WITH 48syn keyword zimbuStatement TRY CATCH FINALLY 49syn keyword zimbuStatement GENERATE_IF GENERATE_ELSE GENERATE_ELSEIF 50syn keyword zimbuStatement GENERATE_ERROR 51syn keyword zimbuStatement BUILD_IF BUILD_ELSE BUILD_ELSEIF 52syn keyword zimbuStatement CASE DEFAULT FINAL ABSTRACT VIRTUAL DEFINE REPLACE 53syn keyword zimbuStatement IMPLEMENTS EXTENDS PARENT LOCAL 54syn keyword zimbuStatement PART ALIAS TYPE CONNECT WRAP 55syn keyword zimbuStatement BREAK CONTINUE PROCEED 56syn keyword zimbuStatement RETURN EXIT THROW DEFER 57syn keyword zimbuStatement IMPORT AS OPTIONS MAIN 58syn keyword zimbuStatement INTERFACE PIECE INCLUDE MODULE ENUM BITS 59syn keyword zimbuStatement SHARED STATIC 60syn keyword zimbuStatement LAMBDA 61syn match zimbuStatement "\<\(FUNC\|PROC\|DEF\)\> " 62syn match zimbuStatement "\<CLASS\> " 63syn match zimbuStatement "} " 64 65syn match zimbuAttribute "@backtrace=no\> " 66syn match zimbuAttribute "@backtrace=yes\> " 67syn match zimbuAttribute "@abstract\> " 68syn match zimbuAttribute "@earlyInit\> " 69syn match zimbuAttribute "@default\> " 70syn match zimbuAttribute "@define\> " 71syn match zimbuAttribute "@replace\> " 72syn match zimbuAttribute "@final\> " 73syn match zimbuAttribute "@primitive\> " 74syn match zimbuAttribute "@notOnExit\> " 75 76syn match zimbuAttribute "@private\> " 77syn match zimbuAttribute "@protected\> " 78syn match zimbuAttribute "@public\> " 79syn match zimbuAttribute "@local\> " 80syn match zimbuAttribute "@file\> " 81syn match zimbuAttribute "@directory\> " 82syn match zimbuAttribute "@read=private\> " 83syn match zimbuAttribute "@read=protected\> " 84syn match zimbuAttribute "@read=public\> " 85syn match zimbuAttribute "@read=file\> " 86syn match zimbuAttribute "@read=directory\> " 87syn match zimbuAttribute "@items=private\> " 88syn match zimbuAttribute "@items=protected\> " 89syn match zimbuAttribute "@items=public\> " 90syn match zimbuAttribute "@items=file\> " 91syn match zimbuAttribute "@items=directory\> " 92 93syn keyword zimbuMethod NEW EQUAL COPY COMPARE SIZE GET SET INIT EARLYINIT 94 95syn keyword zimbuOperator IS ISNOT ISA ISNOTA 96 97syn keyword zimbuModule ARG CHECK E GC IO LOG PROTO SYS HTTP ZC ZWT T TIME THREAD 98 99syn match zimbuImport "\.\zsPROTO " 100syn match zimbuImport "\.\zsCHEADER " 101 102"syn match zimbuString +"\([^"\\]\|\\.\)*\("\|$\)+ contains=zimbuStringExpr 103syn region zimbuString start = +" +skip = +[ ^"\\ ] \|\\. +end = +"\|$ +contains = zimbuStringExpr 104syn match zimbuString +R"\( [ ^" ] \|""\) * \("\|$\) + 105syn region zimbuLongString start = +''" +end = +"'' + 106syn match zimbuStringExpr +\\( [ ^) ] * ) +hs= s+2, he= e-1contained contains = zimbuString , zimbuParenPairOuter 107syn region zimbuParenPairOuter start = +( +ms= s+1end = +) +me= e-1contained contains = zimbuString , zimbuParenPair 108syn region zimbuParenPair start = +( +end = +) +contained contains = zimbuString , zimbuParenPair 109 110syn keyword zimbuFixed TRUE FALSE NIL THIS THISTYPE FAIL OK 111syn keyword zimbuError NULL 112 113" trailing whitespace 114syn match zimbuSpaceError display excludenl "\S\s\+$ "ms= s+1 115" mixed tabs and spaces 116syn match zimbuSpaceError display "\+\t " 117syn match zimbuSpaceError display "\t\+ " 118 119syn match zimbuUses contained "\<uses( [ a-zA-Z_ , ] * ) " 120syn match zimbuBlockgc contained "blockgc " 121syn match zimbuBlockComment contained "#. * " 122 123syn region zimbuCregion matchgroup = zimbuCblock start = "^>>> "end = "^<<<. * "contains = @Ccode , zimbuUses , zimbuBlockgc , zimbuBlockComment keepend 124 125" Assume long strings and C regions don't take more than 200 lines. 126syn sync minlines= 200 127 128" When we find the start of a long string, without a # or " before it, we are 129" sure to be inside a long string. 130syn syncmatch zimbuLongStringSync groupherezimbuLongString +^ [ ^"# ] * ''\"+ 131 132hi def link zimbuBasicType Type 133hi def link zimbuCompType Type 134hi def link zimbuType Type 135hi def link zimbuStatement Statement 136hi def link zimbuOperator Statement 137hi def link zimbuMethod PreProc 138hi def link zimbuModule PreProc 139hi def link zimbuImport PreProc 140hi def link zimbuUses PreProc 141hi def link zimbuBlockgc PreProc 142hi def link zimbuAttribute PreProc 143hi def link zimbuString Constant 144hi def link zimbuLongString Special 145hi def link zimbuChar Constant 146hi def link zimbuFixed Constant 147hi def link zimbuComment Comment 148hi def link zimbuCommentStart zimbuComment 149hi def link zimbuBlockComment Comment 150hi def link zimbuCblock Comment 151hi def link zimbuTodo Todo 152hi def link zimbuParam Constant 153hi def link zimbuCode Statement 154hi def link zimbuNoBar Ignore 155hi def link zimbuNoBacktick Ignore 156hi def link zimbuSpaceError Error 157hi def link zimbuError Error 158 159let b: current_syntax = "zimbu" 160 161" vim: ts=8