blob: 472559520ebe95fb5851b985e0b4cb209b61c8ab [file] [log] [blame]
Bram Moolenaar1aeaf8c2012-05-18 13:46:39 +02001" Vim syntax file
2" Language: Zimbu
Christian Brabandte8d6f032023-08-23 20:23:07 +01003" Maintainer: The·Vim·Project·<https://github.com/vim/vim>
4" Last Change: 2023 Aug 13
5" Note: Zimbu seems to be dead :(
Bram Moolenaar1aeaf8c2012-05-18 13:46:39 +02006
7if exists("b:current_syntax")
8 finish
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
Bram Moolenaared32d942014-12-06 23:33:00 +010016syn 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
Bram Moolenaar1aeaf8c2012-05-18 13:46:39 +020020
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
Bram Moolenaared32d942014-12-06 23:33:00 +010035syn 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
Bram Moolenaar1aeaf8c2012-05-18 13:46:39 +020039syn keyword zimbuCompType complex complex32 complex64 complex80 complex128
40syn keyword zimbuCompType proc func def thread evalThread lock cond pipe
41
Bram Moolenaared32d942014-12-06 23:33:00 +010042syn keyword zimbuType VAR dyn type USE GET
Bram Moolenaar1aeaf8c2012-05-18 13:46:39 +020043syn match zimbuType "IO.File"
44syn match zimbuType "IO.Stat"
45
Bram Moolenaared32d942014-12-06 23:33:00 +010046syn keyword zimbuStatement IF ELSE ELSEIF IFNIL WHILE REPEAT FOR IN TO STEP
Bram Moolenaar1aeaf8c2012-05-18 13:46:39 +020047syn keyword zimbuStatement DO UNTIL SWITCH WITH
48syn keyword zimbuStatement TRY CATCH FINALLY
49syn keyword zimbuStatement GENERATE_IF GENERATE_ELSE GENERATE_ELSEIF
Bram Moolenaared32d942014-12-06 23:33:00 +010050syn keyword zimbuStatement GENERATE_ERROR
51syn keyword zimbuStatement BUILD_IF BUILD_ELSE BUILD_ELSEIF
Bram Moolenaar1aeaf8c2012-05-18 13:46:39 +020052syn keyword zimbuStatement CASE DEFAULT FINAL ABSTRACT VIRTUAL DEFINE REPLACE
53syn keyword zimbuStatement IMPLEMENTS EXTENDS PARENT LOCAL
Bram Moolenaared32d942014-12-06 23:33:00 +010054syn keyword zimbuStatement PART ALIAS TYPE CONNECT WRAP
Bram Moolenaar1aeaf8c2012-05-18 13:46:39 +020055syn keyword zimbuStatement BREAK CONTINUE PROCEED
Bram Moolenaared32d942014-12-06 23:33:00 +010056syn keyword zimbuStatement RETURN EXIT THROW DEFER
Bram Moolenaar1aeaf8c2012-05-18 13:46:39 +020057syn keyword zimbuStatement IMPORT AS OPTIONS MAIN
Bram Moolenaared32d942014-12-06 23:33:00 +010058syn keyword zimbuStatement INTERFACE PIECE INCLUDE MODULE ENUM BITS
59syn keyword zimbuStatement SHARED STATIC
60syn keyword zimbuStatement LAMBDA
Bram Moolenaar1aeaf8c2012-05-18 13:46:39 +020061syn 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\>"
Bram Moolenaared32d942014-12-06 23:33:00 +010073syn match zimbuAttribute "@primitive\>"
74syn match zimbuAttribute "@notOnExit\>"
Bram Moolenaar1aeaf8c2012-05-18 13:46:39 +020075
76syn match zimbuAttribute "@private\>"
77syn match zimbuAttribute "@protected\>"
78syn match zimbuAttribute "@public\>"
Bram Moolenaared32d942014-12-06 23:33:00 +010079syn match zimbuAttribute "@local\>"
Bram Moolenaar1aeaf8c2012-05-18 13:46:39 +020080syn 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
Bram Moolenaared32d942014-12-06 23:33:00 +010093syn keyword zimbuMethod NEW EQUAL COPY COMPARE SIZE GET SET INIT EARLYINIT
Bram Moolenaar1aeaf8c2012-05-18 13:46:39 +020094
95syn keyword zimbuOperator IS ISNOT ISA ISNOTA
96
Bram Moolenaared32d942014-12-06 23:33:00 +010097syn keyword zimbuModule ARG CHECK E GC IO LOG PROTO SYS HTTP ZC ZWT T TIME THREAD
Bram Moolenaar1aeaf8c2012-05-18 13:46:39 +020098
Bram Moolenaared32d942014-12-06 23:33:00 +010099syn match zimbuImport "\.\zsPROTO"
100syn match zimbuImport "\.\zsCHEADER"
101
102"syn match zimbuString +"\([^"\\]\|\\.\)*\("\|$\)+ contains=zimbuStringExpr
103syn region zimbuString start=+"+ skip=+[^"\\]\|\\.+ end=+"\|$+ contains=zimbuStringExpr
Bram Moolenaar1aeaf8c2012-05-18 13:46:39 +0200104syn match zimbuString +R"\([^"]\|""\)*\("\|$\)+
Bram Moolenaared32d942014-12-06 23:33:00 +0100105syn region zimbuLongString start=+''"+ end=+"''+
106syn match zimbuStringExpr +\\([^)]*)+hs=s+2,he=e-1 contained contains=zimbuString,zimbuParenPairOuter
107syn region zimbuParenPairOuter start=+(+ms=s+1 end=+)+me=e-1 contained contains=zimbuString,zimbuParenPair
108syn region zimbuParenPair start=+(+ end=+)+ contained contains=zimbuString,zimbuParenPair
Bram Moolenaar1aeaf8c2012-05-18 13:46:39 +0200109
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
Bram Moolenaared32d942014-12-06 23:33:00 +0100119syn match zimbuUses contained "\<uses([a-zA-Z_ ,]*)"
120syn match zimbuBlockgc contained "blockgc"
Bram Moolenaar1aeaf8c2012-05-18 13:46:39 +0200121syn match zimbuBlockComment contained " #.*"
122
Bram Moolenaared32d942014-12-06 23:33:00 +0100123syn region zimbuCregion matchgroup=zimbuCblock start="^>>>" end="^<<<.*" contains=@Ccode,zimbuUses,zimbuBlockgc,zimbuBlockComment keepend
Bram Moolenaar1aeaf8c2012-05-18 13:46:39 +0200124
Bram Moolenaared32d942014-12-06 23:33:00 +0100125" 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 sync match zimbuLongStringSync grouphere zimbuLongString +^[^"#]*''\"+
Bram Moolenaar1aeaf8c2012-05-18 13:46:39 +0200131
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
Bram Moolenaared32d942014-12-06 23:33:00 +0100139hi def link zimbuImport PreProc
Bram Moolenaar1aeaf8c2012-05-18 13:46:39 +0200140hi def link zimbuUses PreProc
Bram Moolenaared32d942014-12-06 23:33:00 +0100141hi def link zimbuBlockgc PreProc
Bram Moolenaar1aeaf8c2012-05-18 13:46:39 +0200142hi def link zimbuAttribute PreProc
143hi def link zimbuString Constant
Bram Moolenaared32d942014-12-06 23:33:00 +0100144hi def link zimbuLongString Special
Bram Moolenaar1aeaf8c2012-05-18 13:46:39 +0200145hi def link zimbuChar Constant
146hi def link zimbuFixed Constant
147hi def link zimbuComment Comment
Bram Moolenaared32d942014-12-06 23:33:00 +0100148hi def link zimbuCommentStart zimbuComment
Bram Moolenaar1aeaf8c2012-05-18 13:46:39 +0200149hi def link zimbuBlockComment Comment
150hi def link zimbuCblock Comment
151hi def link zimbuTodo Todo
152hi def link zimbuParam Constant
Bram Moolenaared32d942014-12-06 23:33:00 +0100153hi def link zimbuCode Statement
Bram Moolenaar1aeaf8c2012-05-18 13:46:39 +0200154hi def link zimbuNoBar Ignore
Bram Moolenaared32d942014-12-06 23:33:00 +0100155hi def link zimbuNoBacktick Ignore
Bram Moolenaar1aeaf8c2012-05-18 13:46:39 +0200156hi def link zimbuSpaceError Error
157hi def link zimbuError Error
158
159let b:current_syntax = "zimbu"
160
161" vim: ts=8