blob: 82660db74b53ac05d6939e7ca209f338cbbe2d1a [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim syntax file
Bram Moolenaard09acef2012-09-21 14:54:30 +02002" Language: CL
3" (pronounced alphabetically, and NOT known as Clever)
4" (CL was created by Multibase, http://www.mbase.com.au)
Bram Moolenaar1aeaf8c2012-05-18 13:46:39 +02005" Filename extensions: *.ent
Bram Moolenaard09acef2012-09-21 14:54:30 +02006" *.eni
Bram Moolenaar1aeaf8c2012-05-18 13:46:39 +02007" Maintainer: Philip Uren <philuSPAX@ieee.org> Remove SPAX spam block
Bram Moolenaard09acef2012-09-21 14:54:30 +02008" Version: 5
9" Last Change: Aug 16 2012
Bram Moolenaar071d4272004-06-13 20:20:40 +000010
11" For version 5.x: Clear all syntax items
12" For version 6.x: Quit when a syntax file was already loaded
13if version < 600
Bram Moolenaard09acef2012-09-21 14:54:30 +020014 syntax clear
Bram Moolenaar071d4272004-06-13 20:20:40 +000015elseif exists("b:current_syntax")
Bram Moolenaard09acef2012-09-21 14:54:30 +020016 finish
Bram Moolenaar071d4272004-06-13 20:20:40 +000017endif
18
19if version >= 600
Bram Moolenaarfa13eef2013-02-06 17:34:04 +010020 setlocal iskeyword=@,48-57,_,-
Bram Moolenaar071d4272004-06-13 20:20:40 +000021else
Bram Moolenaarfa13eef2013-02-06 17:34:04 +010022 set iskeyword=@,48-57,_,-
Bram Moolenaar071d4272004-06-13 20:20:40 +000023endif
24
25syn case ignore
26
27syn sync lines=300
28
29"If/else/elsif/endif and while/wend mismatch errors
Bram Moolenaard09acef2012-09-21 14:54:30 +020030syn match clifError "\<wend\>"
31syn match clifError "\<elsif\>"
32syn match clifError "\<else\>"
33syn match clifError "\<endif\>"
Bram Moolenaar071d4272004-06-13 20:20:40 +000034
Bram Moolenaard09acef2012-09-21 14:54:30 +020035syn match clSpaceError "\s\+$"
Bram Moolenaar4c3f5362006-04-11 21:38:50 +000036
Bram Moolenaar071d4272004-06-13 20:20:40 +000037" If and while regions
Bram Moolenaard09acef2012-09-21 14:54:30 +020038syn region clLoop transparent matchgroup=clWhile start="\<while\>" matchgroup=clWhile end="\<wend\>" contains=ALLBUT,clBreak,clProcedure
39syn region clIf transparent matchgroup=clConditional start="\<if\>" matchgroup=clConditional end="\<endif\>" contains=ALLBUT,clBreak,clProcedure
Bram Moolenaar071d4272004-06-13 20:20:40 +000040
41" Make those TODO notes and debugging stand out!
Bram Moolenaard09acef2012-09-21 14:54:30 +020042syn keyword clTodo contained TODO BUG DEBUG FIX
43syn match clNeedsWork contained "NEED[S]*\s\s*WORK"
44syn keyword clDebug contained debug
Bram Moolenaar071d4272004-06-13 20:20:40 +000045
Bram Moolenaard09acef2012-09-21 14:54:30 +020046syn match clComment "#.*$" contains=clTodo,clNeedsWork,@Spell
47syn region clProcedure oneline start="^\s*[{}]" end="$"
48syn match clInclude "^\s*include\s.*"
Bram Moolenaar071d4272004-06-13 20:20:40 +000049
50" We don't put "debug" in the clSetOptions;
51" we contain it in clSet so we can make it stand out.
Bram Moolenaard09acef2012-09-21 14:54:30 +020052syn keyword clSetOptions transparent aauto abort align convert E fill fnum goback hangup justify null_exit output rauto rawprint rawdisplay repeat skip tab trim
53syn match clSet "^\s*set\s.*" contains=clSetOptions,clDebug
Bram Moolenaar071d4272004-06-13 20:20:40 +000054
Bram Moolenaard09acef2012-09-21 14:54:30 +020055syn match clPreProc "^\s*#P.*"
Bram Moolenaar071d4272004-06-13 20:20:40 +000056
Bram Moolenaard09acef2012-09-21 14:54:30 +020057syn keyword clConditional else elsif
58syn keyword clWhile continue endloop
Bram Moolenaar071d4272004-06-13 20:20:40 +000059" 'break' needs to be a region so we can sync on it above.
Bram Moolenaard09acef2012-09-21 14:54:30 +020060syn region clBreak oneline start="^\s*break" end="$"
Bram Moolenaar071d4272004-06-13 20:20:40 +000061
Bram Moolenaard09acef2012-09-21 14:54:30 +020062syn match clOperator "[!;|)(:.><+*=-]"
Bram Moolenaar071d4272004-06-13 20:20:40 +000063
Bram Moolenaard09acef2012-09-21 14:54:30 +020064syn match clNumber "\<\d\+\(u\=l\=\|lu\|f\)\>"
Bram Moolenaar071d4272004-06-13 20:20:40 +000065
Bram Moolenaard09acef2012-09-21 14:54:30 +020066syn region clString matchgroup=clQuote start=+"+ end=+"+ skip=+\\"+ contains=@Spell
67syn region clString matchgroup=clQuote start=+'+ end=+'+ skip=+\\'+ contains=@Spell
Bram Moolenaar071d4272004-06-13 20:20:40 +000068
Bram Moolenaard09acef2012-09-21 14:54:30 +020069syn 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 +000070
Bram Moolenaard09acef2012-09-21 14:54:30 +020071syn 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 +000072
Bram Moolenaard09acef2012-09-21 14:54:30 +020073syn 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 +000074
75" Define the default highlighting.
76" For version 5.7 and earlier: only when not done already
77" For version 5.8 and later: only when an item doesn't have highlighting yet
Bram Moolenaard09acef2012-09-21 14:54:30 +020078if version >= 508 || !exists("did_cl_syntax_inits")
79 if version < 508
80 let did_cl_syntax_inits = 1
81 command -nargs=+ HiLink hi link <args>
82 else
83 command -nargs=+ HiLink hi def link <args>
84 endif
Bram Moolenaar071d4272004-06-13 20:20:40 +000085
Bram Moolenaard09acef2012-09-21 14:54:30 +020086 HiLink clifError Error
87 HiLink clSpaceError Error
88 HiLink clWhile Repeat
89 HiLink clConditional Conditional
90 HiLink clDebug Debug
91 HiLink clNeedsWork Todo
92 HiLink clTodo Todo
93 HiLink clComment Comment
94 HiLink clProcedure Procedure
95 HiLink clBreak Procedure
96 HiLink clInclude Include
97 HiLink clSetOption Statement
98 HiLink clSet Identifier
99 HiLink clPreProc PreProc
100 HiLink clOperator Operator
101 HiLink clNumber Number
102 HiLink clString String
103 HiLink clQuote Delimiter
104 HiLink clReserved Identifier
105 HiLink clFunction Function
106 HiLink clStatement Statement
Bram Moolenaar071d4272004-06-13 20:20:40 +0000107
Bram Moolenaard09acef2012-09-21 14:54:30 +0200108 delcommand HiLink
Bram Moolenaar071d4272004-06-13 20:20:40 +0000109endif
110
111let b:current_syntax = "cl"
112
Bram Moolenaard09acef2012-09-21 14:54:30 +0200113" vim: ts=8 sw=8