annotate runtime/syntax/make.vim @ 2988:25be7c9dda54 v7.3.266

updated for version 7.3.266 Problem: In Gvim with iBus typing space in Insert mode doesn't work. Solution: Clear xim_expected_char after checking it.
author Bram Moolenaar <bram@vim.org>
date Wed, 27 Jul 2011 18:25:44 +0200
parents f4f8014d516e
children aa51675adf7e
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: Makefile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Maintainer: Claudio Fleiner <claudio@fleiner.com>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 " URL: http://www.fleiner.com/vim/syntax/make.vim
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1121
diff changeset
5 " Last Change: 2008 Aug 04
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 " For version 5.x: Clear all syntax items
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 " For version 6.x: Quit when a syntax file was already loaded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 syntax clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 elseif exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 " some special characters
820
57c7403f6599 updated for version 7.0c11
vimboss
parents: 242
diff changeset
16 syn match makeSpecial "^\s*[@+-]\+"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 syn match makeNextLine "\\\n\s*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 " some directives
820
57c7403f6599 updated for version 7.0c11
vimboss
parents: 242
diff changeset
20 syn match makePreCondit "^ *\(ifeq\>\|else\>\|endif\>\|ifneq\>\|ifdef\>\|ifndef\>\)"
57c7403f6599 updated for version 7.0c11
vimboss
parents: 242
diff changeset
21 syn match makeInclude "^ *[-s]\=include"
57c7403f6599 updated for version 7.0c11
vimboss
parents: 242
diff changeset
22 syn match makeStatement "^ *vpath"
57c7403f6599 updated for version 7.0c11
vimboss
parents: 242
diff changeset
23 syn match makeExport "^ *\(export\|unexport\)\>"
57c7403f6599 updated for version 7.0c11
vimboss
parents: 242
diff changeset
24 syn match makeOverride "^ *override"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 hi link makeOverride makeStatement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 hi link makeExport makeStatement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 " Koehler: catch unmatched define/endef keywords. endef only matches it is by itself on a line
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 syn region makeDefine start="^\s*define\s" end="^\s*endef\s*$" contains=makeStatement,makeIdent,makePreCondit,makeDefine
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 " Microsoft Makefile specials
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 syn case ignore
820
57c7403f6599 updated for version 7.0c11
vimboss
parents: 242
diff changeset
33 syn match makeInclude "^! *include"
57c7403f6599 updated for version 7.0c11
vimboss
parents: 242
diff changeset
34 syn match makePreCondit "! *\(cmdswitches\|error\|message\|include\|if\|ifdef\|ifndef\|else\|elseif\|else if\|else\s*ifdef\|else\s*ifndef\|endif\|undef\)\>"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 syn case match
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 " identifiers
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 syn region makeIdent start="\$(" skip="\\)\|\\\\" end=")" contains=makeStatement,makeIdent,makeSString,makeDString
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 syn region makeIdent start="\${" skip="\\}\|\\\\" end="}" contains=makeStatement,makeIdent,makeSString,makeDString
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 syn match makeIdent "\$\$\w*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 syn match makeIdent "\$[^({]"
820
57c7403f6599 updated for version 7.0c11
vimboss
parents: 242
diff changeset
42 syn match makeIdent "^ *\a\w*\s*[:+?!*]="me=e-2
57c7403f6599 updated for version 7.0c11
vimboss
parents: 242
diff changeset
43 syn match makeIdent "^ *\a\w*\s*="me=e-1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 syn match makeIdent "%"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 " Makefile.in variables
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 syn match makeConfig "@[A-Za-z0-9_]\+@"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 " make targets
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 " syn match makeSpecTarget "^\.\(SUFFIXES\|PHONY\|DEFAULT\|PRECIOUS\|IGNORE\|SILENT\|EXPORT_ALL_VARIABLES\|KEEP_STATE\|LIBPATTERNS\|NOTPARALLEL\|DELETE_ON_ERROR\|INTERMEDIATE\|POSIX\|SECONDARY\)\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 syn match makeImplicit "^\.[A-Za-z0-9_./\t -]\+\s*:[^=]"me=e-2 nextgroup=makeSource
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 syn match makeImplicit "^\.[A-Za-z0-9_./\t -]\+\s*:$"me=e-1 nextgroup=makeSource
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 syn region makeTarget transparent matchgroup=makeTarget start="^[A-Za-z0-9_./$()%-][A-Za-z0-9_./\t $()%-]*:\{1,2}[^:=]"rs=e-1 end=";"re=e-1,me=e-1 end="[^\\]$" keepend contains=makeIdent,makeSpecTarget,makeNextLine skipnl nextGroup=makeCommands
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 syn match makeTarget "^[A-Za-z0-9_./$()%*@-][A-Za-z0-9_./\t $()%*@-]*::\=\s*$" contains=makeIdent,makeSpecTarget skipnl nextgroup=makeCommands,makeCommandError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56
820
57c7403f6599 updated for version 7.0c11
vimboss
parents: 242
diff changeset
57 syn region makeSpecTarget transparent matchgroup=makeSpecTarget start="^\.\(SUFFIXES\|PHONY\|DEFAULT\|PRECIOUS\|IGNORE\|SILENT\|EXPORT_ALL_VARIABLES\|KEEP_STATE\|LIBPATTERNS\|NOTPARALLEL\|DELETE_ON_ERROR\|INTERMEDIATE\|POSIX\|SECONDARY\)\>\s*:\{1,2}[^:=]"rs=e-1 end="[^\\]$" keepend contains=makeIdent,makeSpecTarget,makeNextLine skipnl nextGroup=makeCommands
57c7403f6599 updated for version 7.0c11
vimboss
parents: 242
diff changeset
58 syn match makeSpecTarget "^\.\(SUFFIXES\|PHONY\|DEFAULT\|PRECIOUS\|IGNORE\|SILENT\|EXPORT_ALL_VARIABLES\|KEEP_STATE\|LIBPATTERNS\|NOTPARALLEL\|DELETE_ON_ERROR\|INTERMEDIATE\|POSIX\|SECONDARY\)\>\s*::\=\s*$" contains=makeIdent skipnl nextgroup=makeCommands,makeCommandError
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 syn match makeCommandError "^\s\+\S.*" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 syn region makeCommands start=";"hs=s+1 start="^\t" end="^[^\t#]"me=e-1,re=e-1 end="^$" contained contains=makeCmdNextLine,makeSpecial,makeComment,makeIdent,makePreCondit,makeDefine,makeDString,makeSString nextgroup=makeCommandError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 syn match makeCmdNextLine "\\\n."he=e-1 contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 " Statements / Functions (GNU make)
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1121
diff changeset
66 syn match makeStatement contained "(\(subst\|abspath\|addprefix\|addsuffix\|and\|basename\|call\|dir\|error\|eval\|filter-out\|filter\|findstring\|firstword\|flavor\|foreach\|if\|info\|join\|lastword\|notdir\|or\|origin\|patsubst\|realpath\|shell\|sort\|strip\|suffix\|value\|warning\|wildcard\|word\|wordlist\|words\)\>"ms=s+1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 " Comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 if exists("make_microsoft")
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 820
diff changeset
70 syn match makeComment "#.*" contains=@Spell,makeTodo
820
57c7403f6599 updated for version 7.0c11
vimboss
parents: 242
diff changeset
71 elseif !exists("make_no_comments")
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 820
diff changeset
72 syn region makeComment start="#" end="^$" end="[^\\]$" keepend contains=@Spell,makeTodo
e63691e7c504 updated for version 7.1a
vimboss
parents: 820
diff changeset
73 syn match makeComment "#$" contains=@Spell
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 syn keyword makeTodo TODO FIXME XXX contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 " match escaped quotes and any other escaped character
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 " except for $, as a backslash in front of a $ does
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 " not make it a standard character, but instead it will
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 " still act as the beginning of a variable
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 " The escaped char is not highlightet currently
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 syn match makeEscapedChar "\\[^$]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 syn region makeDString start=+\(\\\)\@<!"+ skip=+\\.+ end=+"+ contains=makeIdent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 syn region makeSString start=+\(\\\)\@<!'+ skip=+\\.+ end=+'+ contains=makeIdent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 syn region makeBString start=+\(\\\)\@<!`+ skip=+\\.+ end=+`+ contains=makeIdent,makeSString,makeDString,makeNextLine
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 " Syncing
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 syn sync minlines=20 maxlines=200
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 " Sync on Make command block region: When searching backwards hits a line that
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 " can't be a command or a comment, use makeCommands if it looks like a target,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 " NONE otherwise.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 syn sync match makeCommandSync groupthere NONE "^[^\t#]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 syn sync match makeCommandSync groupthere makeCommands "^[A-Za-z0-9_./$()%-][A-Za-z0-9_./\t $()%-]*:\{1,2}[^:=]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 syn sync match makeCommandSync groupthere makeCommands "^[A-Za-z0-9_./$()%-][A-Za-z0-9_./\t $()%-]*:\{1,2}\s*$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 " Define the default highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 " For version 5.7 and earlier: only when not done already
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 " 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
102 if version >= 508 || !exists("did_make_syn_inits")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 if version < 508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 let did_make_syn_inits = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 command -nargs=+ HiLink hi link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 command -nargs=+ HiLink hi def link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110 HiLink makeNextLine makeSpecial
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111 HiLink makeCmdNextLine makeSpecial
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 HiLink makeSpecTarget Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113 if !exists("make_no_commands")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114 HiLink makeCommands Number
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116 HiLink makeImplicit Function
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117 HiLink makeTarget Function
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118 HiLink makeInclude Include
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119 HiLink makePreCondit PreCondit
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120 HiLink makeStatement Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 HiLink makeIdent Identifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122 HiLink makeSpecial Special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123 HiLink makeComment Comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124 HiLink makeDString String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125 HiLink makeSString String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126 HiLink makeBString Function
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127 HiLink makeError Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128 HiLink makeTodo Todo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
129 HiLink makeDefine Define
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130 HiLink makeCommandError Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131 HiLink makeConfig PreCondit
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
132 delcommand HiLink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
133 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
134
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
135 let b:current_syntax = "make"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
136
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
137 " vim: ts=8