elmfilt.vim 2.8 KB

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