robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

Sean Dewarvim-patch:e978b4534a5e (#24697)cbf54ec2a5

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