blob: 41c045fb090d59d7c3a935656542de2b44af52b6 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim syntax file
Bram Moolenaar34700a62013-03-07 13:20:54 +01002" Language: CL
3" (pronounced alphabetically: "Cee-El".
4" CL stands for Clever Language,
5" but the language is CL, not "Clever".
6" CL was created by Multibase, http://www.mbase.com.au)
Bram Moolenaar1aeaf8c2012-05-18 13:46:39 +02007" Filename extensions: *.ent
Bram Moolenaar34700a62013-03-07 13:20:54 +01008" *.eni
Bram Moolenaar1aeaf8c2012-05-18 13:46:39 +02009" Maintainer: Philip Uren <philuSPAX@ieee.org> Remove SPAX spam block
Bram Moolenaar34700a62013-03-07 13:20:54 +010010" Version: 6
11" Last Change: Mar 06 2013
Bram Moolenaar071d4272004-06-13 20:20:40 +000012
13" For version 5.x: Clear all syntax items
14" For version 6.x: Quit when a syntax file was already loaded
15if version < 600
Bram Moolenaard09acef2012-09-21 14:54:30 +020016 syntax clear
Bram Moolenaar071d4272004-06-13 20:20:40 +000017elseif exists("b:current_syntax")
Bram Moolenaard09acef2012-09-21 14:54:30 +020018 finish
Bram Moolenaar071d4272004-06-13 20:20:40 +000019endif
20
21if version >= 600
Bram Moolenaarfa13eef2013-02-06 17:34:04 +010022 setlocal iskeyword=@,48-57,_,-
Bram Moolenaar071d4272004-06-13 20:20:40 +000023else
Bram Moolenaarfa13eef2013-02-06 17:34:04 +010024 set iskeyword=@,48-57,_,-
Bram Moolenaar071d4272004-06-13 20:20:40 +000025endif
26
27syn case ignore
28
29syn sync lines=300
30
31"If/else/elsif/endif and while/wend mismatch errors
Bram Moolenaard09acef2012-09-21 14:54:30 +020032syn match clifError "\<wend\>"
33syn match clifError "\<elsif\>"
34syn match clifError "\<else\>"
35syn match clifError "\<endif\>"
Bram Moolenaar071d4272004-06-13 20:20:40 +000036
Bram Moolenaard09acef2012-09-21 14:54:30 +020037syn match clSpaceError "\s\+$"
Bram Moolenaar4c3f5362006-04-11 21:38:50 +000038
Bram Moolenaar071d4272004-06-13 20:20:40 +000039" If and while regions
Bram Moolenaard09acef2012-09-21 14:54:30 +020040syn region clLoop transparent matchgroup=clWhile start="\<while\>" matchgroup=clWhile end="\<wend\>" contains=ALLBUT,clBreak,clProcedure
41syn region clIf transparent matchgroup=clConditional start="\<if\>" matchgroup=clConditional end="\<endif\>" contains=ALLBUT,clBreak,clProcedure
Bram Moolenaar071d4272004-06-13 20:20:40 +000042
43" Make those TODO notes and debugging stand out!
Bram Moolenaard09acef2012-09-21 14:54:30 +020044syn keyword clTodo contained TODO BUG DEBUG FIX
45syn match clNeedsWork contained "NEED[S]*\s\s*WORK"
46syn keyword clDebug contained debug
Bram Moolenaar071d4272004-06-13 20:20:40 +000047
Bram Moolenaard09acef2012-09-21 14:54:30 +020048syn match clComment "#.*$" contains=clTodo,clNeedsWork,@Spell
49syn region clProcedure oneline start="^\s*[{}]" end="$"
50syn match clInclude "^\s*include\s.*"
Bram Moolenaar071d4272004-06-13 20:20:40 +000051
52" We don't put "debug" in the clSetOptions;
53" we contain it in clSet so we can make it stand out.
Bram Moolenaard09acef2012-09-21 14:54:30 +020054syn keyword clSetOptions transparent aauto abort align convert E fill fnum goback hangup justify null_exit output rauto rawprint rawdisplay repeat skip tab trim
55syn match clSet "^\s*set\s.*" contains=clSetOptions,clDebug
Bram Moolenaar071d4272004-06-13 20:20:40 +000056
Bram Moolenaard09acef2012-09-21 14:54:30 +020057syn match clPreProc "^\s*#P.*"
Bram Moolenaar071d4272004-06-13 20:20:40 +000058
Bram Moolenaard09acef2012-09-21 14:54:30 +020059syn keyword clConditional else elsif
60syn keyword clWhile continue endloop
Bram Moolenaar071d4272004-06-13 20:20:40 +000061" 'break' needs to be a region so we can sync on it above.
Bram Moolenaard09acef2012-09-21 14:54:30 +020062syn region clBreak oneline start="^\s*break" end="$"
Bram Moolenaar071d4272004-06-13 20:20:40 +000063
Bram Moolenaard09acef2012-09-21 14:54:30 +020064syn match clOperator "[!;|)(:.><+*=-]"
Bram Moolenaar071d4272004-06-13 20:20:40 +000065
Bram Moolenaard09acef2012-09-21 14:54:30 +020066syn match clNumber "\<\d\+\(u\=l\=\|lu\|f\)\>"
Bram Moolenaar071d4272004-06-13 20:20:40 +000067
Bram Moolenaard09acef2012-09-21 14:54:30 +020068syn region clString matchgroup=clQuote start=+"+ end=+"+ skip=+\\"+ contains=@Spell
69syn region clString matchgroup=clQuote start=+'+ end=+'+ skip=+\\'+ contains=@Spell
Bram Moolenaar071d4272004-06-13 20:20:40 +000070
Bram Moolenaard09acef2012-09-21 14:54:30 +020071syn 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 +000072
Bram Moolenaard09acef2012-09-21 14:54:30 +020073syn 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 +000074
Bram Moolenaard09acef2012-09-21 14:54:30 +020075syn 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 +000076
77" Define the default highlighting.
78" For version 5.7 and earlier: only when not done already
79" For version 5.8 and later: only when an item doesn't have highlighting yet
Bram Moolenaard09acef2012-09-21 14:54:30 +020080if version >= 508 || !exists("did_cl_syntax_inits")
81 if version < 508
82 let did_cl_syntax_inits = 1
83 command -nargs=+ HiLink hi link <args>
84 else
85 command -nargs=+ HiLink hi def link <args>
86 endif
Bram Moolenaar071d4272004-06-13 20:20:40 +000087
Bram Moolenaard09acef2012-09-21 14:54:30 +020088 HiLink clifError Error
89 HiLink clSpaceError Error
90 HiLink clWhile Repeat
91 HiLink clConditional Conditional
92 HiLink clDebug Debug
93 HiLink clNeedsWork Todo
94 HiLink clTodo Todo
95 HiLink clComment Comment
96 HiLink clProcedure Procedure
97 HiLink clBreak Procedure
98 HiLink clInclude Include
99 HiLink clSetOption Statement
100 HiLink clSet Identifier
101 HiLink clPreProc PreProc
102 HiLink clOperator Operator
103 HiLink clNumber Number
104 HiLink clString String
105 HiLink clQuote Delimiter
106 HiLink clReserved Identifier
107 HiLink clFunction Function
108 HiLink clStatement Statement
Bram Moolenaar071d4272004-06-13 20:20:40 +0000109
Bram Moolenaard09acef2012-09-21 14:54:30 +0200110 delcommand HiLink
Bram Moolenaar071d4272004-06-13 20:20:40 +0000111endif
112
113let b:current_syntax = "cl"
114
Bram Moolenaard09acef2012-09-21 14:54:30 +0200115" vim: ts=8 sw=8