xref: /vim-8.2.3635/runtime/syntax/elmfilt.vim (revision 1d9215b9)
1071d4279SBram Moolenaar" Vim syntax file
2071d4279SBram Moolenaar" Language:	Elm Filter rules
3*1d9215b9SBram Moolenaar" Maintainer:	Charles E. Campbell <[email protected]>
4f37506f6SBram Moolenaar" Last Change:	Aug 31, 2016
5*1d9215b9SBram Moolenaar" Version:	9
6e2719096SBram Moolenaar" URL:	http://www.drchip.org/astronaut/vim/index.html#SYNTAX_ELMFILT
7071d4279SBram Moolenaar
889bcfda6SBram Moolenaar" quit when a syntax file was already loaded
989bcfda6SBram Moolenaarif exists("b:current_syntax")
10071d4279SBram Moolenaar  finish
11071d4279SBram Moolenaarendif
12071d4279SBram Moolenaar
13071d4279SBram Moolenaarsyn cluster elmfiltIfGroup	contains=elmfiltCond,elmfiltOper,elmfiltOperKey,,elmfiltNumber,elmfiltOperKey
14071d4279SBram Moolenaar
15071d4279SBram Moolenaarsyn match	elmfiltParenError	"[()]"
16071d4279SBram Moolenaarsyn match	elmfiltMatchError	"/"
17071d4279SBram Moolenaarsyn region	elmfiltIf	start="\<if\>" end="\<then\>"	contains=elmfiltParen,elmfiltParenError skipnl skipwhite nextgroup=elmfiltAction
18071d4279SBram Moolenaarsyn region	elmfiltParen	contained	matchgroup=Delimiter start="(" matchgroup=Delimiter end=")"	contains=elmfiltParen,@elmfiltIfGroup,elmfiltThenError
19071d4279SBram Moolenaarsyn region	elmfiltMatch	contained	matchgroup=Delimiter start="/" skip="\\/" matchgroup=Delimiter end="/"	skipnl skipwhite nextgroup=elmfiltOper,elmfiltOperKey
20071d4279SBram Moolenaarsyn match	elmfiltThenError	"\<then.*$"
21071d4279SBram Moolenaarsyn match	elmfiltComment	"^#.*$"		contains=@Spell
22071d4279SBram Moolenaar
23071d4279SBram Moolenaarsyn keyword	elmfiltAction	contained	delete execute executec forward forwardc leave save savecopy skipnl skipwhite nextgroup=elmfiltString
24071d4279SBram Moolenaarsyn match	elmfiltArg	contained	"[^\\]%[&0-9dDhmrsSty&]"lc=1
25071d4279SBram Moolenaar
26071d4279SBram Moolenaarsyn match	elmfiltOperKey	contained	"\<contains\>"			skipnl skipwhite nextgroup=elmfiltString
27071d4279SBram Moolenaarsyn match	elmfiltOperKey	contained	"\<matches\s"			nextgroup=elmfiltMatch,elmfiltSpaceError
28071d4279SBram Moolenaarsyn keyword	elmfiltCond	contained	cc bcc lines always subject sender from to lines received	skipnl skipwhite nextgroup=elmfiltString
29071d4279SBram Moolenaarsyn match	elmfiltNumber	contained	"\d\+"
30071d4279SBram Moolenaarsyn keyword	elmfiltOperKey	contained	and not				skipnl skipwhite nextgroup=elmfiltOper,elmfiltOperKey,elmfiltString
31071d4279SBram Moolenaarsyn match	elmfiltOper	contained	"\~"				skipnl skipwhite nextgroup=elmfiltMatch
32071d4279SBram Moolenaarsyn match	elmfiltOper	contained	"<=\|>=\|!=\|<\|<\|="		skipnl skipwhite nextgroup=elmfiltString,elmfiltCond,elmfiltOperKey
339964e468SBram Moolenaarsyn region	elmfiltString	contained	start='"' skip='"\(\\\\\)*\\["%]' end='"'	contains=elmfiltArg skipnl skipwhite nextgroup=elmfiltOper,elmfiltOperKey,@Spell
349964e468SBram Moolenaarsyn region	elmfiltString	contained	start="'" skip="'\(\\\\\)*\\['%]" end="'"	contains=elmfiltArg skipnl skipwhite nextgroup=elmfiltOper,elmfiltOperKey,@Spell
35071d4279SBram Moolenaarsyn match	elmfiltSpaceError	contained	"\s.*$"
36071d4279SBram Moolenaar
37071d4279SBram Moolenaar" Define the default highlighting.
38f37506f6SBram Moolenaarif !exists("skip_elmfilt_syntax_inits")
39071d4279SBram Moolenaar
40f37506f6SBram Moolenaar  hi def link elmfiltAction	Statement
41f37506f6SBram Moolenaar  hi def link elmfiltArg	Special
42f37506f6SBram Moolenaar  hi def link elmfiltComment	Comment
43f37506f6SBram Moolenaar  hi def link elmfiltCond	Statement
44f37506f6SBram Moolenaar  hi def link elmfiltIf	Statement
45f37506f6SBram Moolenaar  hi def link elmfiltMatch	Special
46f37506f6SBram Moolenaar  hi def link elmfiltMatchError	Error
47f37506f6SBram Moolenaar  hi def link elmfiltNumber	Number
48f37506f6SBram Moolenaar  hi def link elmfiltOper	Operator
49f37506f6SBram Moolenaar  hi def link elmfiltOperKey	Type
50f37506f6SBram Moolenaar  hi def link elmfiltParenError	Error
51f37506f6SBram Moolenaar  hi def link elmfiltSpaceError	Error
52f37506f6SBram Moolenaar  hi def link elmfiltString	String
53f37506f6SBram Moolenaar  hi def link elmfiltThenError	Error
54071d4279SBram Moolenaar
55f37506f6SBram Moolenaarendif
56071d4279SBram Moolenaar
57071d4279SBram Moolenaarlet b:current_syntax = "elmfilt"
58071d4279SBram Moolenaar" vim: ts=9
59