annotate runtime/syntax/make.vim @ 10219:eeb0b205e909 v8.0.0009

commit https://github.com/vim/vim/commit/3f1c15b24a3939d193c80c509132db9ee4d8cceb Author: Bram Moolenaar <Bram@vim.org> Date: Sun Sep 25 20:22:02 2016 +0200 patch 8.0.0009 Problem: Unecessary workround for AppVeyor. Solution: Revert patch 7.4.990. (Christian Brabandt)
author Christian Brabandt <cb@256bit.org>
date Sun, 25 Sep 2016 20:30:04 +0200
parents 46763b01cd9a
children 314694a2e74a
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
6647
3af822eb4da5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3854
diff changeset
5 " Last Change: 2015 Feb 28
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 6647
diff changeset
7 " quit when a syntax file was already loaded
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 6647
diff changeset
8 if exists("b:current_syntax")
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11
3854
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1698
diff changeset
12 let s:cpo_save = &cpo
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1698
diff changeset
13 set cpo&vim
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1698
diff changeset
14
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1698
diff changeset
15
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 " some special characters
820
57c7403f6599 updated for version 7.0c11
vimboss
parents: 242
diff changeset
17 syn match makeSpecial "^\s*[@+-]\+"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 syn match makeNextLine "\\\n\s*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 " some directives
820
57c7403f6599 updated for version 7.0c11
vimboss
parents: 242
diff changeset
21 syn match makePreCondit "^ *\(ifeq\>\|else\>\|endif\>\|ifneq\>\|ifdef\>\|ifndef\>\)"
57c7403f6599 updated for version 7.0c11
vimboss
parents: 242
diff changeset
22 syn match makeInclude "^ *[-s]\=include"
57c7403f6599 updated for version 7.0c11
vimboss
parents: 242
diff changeset
23 syn match makeStatement "^ *vpath"
57c7403f6599 updated for version 7.0c11
vimboss
parents: 242
diff changeset
24 syn match makeExport "^ *\(export\|unexport\)\>"
57c7403f6599 updated for version 7.0c11
vimboss
parents: 242
diff changeset
25 syn match makeOverride "^ *override"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 hi link makeOverride makeStatement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 hi link makeExport makeStatement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28
3854
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1698
diff changeset
29 " catch unmatched define/endef keywords. endef only matches it is by itself on a line, possibly followed by a commend
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1698
diff changeset
30 syn region makeDefine start="^\s*define\s" end="^\s*endef\s*\(#.*\)\?$" contains=makeStatement,makeIdent,makePreCondit,makeDefine
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 " Microsoft Makefile specials
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 syn case ignore
820
57c7403f6599 updated for version 7.0c11
vimboss
parents: 242
diff changeset
34 syn match makeInclude "^! *include"
57c7403f6599 updated for version 7.0c11
vimboss
parents: 242
diff changeset
35 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
36 syn case match
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 " identifiers
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 region makeIdent start="\${" skip="\\}\|\\\\" end="}" contains=makeStatement,makeIdent,makeSString,makeDString
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 syn match makeIdent "\$\$\w*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 syn match makeIdent "\$[^({]"
6647
3af822eb4da5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3854
diff changeset
43 syn match makeIdent "^ *[^:#= \t]*\s*[:+?!*]="me=e-2
3af822eb4da5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3854
diff changeset
44 syn match makeIdent "^ *[^:#= \t]*\s*="me=e-1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 syn match makeIdent "%"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 " Makefile.in variables
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 syn match makeConfig "@[A-Za-z0-9_]\+@"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 " make targets
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 " syn match makeSpecTarget "^\.\(SUFFIXES\|PHONY\|DEFAULT\|PRECIOUS\|IGNORE\|SILENT\|EXPORT_ALL_VARIABLES\|KEEP_STATE\|LIBPATTERNS\|NOTPARALLEL\|DELETE_ON_ERROR\|INTERMEDIATE\|POSIX\|SECONDARY\)\>"
3854
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1698
diff changeset
52 syn match makeImplicit "^\.[A-Za-z0-9_./\t -]\+\s*:$"me=e-1 nextgroup=makeSource
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 syn match makeImplicit "^\.[A-Za-z0-9_./\t -]\+\s*:[^=]"me=e-2 nextgroup=makeSource
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54
6647
3af822eb4da5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3854
diff changeset
55 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,makeComment skipnl nextGroup=makeCommands
3af822eb4da5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3854
diff changeset
56 syn match makeTarget "^[~A-Za-z0-9_./$()%*@-][A-Za-z0-9_./\t $()%*@-]*::\=\s*$" contains=makeIdent,makeSpecTarget,makeComment skipnl nextgroup=makeCommands,makeCommandError
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57
6647
3af822eb4da5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3854
diff changeset
58 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,makeComment skipnl nextGroup=makeCommands
3af822eb4da5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3854
diff changeset
59 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,makeComment skipnl nextgroup=makeCommands,makeCommandError
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 syn match makeCommandError "^\s\+\S.*" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 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
63 syn match makeCmdNextLine "\\\n."he=e-1 contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 " Statements / Functions (GNU make)
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1121
diff changeset
67 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
68
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 " Comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 if exists("make_microsoft")
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 820
diff changeset
71 syn match makeComment "#.*" contains=@Spell,makeTodo
820
57c7403f6599 updated for version 7.0c11
vimboss
parents: 242
diff changeset
72 elseif !exists("make_no_comments")
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 820
diff changeset
73 syn region makeComment start="#" end="^$" end="[^\\]$" keepend contains=@Spell,makeTodo
e63691e7c504 updated for version 7.1a
vimboss
parents: 820
diff changeset
74 syn match makeComment "#$" contains=@Spell
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 syn keyword makeTodo TODO FIXME XXX contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 " match escaped quotes and any other escaped character
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 " except for $, as a backslash in front of a $ does
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 " not make it a standard character, but instead it will
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 " still act as the beginning of a variable
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 " The escaped char is not highlightet currently
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 syn match makeEscapedChar "\\[^$]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 syn region makeDString start=+\(\\\)\@<!"+ skip=+\\.+ end=+"+ contains=makeIdent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 syn region makeSString start=+\(\\\)\@<!'+ skip=+\\.+ end=+'+ contains=makeIdent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 syn region makeBString start=+\(\\\)\@<!`+ skip=+\\.+ end=+`+ contains=makeIdent,makeSString,makeDString,makeNextLine
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 " Syncing
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 syn sync minlines=20 maxlines=200
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 " Sync on Make command block region: When searching backwards hits a line that
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 " 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
95 " NONE otherwise.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 syn sync match makeCommandSync groupthere NONE "^[^\t#]"
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}[^:=]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 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
99
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 " Define the default highlighting.
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 6647
diff changeset
101 " Only when an item doesn't have highlighting yet
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
103 hi def link makeNextLine makeSpecial
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
104 hi def link makeCmdNextLine makeSpecial
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
105 hi def link makeSpecTarget Statement
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 6647
diff changeset
106 if !exists("make_no_commands")
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
107 hi def link makeCommands Number
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 endif
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
109 hi def link makeImplicit Function
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
110 hi def link makeTarget Function
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
111 hi def link makeInclude Include
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
112 hi def link makePreCondit PreCondit
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
113 hi def link makeStatement Statement
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
114 hi def link makeIdent Identifier
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
115 hi def link makeSpecial Special
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
116 hi def link makeComment Comment
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
117 hi def link makeDString String
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
118 hi def link makeSString String
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
119 hi def link makeBString Function
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
120 hi def link makeError Error
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
121 hi def link makeTodo Todo
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
122 hi def link makeDefine Define
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
123 hi def link makeCommandError Error
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
124 hi def link makeConfig PreCondit
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126 let b:current_syntax = "make"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127
3854
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1698
diff changeset
128 let &cpo = s:cpo_save
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1698
diff changeset
129 unlet s:cpo_save
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130 " vim: ts=8