Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1 | " Vim syntax file |
| 2 | " Language: Elm Filter rules |
Bram Moolenaar | e271909 | 2015-01-10 15:09:25 +0100 | [diff] [blame] | 3 | " Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz> |
Bram Moolenaar | f37506f | 2016-08-31 22:22:10 +0200 | [diff] [blame] | 4 | " Last Change: Aug 31, 2016 |
| 5 | " Version: 8 |
Bram Moolenaar | e271909 | 2015-01-10 15:09:25 +0100 | [diff] [blame] | 6 | " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_ELMFILT |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7 | |
Bram Moolenaar | 89bcfda | 2016-08-30 23:26:57 +0200 | [diff] [blame] | 8 | " quit when a syntax file was already loaded |
| 9 | if exists("b:current_syntax") |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 10 | finish |
| 11 | endif |
| 12 | |
| 13 | syn cluster elmfiltIfGroup contains=elmfiltCond,elmfiltOper,elmfiltOperKey,,elmfiltNumber,elmfiltOperKey |
| 14 | |
| 15 | syn match elmfiltParenError "[()]" |
| 16 | syn match elmfiltMatchError "/" |
| 17 | syn region elmfiltIf start="\<if\>" end="\<then\>" contains=elmfiltParen,elmfiltParenError skipnl skipwhite nextgroup=elmfiltAction |
| 18 | syn region elmfiltParen contained matchgroup=Delimiter start="(" matchgroup=Delimiter end=")" contains=elmfiltParen,@elmfiltIfGroup,elmfiltThenError |
| 19 | syn region elmfiltMatch contained matchgroup=Delimiter start="/" skip="\\/" matchgroup=Delimiter end="/" skipnl skipwhite nextgroup=elmfiltOper,elmfiltOperKey |
| 20 | syn match elmfiltThenError "\<then.*$" |
| 21 | syn match elmfiltComment "^#.*$" contains=@Spell |
| 22 | |
| 23 | syn keyword elmfiltAction contained delete execute executec forward forwardc leave save savecopy skipnl skipwhite nextgroup=elmfiltString |
| 24 | syn match elmfiltArg contained "[^\\]%[&0-9dDhmrsSty&]"lc=1 |
| 25 | |
| 26 | syn match elmfiltOperKey contained "\<contains\>" skipnl skipwhite nextgroup=elmfiltString |
| 27 | syn match elmfiltOperKey contained "\<matches\s" nextgroup=elmfiltMatch,elmfiltSpaceError |
| 28 | syn keyword elmfiltCond contained cc bcc lines always subject sender from to lines received skipnl skipwhite nextgroup=elmfiltString |
| 29 | syn match elmfiltNumber contained "\d\+" |
| 30 | syn keyword elmfiltOperKey contained and not skipnl skipwhite nextgroup=elmfiltOper,elmfiltOperKey,elmfiltString |
| 31 | syn match elmfiltOper contained "\~" skipnl skipwhite nextgroup=elmfiltMatch |
| 32 | syn match elmfiltOper contained "<=\|>=\|!=\|<\|<\|=" skipnl skipwhite nextgroup=elmfiltString,elmfiltCond,elmfiltOperKey |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 33 | syn region elmfiltString contained start='"' skip='"\(\\\\\)*\\["%]' end='"' contains=elmfiltArg skipnl skipwhite nextgroup=elmfiltOper,elmfiltOperKey,@Spell |
| 34 | syn region elmfiltString contained start="'" skip="'\(\\\\\)*\\['%]" end="'" contains=elmfiltArg skipnl skipwhite nextgroup=elmfiltOper,elmfiltOperKey,@Spell |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 35 | syn match elmfiltSpaceError contained "\s.*$" |
| 36 | |
| 37 | " Define the default highlighting. |
Bram Moolenaar | f37506f | 2016-08-31 22:22:10 +0200 | [diff] [blame] | 38 | if !exists("skip_elmfilt_syntax_inits") |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 39 | |
Bram Moolenaar | f37506f | 2016-08-31 22:22:10 +0200 | [diff] [blame] | 40 | hi def link elmfiltAction Statement |
| 41 | hi def link elmfiltArg Special |
| 42 | hi def link elmfiltComment Comment |
| 43 | hi def link elmfiltCond Statement |
| 44 | hi def link elmfiltIf Statement |
| 45 | hi def link elmfiltMatch Special |
| 46 | hi def link elmfiltMatchError Error |
| 47 | hi def link elmfiltNumber Number |
| 48 | hi def link elmfiltOper Operator |
| 49 | hi def link elmfiltOperKey Type |
| 50 | hi def link elmfiltParenError Error |
| 51 | hi def link elmfiltSpaceError Error |
| 52 | hi def link elmfiltString String |
| 53 | hi def link elmfiltThenError Error |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 54 | |
Bram Moolenaar | f37506f | 2016-08-31 22:22:10 +0200 | [diff] [blame] | 55 | endif |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 56 | |
| 57 | let b:current_syntax = "elmfilt" |
| 58 | " vim: ts=9 |