2 " Language: A-A-P recipe
3 " Maintainer: Bram Moolenaar <Bram@vim.org>
4 " Last Change: 2004 Jun 13
6 " Quit when a syntax file was already loaded
7 if exists("b:current_syntax")
14 syn include @aapPythonScript syntax/python.vim
16 syn match aapVariable /$[-+?*="'\\!]*[a-zA-Z0-9_.]*/
17 syn match aapVariable /$[-+?*="'\\!]*([a-zA-Z0-9_.]*)/
18 syn keyword aapTodo contained TODO Todo
19 syn match aapString +'[^']\{-}'+
20 syn match aapString +"[^"]\{-}"+
22 syn match aapCommand '^\s*:action\>'
23 syn match aapCommand '^\s*:add\>'
24 syn match aapCommand '^\s*:addall\>'
25 syn match aapCommand '^\s*:asroot\>'
26 syn match aapCommand '^\s*:assertpkg\>'
27 syn match aapCommand '^\s*:attr\>'
28 syn match aapCommand '^\s*:attribute\>'
29 syn match aapCommand '^\s*:autodepend\>'
30 syn match aapCommand '^\s*:buildcheck\>'
31 syn match aapCommand '^\s*:cd\>'
32 syn match aapCommand '^\s*:chdir\>'
33 syn match aapCommand '^\s*:checkin\>'
34 syn match aapCommand '^\s*:checkout\>'
35 syn match aapCommand '^\s*:child\>'
36 syn match aapCommand '^\s*:chmod\>'
37 syn match aapCommand '^\s*:commit\>'
38 syn match aapCommand '^\s*:commitall\>'
39 syn match aapCommand '^\s*:conf\>'
40 syn match aapCommand '^\s*:copy\>'
41 syn match aapCommand '^\s*:del\>'
42 syn match aapCommand '^\s*:deldir\>'
43 syn match aapCommand '^\s*:delete\>'
44 syn match aapCommand '^\s*:delrule\>'
45 syn match aapCommand '^\s*:dll\>'
46 syn match aapCommand '^\s*:do\>'
47 syn match aapCommand '^\s*:error\>'
48 syn match aapCommand '^\s*:execute\>'
49 syn match aapCommand '^\s*:exit\>'
50 syn match aapCommand '^\s*:export\>'
51 syn match aapCommand '^\s*:fetch\>'
52 syn match aapCommand '^\s*:fetchall\>'
53 syn match aapCommand '^\s*:filetype\>'
54 syn match aapCommand '^\s*:finish\>'
55 syn match aapCommand '^\s*:global\>'
56 syn match aapCommand '^\s*:import\>'
57 syn match aapCommand '^\s*:include\>'
58 syn match aapCommand '^\s*:installpkg\>'
59 syn match aapCommand '^\s*:lib\>'
60 syn match aapCommand '^\s*:local\>'
61 syn match aapCommand '^\s*:log\>'
62 syn match aapCommand '^\s*:ltlib\>'
63 syn match aapCommand '^\s*:mkdir\>'
64 syn match aapCommand '^\s*:mkdownload\>'
65 syn match aapCommand '^\s*:move\>'
66 syn match aapCommand '^\s*:pass\>'
67 syn match aapCommand '^\s*:popdir\>'
68 syn match aapCommand '^\s*:produce\>'
69 syn match aapCommand '^\s*:program\>'
70 syn match aapCommand '^\s*:progsearch\>'
71 syn match aapCommand '^\s*:publish\>'
72 syn match aapCommand '^\s*:publishall\>'
73 syn match aapCommand '^\s*:pushdir\>'
74 syn match aapCommand '^\s*:quit\>'
75 syn match aapCommand '^\s*:recipe\>'
76 syn match aapCommand '^\s*:refresh\>'
77 syn match aapCommand '^\s*:remove\>'
78 syn match aapCommand '^\s*:removeall\>'
79 syn match aapCommand '^\s*:require\>'
80 syn match aapCommand '^\s*:revise\>'
81 syn match aapCommand '^\s*:reviseall\>'
82 syn match aapCommand '^\s*:route\>'
83 syn match aapCommand '^\s*:rule\>'
84 syn match aapCommand '^\s*:start\>'
85 syn match aapCommand '^\s*:symlink\>'
86 syn match aapCommand '^\s*:sys\>'
87 syn match aapCommand '^\s*:sysdepend\>'
88 syn match aapCommand '^\s*:syspath\>'
89 syn match aapCommand '^\s*:system\>'
90 syn match aapCommand '^\s*:tag\>'
91 syn match aapCommand '^\s*:tagall\>'
92 syn match aapCommand '^\s*:toolsearch\>'
93 syn match aapCommand '^\s*:totype\>'
94 syn match aapCommand '^\s*:touch\>'
95 syn match aapCommand '^\s*:tree\>'
96 syn match aapCommand '^\s*:unlock\>'
97 syn match aapCommand '^\s*:update\>'
98 syn match aapCommand '^\s*:usetool\>'
99 syn match aapCommand '^\s*:variant\>'
100 syn match aapCommand '^\s*:verscont\>'
102 syn match aapCommand '^\s*:print\>' nextgroup=aapPipeEnd
103 syn match aapPipeCmd '\s*:print\>' nextgroup=aapPipeEnd contained
104 syn match aapCommand '^\s*:cat\>' nextgroup=aapPipeEnd
105 syn match aapPipeCmd '\s*:cat\>' nextgroup=aapPipeEnd contained
106 syn match aapCommand '^\s*:syseval\>' nextgroup=aapPipeEnd
107 syn match aapPipeCmd '\s*:syseval\>' nextgroup=aapPipeEnd contained
108 syn match aapPipeCmd '\s*:assign\>' contained
109 syn match aapCommand '^\s*:eval\>' nextgroup=aapPipeEnd
110 syn match aapPipeCmd '\s*:eval\>' nextgroup=aapPipeEndPy contained
111 syn match aapPipeCmd '\s*:tee\>' nextgroup=aapPipeEnd contained
112 syn match aapPipeCmd '\s*:log\>' nextgroup=aapPipeEnd contained
113 syn match aapPipeEnd '[^|]*|' nextgroup=aapPipeCmd contained skipnl
114 syn match aapPipeEndPy '[^|]*|' nextgroup=aapPipeCmd contained skipnl contains=@aapPythonScript
115 syn match aapPipeStart '^\s*|' nextgroup=aapPipeCmd
118 " A Python line starts with @. Can be continued with a trailing backslash.
119 syn region aapPythonRegion start="\s*@" skip='\\$' end=+$+ contains=@aapPythonScript keepend
121 " A Python block starts with ":python" and continues so long as the indent is
123 syn region aapPythonRegion matchgroup=aapCommand start="\z(\s*\):python" skip='\n\z1\s\|\n\s*\n' end=+$+ contains=@aapPythonScript
125 " A Python expression is enclosed in backticks.
126 syn region aapPythonRegion start="`" skip="``" end="`" contains=@aapPythonScript
128 " TODO: There is something wrong with line continuation.
129 syn match aapComment '#.*' contains=aapTodo
130 syn match aapComment '#.*\(\\\n.*\)' contains=aapTodo
132 syn match aapSpecial '$#'
133 syn match aapSpecial '$\$'
134 syn match aapSpecial '$(.)'
136 " A heredoc assignment.
137 syn region aapHeredoc start="^\s*\k\+\s*$\=+\=?\=<<\s*\z(\S*\)"hs=e+1 end="^\s*\z1\s*$"he=s-1
139 " Syncing is needed for ":python" and "VAR << EOF". Don't use Python syncing
143 " The default highlighting.
144 hi def link aapTodo Todo
145 hi def link aapString String
146 hi def link aapComment Comment
147 hi def link aapSpecial Special
148 hi def link aapVariable Identifier
149 hi def link aapPipeCmd aapCommand
150 hi def link aapCommand Statement
151 hi def link aapHeredoc Constant
153 let b:current_syntax = "aap"
155 let &cpo = s:cpo_save