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 / mac / vim55rt.sit / runtime / syntax / m4.vim < prev    next >
Encoding:
Text File  |  1999-09-25  |  2.5 KB  |  60 lines  |  [TEXT/VIM!]

  1. " Vim syntax file
  2. " Language:     M4
  3. " Maintainer:   Claudio Fleiner
  4. " URL:        http://www.fleiner.com/vim/syntax/m4.vim
  5. " Last change:  1999 Apr 22
  6.  
  7. " This file will highlight user function calls if they use only
  8. " capital letters and have at least one argument (i.e. the '('
  9. " must be there). Let me know if this is a problem.
  10.  
  11. " we define it here so that included files can test for it
  12. if !exists("main_syntax")
  13.   syn clear
  14.   let main_syntax='m4'
  15. endif
  16.  
  17. " define the m4 syntax
  18. syn match  m4Variable contained "\$\d\+"
  19. syn match  m4Special  contained "$[@*#]"
  20. syn match  m4Comment  "dnl\>.*"
  21. syn match  m4Constants "\(\<m4_\)\=__file__"
  22. syn match  m4Constants "\(\<m4_\)\=__line__"
  23. syn keyword m4Constants divnum sysval m4_divnum m4_sysval
  24. syn region m4Paren    matchgroup=m4Delimiter start="(" end=")" contained contains=@m4Top
  25. syn region m4Command  matchgroup=m4Function  start="\<\(m4_\)\=\(define\|defn\|pushdef\)(" end=")" contains=@m4Top
  26. syn region m4Command  matchgroup=m4Preproc   start="\<\(m4_\)\=\(include\|sinclude\)("he=e-1 end=")" contains=@m4Top
  27. syn region m4Command  matchgroup=m4Statement start="\<\(m4_\)\=\(syscmd\|esyscmd\|ifdef\|ifelse\|indir\|builtin\|shift\|errprint\|m4exit\|changecom\|changequote\|changeword\|m4wrap\|debugfile\|divert\|undivert\)("he=e-1 end=")" contains=@m4Top
  28. syn region m4Command  matchgroup=m4builtin start="\<\(m4_\)\=\(len\|index\|regexp\|substr\|translit\|patsubst\|format\|incr\|decr\|eval\|maketemp\)("he=e-1 end=")" contains=@m4Top
  29. syn keyword m4Statement divert undivert
  30. syn region m4Command  matchgroup=m4Type      start="\<\(m4_\)\=\(undefine\|popdef\)("he=e-1 end=")" contains=@m4Top
  31. syn region m4Function matchgroup=m4Type      start="\<[_A-Z]*("he=e-1 end=")" contains=@m4Top
  32. syn region m4String   start="`" end="'" contained contains=@m4Top,@m4StringContents
  33. syn cluster m4Top     contains=m4Comment,m4Constants,m4Special,m4Variable,m4String,m4Paren,m4Command,m4Statement,m4Function
  34.  
  35. if !exists("did_m4_syntax_inits")
  36.   let did_m4_syntax_inits = 1
  37.   " The default methods for highlighting.  Can be overridden later
  38.   hi link m4Delimiter Delimiter
  39.   hi link m4Comment   Comment
  40.   hi link m4Function  Function
  41.   hi link m4Keyword   Keyword
  42.   hi link m4Special   Special
  43.   hi link m4String    String
  44.   hi link m4Statement Statement
  45.   hi link m4Preproc   PreProc
  46.   hi link m4Type      Type
  47.   hi link m4Special   Special
  48.   hi link m4Variable  Special
  49.   hi link m4Constants Constant
  50.   hi link m4Builtin   Statement
  51. endif
  52.  
  53. let b:current_syntax = "m4"
  54.  
  55. if main_syntax == 'm4'
  56.   unlet main_syntax
  57. endif
  58.  
  59. " vim: ts=4
  60.