1" Vim syntax file
2" Language:	cl ("Clever Language" by Multibase, http://www.mbase.com.au)
3" Filename extensions: *.ent, *.eni
4" Maintainer:	Philip Uren <philuSPAX@ieee.org> - Remove SPAX spam block
5" Last update:	Wed Apr 12 08:47:18 EST 2006
6" $Id: cl.vim,v 1.3 2006/04/12 21:43:28 vimboss Exp $
7
8" For version 5.x: Clear all syntax items
9" For version 6.x: Quit when a syntax file was already loaded
10if version < 600
11	syntax clear
12elseif exists("b:current_syntax")
13	finish
14endif
15
16if version >= 600
17	setlocal iskeyword=@,48-57,_,-,
18else
19	set iskeyword=@,48-57,_,-,
20endif
21
22syn case ignore
23
24syn sync lines=300
25
26"If/else/elsif/endif and while/wend mismatch errors
27syn match	clifError		"\<wend\>"
28syn match	clifError		"\<elsif\>"
29syn match	clifError		"\<else\>"
30syn match	clifError		"\<endif\>"
31
32syn match	clSpaceError		"\s\+$"
33
34" If and while regions
35syn region	clLoop		transparent matchgroup=clWhile start="\<while\>" matchgroup=clWhile end="\<wend\>" contains=ALLBUT,clBreak,clProcedure
36syn region	clIf		transparent matchgroup=clConditional start="\<if\>" matchgroup=clConditional end="\<endif\>"   contains=ALLBUT,clBreak,clProcedure
37
38" Make those TODO notes and debugging stand out!
39syn keyword	clTodo		contained	TODO BUG DEBUG FIX
40syn match	clNeedsWork	contained	"NEED[S]*\s\s*WORK"
41syn keyword	clDebug		contained	debug
42
43syn match	clComment	"#.*$"		contains=clTodo,clNeedsWork
44syn region	clProcedure	oneline		start="^\s*[{}]" end="$"
45syn match	clInclude	"^\s*include\s.*"
46
47" We don't put "debug" in the clSetOptions;
48" we contain it in clSet so we can make it stand out.
49syn keyword	clSetOptions	transparent aauto abort align convert E fill fnum goback hangup justify null_exit output rauto rawprint rawdisplay repeat skip tab trim
50syn match	clSet		"^\s*set\s.*" contains=clSetOptions,clDebug
51
52syn match	clPreProc	"^\s*#P.*"
53
54syn keyword	clConditional	else elsif
55syn keyword	clWhile		continue endloop
56" 'break' needs to be a region so we can sync on it above.
57syn region	clBreak		oneline start="^\s*break" end="$"
58
59syn match	clOperator	"[!;|)(:.><+*=-]"
60
61syn match	clNumber	"\<\d\+\(u\=l\=\|lu\|f\)\>"
62
63syn region	clString	matchgroup=clQuote	start=+"+ end=+"+	skip=+\\"+
64syn region	clString	matchgroup=clQuote	start=+'+ end=+'+	skip=+\\'+
65
66syn keyword	clReserved	ERROR EXIT INTERRUPT LOCKED LREPLY MODE MCOL MLINE MREPLY NULL REPLY V1 V2 V3 V4 V5 V6 V7 V8 V9 ZERO BYPASS GOING_BACK AAUTO ABORT ABORT ALIGN BIGE CONVERT FNUM GOBACK HANGUP JUSTIFY NEXIT OUTPUT RAUTO RAWDISPLAY RAWPRINT REPEAT SKIP TAB TRIM LCOUNT PCOUNT PLINES SLINES SCOLS MATCH LMATCH
67
68syn keyword	clFunction	asc asize chr name random slen srandom day getarg getcgi getenv lcase scat sconv sdel skey smult srep substr sword trim ucase match
69
70syn keyword	clStatement	clear clear_eol clear_eos close copy create unique with where empty define define ldefine delay_form delete escape exit_block exit_do exit_process field fork format get getfile getnext getprev goto head join maintain message no_join on_eop on_key on_exit on_delete openin openout openapp pause popenin popenout popenio print put range read redisplay refresh restart_block screen select sleep text unlock write and not or do
71
72" Define the default highlighting.
73" For version 5.7 and earlier: only when not done already
74" For version 5.8 and later: only when an item doesn't have highlighting yet
75if	version >= 508 || !exists("did_cl_syntax_inits")
76	if	version < 508
77		let did_cl_syntax_inits = 1
78		command -nargs=+ HiLink hi link <args>
79	else
80		command -nargs=+ HiLink hi def link <args>
81	endif
82
83	HiLink clifError	Error
84	HiLink clSpaceError	Error
85	HiLink clWhile		Repeat
86	HiLink clConditional	Conditional
87	HiLink clDebug		Debug
88	HiLink clNeedsWork	Todo
89	HiLink clTodo		Todo
90	HiLink clComment	Comment
91	HiLink clProcedure	Procedure
92	HiLink clBreak		Procedure
93	HiLink clInclude	Include
94	HiLink clSetOption	Statement
95	HiLink clSet		Identifier
96	HiLink clPreProc	PreProc
97	HiLink clOperator	Operator
98	HiLink clNumber		Number
99	HiLink clString		String
100	HiLink clQuote		Delimiter
101	HiLink clReserved	Identifier
102	HiLink clFunction	Function
103	HiLink clStatement	Statement
104
105	delcommand HiLink
106endif
107
108let b:current_syntax = "cl"
109
110" vim: ts=8 sw=8
111