home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / unix / vim-6.2.tar.bz2 / vim-6.2.tar / vim62 / runtime / syntax / elmfilt.vim < prev    next >
Encoding:
Text File  |  2002-11-18  |  3.2 KB  |  71 lines

  1. " Vim syntax file
  2. " Language:    Elm Filter rules
  3. " Maintainer:    Dr. Charles E. Campbell, Jr. <Charles.E.Campbell.1@nasa.gov>
  4. " Last Change:    Nov 18, 2002
  5. " Version:    2
  6. " URL:    http://www.erols.com/astronaut/vim/index.html#vimlinks_syntax
  7.  
  8. " For version 5.x: Clear all syntax items
  9. " For version 6.x: Quit when a syntax file was already loaded
  10. if version < 600
  11.   syntax clear
  12. elseif exists("b:current_syntax")
  13.   finish
  14. endif
  15.  
  16. syn cluster elmfiltIfGroup    contains=elmfiltCond,elmfiltOper,elmfiltOperKey,,elmfiltNumber,elmfiltOperKey
  17.  
  18. syn match    elmfiltParenError    "[()]"
  19. syn match    elmfiltMatchError    "/"
  20. syn region    elmfiltIf    start="\<if\>" end="\<then\>"    contains=elmfiltParen,elmfiltParenError skipnl skipwhite nextgroup=elmfiltAction
  21. syn region    elmfiltParen    contained    matchgroup=Delimiter start="(" matchgroup=Delimiter end=")"    contains=elmfiltParen,@elmfiltIfGroup,elmfiltThenError
  22. syn region    elmfiltMatch    contained    matchgroup=Delimiter start="/" skip="\\/" matchgroup=Delimiter end="/"    skipnl skipwhite nextgroup=elmfiltOper,elmfiltOperKey
  23. syn match    elmfiltThenError    "\<then.*$"
  24. syn match    elmfiltComment    "^#.*$"
  25.  
  26. syn keyword    elmfiltAction    contained    delete execute executec forward forwardc leave save savecopy skipnl skipwhite nextgroup=elmfiltString
  27. syn match    elmfiltArg    contained    "[^\\]%[&0-9dDhmrsSty&]"lc=1
  28.  
  29. syn match    elmfiltOperKey    contained    "\<contains\>"            skipnl skipwhite nextgroup=elmfiltString
  30. syn match    elmfiltOperKey    contained    "\<matches\s"            nextgroup=elmfiltMatch,elmfiltSpaceError
  31. syn keyword    elmfiltCond    contained    cc bcc lines always subject sender from to lines received    skipnl skipwhite nextgroup=elmfiltString
  32. syn match    elmfiltNumber    contained    "\d\+"
  33. syn keyword    elmfiltOperKey    contained    and not                skipnl skipwhite nextgroup=elmfiltOper,elmfiltOperKey,elmfiltString
  34. syn match    elmfiltOper    contained    "\~"                skipnl skipwhite nextgroup=elmfiltMatch
  35. syn match    elmfiltOper    contained    "<=\|>=\|!=\|<\|<\|="        skipnl skipwhite nextgroup=elmfiltString,elmfiltCond,elmfiltOperKey
  36. syn region    elmfiltString    contained    start='"' skip='"\(\\\\\)*\\["%]' end='"'    contains=elmfiltArg skipnl skipwhite nextgroup=elmfiltOper,elmfiltOperKey
  37. syn region    elmfiltString    contained    start="'" skip="'\(\\\\\)*\\['%]" end="'"    contains=elmfiltArg skipnl skipwhite nextgroup=elmfiltOper,elmfiltOperKey
  38. syn match    elmfiltSpaceError    contained    "\s.*$"
  39.  
  40. " Define the default highlighting.
  41. " For version 5.7 and earlier: only when not done already
  42. " For version 5.8 and later: only when an item doesn't have highlighting yet
  43. if version >= 508 || !exists("did_elmfilt_syntax_inits")
  44.   if version < 508
  45.     let did_elmfilt_syntax_inits = 1
  46.     command -nargs=+ HiLink hi link <args>
  47.   else
  48.     command -nargs=+ HiLink hi def link <args>
  49.   endif
  50.  
  51.   HiLink elmfiltAction    Statement
  52.   HiLink elmfiltArg    Special
  53.   HiLink elmfiltComment    Comment
  54.   HiLink elmfiltCond    Statement
  55.   HiLink elmfiltIf    Statement
  56.   HiLink elmfiltMatch    Special
  57.   HiLink elmfiltMatchError    Error
  58.   HiLink elmfiltNumber    Number
  59.   HiLink elmfiltOper    Operator
  60.   HiLink elmfiltOperKey    Type
  61.   HiLink elmfiltParenError    Error
  62.   HiLink elmfiltSpaceError    Error
  63.   HiLink elmfiltString    String
  64.   HiLink elmfiltThenError    Error
  65.  
  66.   delcommand HiLink
  67. endif
  68.  
  69. let b:current_syntax = "elmfilt"
  70. " vim: ts=9
  71.