annotate runtime/syntax/m4.vim @ 9309:178252c6850e v7.4.1937

commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jun 14 22:02:26 2016 +0200 patch 7.4.1937 Problem: No test for directory stack in quickfix. Solution: Add a test. (Yegappan Lakshmanan)
author Christian Brabandt <cb@256bit.org>
date Tue, 14 Jun 2016 22:15:08 +0200
parents b6632d553df3
children 43efa4f5a8ea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: M4
632
b6632d553df3 updated for version 7.0182
vimboss
parents: 7
diff changeset
3 " Maintainer: Claudio Fleiner (claudio@fleiner.com)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 " URL: http://www.fleiner.com/vim/syntax/m4.vim
632
b6632d553df3 updated for version 7.0182
vimboss
parents: 7
diff changeset
5 " Last Change: 2005 Jan 15
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 " This file will highlight user function calls if they use only
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 " capital letters and have at least one argument (i.e. the '('
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 " must be there). Let me know if this is a problem.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 " For version 5.x: Clear all syntax items
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 " For version 6.x: Quit when a syntax file was already loaded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 if !exists("main_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 syntax clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 elseif exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 " we define it here so that included files can test for it
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 let main_syntax='m4'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 " define the m4 syntax
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 syn match m4Variable contained "\$\d\+"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 syn match m4Special contained "$[@*#]"
632
b6632d553df3 updated for version 7.0182
vimboss
parents: 7
diff changeset
26 syn match m4Comment "\<\(m4_\)\=dnl\>.*" contains=SpellErrors
b6632d553df3 updated for version 7.0182
vimboss
parents: 7
diff changeset
27 syn match m4Constants "\<\(m4_\)\=__file__"
b6632d553df3 updated for version 7.0182
vimboss
parents: 7
diff changeset
28 syn match m4Constants "\<\(m4_\)\=__line__"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 syn keyword m4Constants divnum sysval m4_divnum m4_sysval
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 syn region m4Paren matchgroup=m4Delimiter start="(" end=")" contained contains=@m4Top
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 syn region m4Command matchgroup=m4Function start="\<\(m4_\)\=\(define\|defn\|pushdef\)(" end=")" contains=@m4Top
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 syn region m4Command matchgroup=m4Preproc start="\<\(m4_\)\=\(include\|sinclude\)("he=e-1 end=")" contains=@m4Top
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 syn region m4Command matchgroup=m4builtin start="\<\(m4_\)\=\(len\|index\|regexp\|substr\|translit\|patsubst\|format\|incr\|decr\|eval\|maketemp\)("he=e-1 end=")" contains=@m4Top
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 syn keyword m4Statement divert undivert
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 syn region m4Command matchgroup=m4Type start="\<\(m4_\)\=\(undefine\|popdef\)("he=e-1 end=")" contains=@m4Top
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 syn region m4Function matchgroup=m4Type start="\<[_A-Z][_A-Z0-9]*("he=e-1 end=")" contains=@m4Top
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 syn region m4String start="`" end="'" contained contains=@m4Top,@m4StringContents,SpellErrors
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 syn cluster m4Top contains=m4Comment,m4Constants,m4Special,m4Variable,m4String,m4Paren,m4Command,m4Statement,m4Function
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 " Define the default highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 " For version 5.7 and earlier: only when not done already
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 " For version 5.8 and later: only when an item doesn't have highlighting yet
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 if version >= 508 || !exists("did_m4_syn_inits")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 if version < 508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 let did_m4_syn_inits = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 command -nargs=+ HiLink hi link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 command -nargs=+ HiLink hi def link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 HiLink m4Delimiter Delimiter
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 HiLink m4Comment Comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 HiLink m4Function Function
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 HiLink m4Keyword Keyword
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 HiLink m4Special Special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 HiLink m4String String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 HiLink m4Statement Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 HiLink m4Preproc PreProc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 HiLink m4Type Type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 HiLink m4Special Special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 HiLink m4Variable Special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 HiLink m4Constants Constant
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 HiLink m4Builtin Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 delcommand HiLink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 let b:current_syntax = "m4"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 if main_syntax == 'm4'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 unlet main_syntax
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 " vim: ts=4