annotate runtime/syntax/make.vim @ 17589:5c29f5419166

Added tag v8.1.1791 for changeset 1348696d07cdd072693ef089260c7eb7acaacaf4
author Bram Moolenaar <Bram@vim.org>
date Fri, 02 Aug 2019 20:00:09 +0200
parents a23c883685cb
children 76af6d0ea316
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
15878
314694a2e74a Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
3 " Maintainer: Roland Hieber <rohieb+vim-iR0jGdkV@rohieb.name>
314694a2e74a Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
4 " Previous Maintainer: Claudio Fleiner <claudio@fleiner.com>
314694a2e74a Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
5 " URL: https://github.com/vim/vim/syntax/make.vim
16208
a23c883685cb Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15878
diff changeset
6 " Last Change: 2019 Apr 02
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 6647
diff changeset
8 " 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
9 if exists("b:current_syntax")
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12
3854
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1698
diff changeset
13 let s:cpo_save = &cpo
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1698
diff changeset
14 set cpo&vim
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1698
diff changeset
15
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1698
diff changeset
16
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 " some special characters
820
57c7403f6599 updated for version 7.0c11
vimboss
parents: 242
diff changeset
18 syn match makeSpecial "^\s*[@+-]\+"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 syn match makeNextLine "\\\n\s*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 " some directives
16208
a23c883685cb Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15878
diff changeset
22 syn match makePreCondit "^ *\(ifn\=\(eq\|def\)\>\|else\(\s\+ifn\=\(eq\|def\)\)\=\>\|endif\>\)"
820
57c7403f6599 updated for version 7.0c11
vimboss
parents: 242
diff changeset
23 syn match makeInclude "^ *[-s]\=include"
57c7403f6599 updated for version 7.0c11
vimboss
parents: 242
diff changeset
24 syn match makeStatement "^ *vpath"
57c7403f6599 updated for version 7.0c11
vimboss
parents: 242
diff changeset
25 syn match makeExport "^ *\(export\|unexport\)\>"
57c7403f6599 updated for version 7.0c11
vimboss
parents: 242
diff changeset
26 syn match makeOverride "^ *override"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 hi link makeOverride makeStatement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 hi link makeExport makeStatement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29
3854
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1698
diff changeset
30 " 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
31 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
32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 " Microsoft Makefile specials
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 syn case ignore
16208
a23c883685cb Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15878
diff changeset
35 syn match makeInclude "^!\s*include"
a23c883685cb Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15878
diff changeset
36 syn match makePreCondit "^!\s*\(cmdswitches\|error\|message\|include\|if\|ifdef\|ifndef\|else\|else\s*if\|else\s*ifdef\|else\s*ifndef\|endif\|undef\)\>"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 syn case match
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 " identifiers
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 region makeIdent start="\${" skip="\\}\|\\\\" end="}" contains=makeStatement,makeIdent,makeSString,makeDString
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 syn match makeIdent "\$\$\w*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 syn match makeIdent "\$[^({]"
6647
3af822eb4da5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3854
diff changeset
44 syn match makeIdent "^ *[^:#= \t]*\s*[:+?!*]="me=e-2
3af822eb4da5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3854
diff changeset
45 syn match makeIdent "^ *[^:#= \t]*\s*="me=e-1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 syn match makeIdent "%"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 " Makefile.in variables
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 syn match makeConfig "@[A-Za-z0-9_]\+@"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 " make targets
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 " 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
53 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
54 syn match makeImplicit "^\.[A-Za-z0-9_./\t -]\+\s*:[^=]"me=e-2 nextgroup=makeSource
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55
6647
3af822eb4da5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3854
diff changeset
56 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
57 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
58
6647
3af822eb4da5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3854
diff changeset
59 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
60 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
61
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 syn match makeCommandError "^\s\+\S.*" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 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
64 syn match makeCmdNextLine "\\\n."he=e-1 contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 " Statements / Functions (GNU make)
15878
314694a2e74a Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
68 syn match makeStatement contained "(\(abspath\|addprefix\|addsuffix\|and\|basename\|call\|dir\|error\|eval\|file\|filter-out\|filter\|findstring\|firstword\|flavor\|foreach\|guile\|if\|info\|join\|lastword\|notdir\|or\|origin\|patsubst\|realpath\|shell\|sort\|strip\|subst\|suffix\|value\|warning\|wildcard\|word\|wordlist\|words\)\>"ms=s+1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 " Comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 if exists("make_microsoft")
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 820
diff changeset
72 syn match makeComment "#.*" contains=@Spell,makeTodo
820
57c7403f6599 updated for version 7.0c11
vimboss
parents: 242
diff changeset
73 elseif !exists("make_no_comments")
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 820
diff changeset
74 syn region makeComment start="#" end="^$" end="[^\\]$" keepend contains=@Spell,makeTodo
e63691e7c504 updated for version 7.1a
vimboss
parents: 820
diff changeset
75 syn match makeComment "#$" contains=@Spell
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 syn keyword makeTodo TODO FIXME XXX contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 " match escaped quotes and any other escaped character
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 " except for $, as a backslash in front of a $ does
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 " not make it a standard character, but instead it will
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 " still act as the beginning of a variable
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 " The escaped char is not highlightet currently
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 syn match makeEscapedChar "\\[^$]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 syn region makeDString start=+\(\\\)\@<!"+ skip=+\\.+ end=+"+ contains=makeIdent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 syn region makeSString start=+\(\\\)\@<!'+ skip=+\\.+ end=+'+ contains=makeIdent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 syn region makeBString start=+\(\\\)\@<!`+ skip=+\\.+ end=+`+ contains=makeIdent,makeSString,makeDString,makeNextLine
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 " Syncing
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 syn sync minlines=20 maxlines=200
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 " Sync on Make command block region: When searching backwards hits a line that
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 " 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
96 " NONE otherwise.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 syn sync match makeCommandSync groupthere NONE "^[^\t#]"
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}[^:=]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 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
100
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 " Define the default highlighting.
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 6647
diff changeset
102 " Only when an item doesn't have highlighting yet
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103
16208
a23c883685cb Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15878
diff changeset
104 hi def link makeNextLine makeSpecial
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
105 hi def link makeCmdNextLine makeSpecial
16208
a23c883685cb Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15878
diff changeset
106 hi def link makeSpecTarget Statement
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 6647
diff changeset
107 if !exists("make_no_commands")
16208
a23c883685cb Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15878
diff changeset
108 hi def link makeCommands Number
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 endif
16208
a23c883685cb Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15878
diff changeset
110 hi def link makeImplicit Function
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
111 hi def link makeTarget Function
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
112 hi def link makeInclude Include
16208
a23c883685cb Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15878
diff changeset
113 hi def link makePreCondit PreCondit
a23c883685cb Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15878
diff changeset
114 hi def link makeStatement Statement
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
115 hi def link makeIdent Identifier
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
116 hi def link makeSpecial Special
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
117 hi def link makeComment Comment
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
118 hi def link makeDString String
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
119 hi def link makeSString String
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
120 hi def link makeBString Function
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
121 hi def link makeError Error
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
122 hi def link makeTodo Todo
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
123 hi def link makeDefine Define
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
124 hi def link makeCommandError Error
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
125 hi def link makeConfig PreCondit
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127 let b:current_syntax = "make"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128
3854
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1698
diff changeset
129 let &cpo = s:cpo_save
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1698
diff changeset
130 unlet s:cpo_save
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131 " vim: ts=8