blob: b278eca31b7cbc327a70645bba92e961d15f258a [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim syntax file
2" Language: cl ("Clever Language" by Multibase, http://www.mbase.com.au)
3" Filename extensions: *.ent, *.eni
Bram Moolenaar4c3f5362006-04-11 21:38:50 +00004" Maintainer: Philip Uren <philuSPAX@ieee.org> - Remove SPAX spam block
Bram Moolenaar18144c82006-04-12 21:52:12 +00005" Last update: Wed Apr 12 08:47:18 EST 2006
Bram Moolenaar5c736222010-01-06 20:54:52 +01006" $Id: cl.vim,v 1.3 2006/04/12 21:43:28 vimboss Exp $
Bram Moolenaar071d4272004-06-13 20:20:40 +00007
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
Bram Moolenaar18144c82006-04-12 21:52:12 +000027syn match clifError "\<wend\>"
28syn match clifError "\<elsif\>"
29syn match clifError "\<else\>"
30syn match clifError "\<endif\>"
Bram Moolenaar071d4272004-06-13 20:20:40 +000031
Bram Moolenaar18144c82006-04-12 21:52:12 +000032syn match clSpaceError "\s\+$"
Bram Moolenaar4c3f5362006-04-11 21:38:50 +000033
Bram Moolenaar071d4272004-06-13 20:20:40 +000034" If and while regions
Bram Moolenaar18144c82006-04-12 21:52:12 +000035syn 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
Bram Moolenaar071d4272004-06-13 20:20:40 +000037
38" Make those TODO notes and debugging stand out!
Bram Moolenaar18144c82006-04-12 21:52:12 +000039syn keyword clTodo contained TODO BUG DEBUG FIX
40syn match clNeedsWork contained "NEED[S]*\s\s*WORK"
41syn keyword clDebug contained debug
Bram Moolenaar071d4272004-06-13 20:20:40 +000042
Bram Moolenaar18144c82006-04-12 21:52:12 +000043syn match clComment "#.*$" contains=clTodo,clNeedsWork
44syn region clProcedure oneline start="^\s*[{}]" end="$"
45syn match clInclude "^\s*include\s.*"
Bram Moolenaar071d4272004-06-13 20:20:40 +000046
47" We don't put "debug" in the clSetOptions;
48" we contain it in clSet so we can make it stand out.
Bram Moolenaar18144c82006-04-12 21:52:12 +000049syn 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
Bram Moolenaar071d4272004-06-13 20:20:40 +000051
Bram Moolenaar18144c82006-04-12 21:52:12 +000052syn match clPreProc "^\s*#P.*"
Bram Moolenaar071d4272004-06-13 20:20:40 +000053
Bram Moolenaar18144c82006-04-12 21:52:12 +000054syn keyword clConditional else elsif
55syn keyword clWhile continue endloop
Bram Moolenaar071d4272004-06-13 20:20:40 +000056" 'break' needs to be a region so we can sync on it above.
Bram Moolenaar18144c82006-04-12 21:52:12 +000057syn region clBreak oneline start="^\s*break" end="$"
Bram Moolenaar071d4272004-06-13 20:20:40 +000058
Bram Moolenaar18144c82006-04-12 21:52:12 +000059syn match clOperator "[!;|)(:.><+*=-]"
Bram Moolenaar071d4272004-06-13 20:20:40 +000060
Bram Moolenaar18144c82006-04-12 21:52:12 +000061syn match clNumber "\<\d\+\(u\=l\=\|lu\|f\)\>"
Bram Moolenaar071d4272004-06-13 20:20:40 +000062
Bram Moolenaar18144c82006-04-12 21:52:12 +000063syn region clString matchgroup=clQuote start=+"+ end=+"+ skip=+\\"+
64syn region clString matchgroup=clQuote start=+'+ end=+'+ skip=+\\'+
Bram Moolenaar071d4272004-06-13 20:20:40 +000065
Bram Moolenaar18144c82006-04-12 21:52:12 +000066syn 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
Bram Moolenaar071d4272004-06-13 20:20:40 +000067
Bram Moolenaar18144c82006-04-12 21:52:12 +000068syn 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
Bram Moolenaar071d4272004-06-13 20:20:40 +000069
Bram Moolenaar18144c82006-04-12 21:52:12 +000070syn 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
Bram Moolenaar071d4272004-06-13 20:20:40 +000071
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
Bram Moolenaar18144c82006-04-12 21:52:12 +000083 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
Bram Moolenaar071d4272004-06-13 20:20:40 +0000104
105 delcommand HiLink
106endif
107
108let b:current_syntax = "cl"
109
Bram Moolenaar18144c82006-04-12 21:52:12 +0000110" vim: ts=8 sw=8