| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<!DOCTYPE language> |
| 3 |
<!-- Makefile syntaxfile v0.9 by Per Wigren <[email protected]> --> |
| 4 |
<!-- Modified by Joseph Wenninger <[email protected]> --> |
| 5 |
<!-- Modified by Rui Santana <[email protected]> --> |
| 6 |
<!-- v2.0 by Andreas Nordal <[email protected]> --> |
| 7 |
<!-- small priority to allow for example Makefile.cpp to be detected as cpp file --> |
| 8 |
<!-- v2.1 by Alex Turbov <[email protected]> |
| 9 |
improve comments handling --> |
| 10 |
<!-- v4 by Alex Richardson <[email protected]> |
| 11 |
added bmake support --> |
| 12 |
<!-- v10 by Peter J. Mello <[email protected]> |
| 13 |
Add recognition of POSIX 2013 '::=' operator for variable assignment --> |
| 14 |
<language name="Makefile" section="Other" |
| 15 |
version="14" kateversion="5.0" |
| 16 |
extensions="GNUmakefile;Makefile;makefile;GNUmakefile.*;Makefile.*;makefile.*;*.mk" |
| 17 |
mimetype="text/x-makefile" priority="11" |
| 18 |
author="Per Wigren ([email protected])" license=""> |
| 19 |
|
| 20 |
<!-- https://www.gnu.org/software/make/manual/make.pdf --> |
| 21 |
|
| 22 |
<highlighting> |
| 23 |
<list name="keywords" > |
| 24 |
<item>include</item> |
| 25 |
<item>-include</item> |
| 26 |
<item>override</item> |
| 27 |
<item>define</item> |
| 28 |
<item>endef</item> |
| 29 |
</list> |
| 30 |
<!-- https://www.gnu.org/software/make/manual/html_node/Conditional-Syntax.html --> |
| 31 |
<list name="gmake_if_keywords"> |
| 32 |
<item>if</item> |
| 33 |
<item>ifeq</item> |
| 34 |
<item>ifneq</item> |
| 35 |
<item>ifdef</item> |
| 36 |
<item>ifndef</item> |
| 37 |
</list> |
| 38 |
<list name="gmake_else_keywords"><item>else</item></list> |
| 39 |
<list name="gmake_endif_keywords"><item>endif</item></list> |
| 40 |
<!-- bmake statements: https://www.freebsd.org/cgi/man.cgi?make(1)#INCLUDE_STATEMENTS,_CONDITIONALS_AND_FOR_LOOPS --> |
| 41 |
<list name="bmake_if_keywords"> |
| 42 |
<item>.if</item> |
| 43 |
<item>.ifdef</item> |
| 44 |
<item>.ifndef</item> |
| 45 |
<item>.ifmake</item> |
| 46 |
<item>.ifnmake</item> |
| 47 |
</list> |
| 48 |
<list name="bmake_else_keywords"> |
| 49 |
<item>.elif</item> |
| 50 |
<item>.elifdef</item> |
| 51 |
<item>.elifndef</item> |
| 52 |
<item>.elifmake</item> |
| 53 |
<item>.elifnmake</item> |
| 54 |
<item>.else</item> <!-- TODO: anything following .else should be highlighted as an error --> |
| 55 |
</list> |
| 56 |
<list name="bmake_endif_keywords"><item>.endif</item></list> |
| 57 |
|
| 58 |
<list name="bmake_expressions"> |
| 59 |
<item>defined</item> |
| 60 |
<item>empty</item> |
| 61 |
<item>exists</item> |
| 62 |
<item>target</item> |
| 63 |
<item>commands</item> |
| 64 |
</list> |
| 65 |
|
| 66 |
<list name="bmake_include_stmt"> |
| 67 |
<item>.include</item> |
| 68 |
<item>.-include</item> |
| 69 |
<item>.sinclude</item> |
| 70 |
<!-- For compat bmake also handles include but this is already highlighted. <item>include</item> --> |
| 71 |
</list> |
| 72 |
<list name="bmake_message_stmt"> |
| 73 |
<item>.info</item> |
| 74 |
<item>.warning</item> |
| 75 |
<item>.error</item> |
| 76 |
</list> |
| 77 |
<!-- Use single element list here so that .for/.endfor also shows up in code completion --> |
| 78 |
<list name="bmake_for_stmt"><item>.for</item></list> |
| 79 |
<list name="bmake_endfor_stmt"><item>.endfor</item></list> |
| 80 |
|
| 81 |
<!-- https://www.freebsd.org/cgi/man.cgi?make(1)#SPECIAL_TARGETS --> |
| 82 |
<list name="bmake_special_targets"> |
| 83 |
<item>.BEGIN</item> |
| 84 |
<item>.DEFAULT</item> |
| 85 |
<item>.END</item> |
| 86 |
<item>.ERROR</item> |
| 87 |
<item>.IGNORE</item> |
| 88 |
<item>.INTERRUPT</item> |
| 89 |
<item>.MAIN</item> |
| 90 |
<item>.MAKEFLAGS</item> |
| 91 |
<item>.NOPATH</item> |
| 92 |
<item>.NOTPARALLEL</item> |
| 93 |
<item>.NO_PARALLEL</item> |
| 94 |
<item>.OBJDIR</item> |
| 95 |
<item>.ORDER</item> |
| 96 |
<item>.PATH</item> |
| 97 |
<item>.PHONY</item> |
| 98 |
<item>.PRECIOUS</item> |
| 99 |
<item>.SHELL</item> |
| 100 |
<item>.SILENT</item> |
| 101 |
<item>.STALE</item> |
| 102 |
<item>.SUFFIXES</item> |
| 103 |
</list> |
| 104 |
<!-- https://www.freebsd.org/cgi/man.cgi?make(1)#SPECIAL_SOURCES_(ATTRIBUTES) --> |
| 105 |
<list name="bmake_special_sources"> |
| 106 |
<item>.EXEC</item> |
| 107 |
<item>.IGNORE</item> |
| 108 |
<item>.MADE</item> |
| 109 |
<item>.MAKE</item> |
| 110 |
<item>.META</item> |
| 111 |
<item>.NOMETA</item> |
| 112 |
<item>.NOMETA_CMP</item> |
| 113 |
<item>.NOPATH</item> |
| 114 |
<item>.NOTMAIN</item> |
| 115 |
<item>.OPTIONAL</item> |
| 116 |
<item>.PHONY</item> |
| 117 |
<item>.PRECIOUS</item> |
| 118 |
<item>.RECURSIVE</item> |
| 119 |
<item>.SILENT</item> |
| 120 |
<item>.USE</item> |
| 121 |
<item>.USEBEFORE</item> |
| 122 |
<item>.WAIT</item> |
| 123 |
</list> |
| 124 |
|
| 125 |
<list name="bmake_other_stmts"> |
| 126 |
<item>.unexport-env</item> |
| 127 |
<item>.unexport</item> |
| 128 |
<item>.undef</item> |
| 129 |
<item>.export-env</item> |
| 130 |
<item>.export</item> |
| 131 |
</list> |
| 132 |
|
| 133 |
<list name = "functions"> |
| 134 |
<item>call</item> |
| 135 |
<item>subst</item> |
| 136 |
<item>patsubst</item> |
| 137 |
<item>strip</item> |
| 138 |
<item>findstring</item> |
| 139 |
<item>filter</item> |
| 140 |
<item>filter-out</item> |
| 141 |
<item>sort</item> |
| 142 |
<item>word</item> |
| 143 |
<item>wordlist</item> |
| 144 |
<item>words</item> |
| 145 |
<item>firstword</item> |
| 146 |
<item>lastword</item> |
| 147 |
<item>dir</item> |
| 148 |
<item>notdir</item> |
| 149 |
<item>suffix</item> |
| 150 |
<item>basename</item> |
| 151 |
<item>addsuffix</item> |
| 152 |
<item>addprefix</item> |
| 153 |
<item>join</item> |
| 154 |
<item>wildcard</item> |
| 155 |
<item>realpath</item> |
| 156 |
<item>abspath</item> |
| 157 |
<item>if</item> |
| 158 |
<item>or</item> |
| 159 |
<item>and</item> |
| 160 |
<item>foreach</item> |
| 161 |
<item>value</item> |
| 162 |
<item>eval</item> |
| 163 |
<item>origin</item> |
| 164 |
<item>flavor</item> |
| 165 |
<item>shell</item> |
| 166 |
<item>error</item> |
| 167 |
<item>warning</item> |
| 168 |
<item>info</item> |
| 169 |
</list> |
| 170 |
<contexts> |
| 171 |
<context name="normal" attribute="Normal" lineEndContext="#stay"> |
| 172 |
<DetectSpaces/> |
| 173 |
<DetectChar attribute="Comment" context="Comment" char="#"/> |
| 174 |
<keyword attribute="ControlFlow" String="bmake_if_keywords" context="bmake_conditional" beginRegion="bmake_if" firstNonSpace="true"/> |
| 175 |
<!--TODO: trailing non-space after .else should be highlighted as an error --> |
| 176 |
<keyword attribute="ControlFlow" String="bmake_else_keywords" context="bmake_conditional" endRegion="bmake_if" beginRegion="bmake_if" firstNonSpace="true"/> |
| 177 |
<keyword attribute="ControlFlow" String="bmake_endif_keywords" context="#stay" endRegion="bmake_if"/> |
| 178 |
|
| 179 |
<keyword attribute="ControlFlow" String="gmake_if_keywords" context="#stay" beginRegion="gmake_if" firstNonSpace="true"/> |
| 180 |
<!--TODO: trailing non-space after .else should be highlighted as an error --> |
| 181 |
<keyword attribute="ControlFlow" String="gmake_else_keywords" context="gmake_else" endRegion="gmake_if" beginRegion="gmake_if" firstNonSpace="true"/> |
| 182 |
<keyword attribute="ControlFlow" String="gmake_endif_keywords" context="#stay" endRegion="gmake_if"/> |
| 183 |
|
| 184 |
<RegExpr attribute="Variable" context="assign" String="(([+!?](?!=))?[^:#=\s+!?]*)++(?=\s*([+!?]|::?:?)?=)"/> |
| 185 |
<keyword attribute="Keyword" context="#stay" String="keywords"/> |
| 186 |
<keyword attribute="Keyword" context="bmake_other_stmts" String="bmake_other_stmts" firstNonSpace="true"/> |
| 187 |
<keyword attribute="SpecialTarget" context="bmake_special_target" String="bmake_special_targets" firstNonSpace="true"/> |
| 188 |
<RegExpr attribute="SpecialTarget" context="prereq" String="\.PATH\.[^:]*:" firstNonSpace="true"/> |
| 189 |
<keyword attribute="Keyword" context="bmake_include" String="bmake_include_stmt" firstNonSpace="true"/> |
| 190 |
<keyword attribute="Keyword" context="bmake_message" String="bmake_message_stmt" firstNonSpace="true"/> |
| 191 |
<keyword attribute="Keyword" context="bmake_for_loop" String="bmake_for_stmt" firstNonSpace="true" beginRegion="for"/> |
| 192 |
<keyword attribute="Keyword" context="#stay" String="bmake_endfor_stmt" firstNonSpace="true" endRegion="for"/> |
| 193 |
|
| 194 |
<RegExpr attribute="Section" context="prereq" String="^\.[^.][^:]*:" column="0"/> |
| 195 |
<RegExpr attribute="Target" context="prereq" String="^[^:]*:" column="0"/> |
| 196 |
<DetectIdentifier/> |
| 197 |
<DetectChar attribute="String" context="string"" char="""/> |
| 198 |
<DetectChar attribute="String" context="string'" char="'"/> |
| 199 |
<DetectChar attribute="Operator" context="dollar" char="$"/> |
| 200 |
<Detect2Chars attribute="Special" context="#stay" char="\" char1="#"/> |
| 201 |
<Detect2Chars attribute="Special" context="#stay" char="\" char1="\"/> |
| 202 |
<AnyChar attribute="Operator" context="silent" String="@-" firstNonSpace="1"/> |
| 203 |
</context> |
| 204 |
|
| 205 |
<context name="strings_and_vars" attribute="Normal" lineEndContext="#pop"> |
| 206 |
<DetectChar attribute="Operator" context="dollar" char="$"/> |
| 207 |
<DetectChar attribute="String" context="string"" char="""/> |
| 208 |
<DetectChar attribute="String" context="string'" char="'"/> |
| 209 |
<DetectChar attribute="Comment" context="Comment" char="#"/> |
| 210 |
</context> |
| 211 |
|
| 212 |
<context name="gmake_else" attribute="Normal" lineEndContext="#pop"> |
| 213 |
<DetectSpaces attribute="Normal"/> |
| 214 |
<keyword attribute="ControlFlow" String="gmake_if_keywords" context="#stay"/> |
| 215 |
<IncludeRules context="strings_and_vars"/> |
| 216 |
<Detect2Chars attribute="Special" context="#stay" char="\" char1="#"/> |
| 217 |
<Detect2Chars attribute="Special" context="#stay" char="\" char1="\"/> |
| 218 |
<!-- NOTE: Allow highlighting any variable name (see bug #417379), for example: |
| 219 |
else ifdef foo |
| 220 |
else ifeq (bar, foo) |
| 221 |
--> |
| 222 |
</context> |
| 223 |
|
| 224 |
<context name="bmake_include" attribute="Normal" lineEndContext="#pop"> |
| 225 |
<DetectSpaces /> |
| 226 |
<RangeDetect char="<" char1=">" context="#stay" attribute="Include" /> |
| 227 |
<RangeDetect char=""" char1=""" context="#stay" attribute="Include" /> |
| 228 |
</context> |
| 229 |
|
| 230 |
|
| 231 |
<context name="bmake_conditional" attribute="Normal" lineEndContext="#pop"> |
| 232 |
<DetectSpaces/> |
| 233 |
<IncludeRules context="strings_and_vars"/> |
| 234 |
<keyword attribute="Builtin" context="bmake_expression" String="bmake_expressions"/> |
| 235 |
<Detect2Chars attribute="RealOperator" context="#stay" char="&" char1="&"/> |
| 236 |
<Detect2Chars attribute="RealOperator" context="#stay" char="|" char1="|"/> |
| 237 |
<Detect2Chars attribute="RealOperator" context="#stay" char="!" char1="="/> |
| 238 |
<Detect2Chars attribute="RealOperator" context="#stay" char="=" char1="="/> |
| 239 |
<DetectChar attribute="RealOperator" context="#stay" char="!"/> |
| 240 |
<HlCHex attribute="Number" context="#stay"/> |
| 241 |
<Int attribute="Number" context="#stay"/> |
| 242 |
<DetectIdentifier attribute="Variable" context="#stay"/> |
| 243 |
<LineContinue attribute="Operator" context="#stay"/> |
| 244 |
</context> |
| 245 |
|
| 246 |
<context name="bmake_for_loop" attribute="Variable" lineEndContext="#pop"> |
| 247 |
<DetectSpaces/> |
| 248 |
<IncludeRules context="strings_and_vars"/> |
| 249 |
<WordDetect attribute="RealOperator" context="#stay" String="in" /> |
| 250 |
</context> |
| 251 |
|
| 252 |
<context name="bmake_other_stmts" attribute="Variable" lineEndContext="#pop"> |
| 253 |
<DetectSpaces/> |
| 254 |
<IncludeRules context="strings_and_vars"/> |
| 255 |
</context> |
| 256 |
|
| 257 |
<context name="bmake_expression" attribute="Variable" lineEndContext="#pop"> |
| 258 |
<DetectSpaces/> |
| 259 |
<IncludeRules context="strings_and_vars"/> |
| 260 |
<DetectChar attribute="Normal" context="#stay" char="("/> |
| 261 |
<DetectChar attribute="Normal" context="#pop" char=")"/> |
| 262 |
<DetectIdentifier attribute="Variable"/> |
| 263 |
</context> |
| 264 |
|
| 265 |
<context name="bmake_special_target" attribute="Error" lineEndContext="rule"> |
| 266 |
<!-- anything but spaces before the : should be an error --> |
| 267 |
<DetectSpaces attribute="Normal" /> |
| 268 |
<DetectChar attribute="SpecialTarget" context="#pop!prereq" char=":"/> |
| 269 |
</context> |
| 270 |
|
| 271 |
<context name="bmake_message" attribute="String" lineEndContext="#pop"> |
| 272 |
<DetectChar attribute="Operator" context="dollar" char="$"/> |
| 273 |
</context> |
| 274 |
|
| 275 |
<context name="prereq" attribute="Prereq" lineEndContext="rule"> |
| 276 |
<DetectSpaces/> |
| 277 |
<keyword attribute="SpecialPrereq" context="#stay" String="bmake_special_sources"/> |
| 278 |
<DetectIdentifier/> |
| 279 |
<LineContinue attribute="Operator" context="#stay"/> |
| 280 |
<DetectChar attribute="Operator" context="dollar" char="$"/> |
| 281 |
<Detect2Chars attribute="Special" context="#stay" char="\" char1="#"/> |
| 282 |
<Detect2Chars attribute="Special" context="#stay" char="\" char1="\"/> |
| 283 |
<DetectChar attribute="Comment" context="Comment" char="#"/> |
| 284 |
<DetectChar attribute="Operator" context="inline-rule" char=";"/> |
| 285 |
</context> |
| 286 |
|
| 287 |
<context name="inline-rule" attribute="Normal" lineEndContext="#pop!rule" fallthroughContext="#pop!inline-rule-cmd" fallthrough="1"> |
| 288 |
<DetectSpaces/> |
| 289 |
<LineContinue attribute="Operator" context="#stay"/> |
| 290 |
<AnyChar attribute="Operator" context="silent" String="@-"/> |
| 291 |
</context> |
| 292 |
<context name="inline-rule-cmd" attribute="Normal" lineEndContext="#pop!rule"> |
| 293 |
<DetectSpaces/> |
| 294 |
<DetectIdentifier/> |
| 295 |
<DetectChar attribute="String" context="string"" char="""/> |
| 296 |
<DetectChar attribute="String" context="string'" char="'"/> |
| 297 |
<DetectChar attribute="Operator" context="dollar" char="$"/> |
| 298 |
<Detect2Chars attribute="Special" context="#stay" char="\" char1="#"/> |
| 299 |
<Detect2Chars attribute="Special" context="#stay" char="\" char1="\"/> |
| 300 |
<AnyChar attribute="Operator" context="silent" String="@-" firstNonSpace="1"/> |
| 301 |
<DetectChar attribute="Comment" context="Comment" char="#"/> |
| 302 |
<LineContinue attribute="Operator" context="#stay"/> |
| 303 |
</context> |
| 304 |
|
| 305 |
<context name="rule" attribute="Normal" lineEndContext="#stay"> |
| 306 |
<LineContinue attribute="Operator" context="#stay"/> |
| 307 |
<!-- pop if there is a leading non-tab, |
| 308 |
and in particular, mark leading spaces as errors --> |
| 309 |
<RegExpr attribute="Error" context="#pop#pop#pop" String="^ +" firstNonSpace="1"/> |
| 310 |
<RegExpr context="#pop#pop#pop" String="^[^\t]" lookAhead="1" firstNonSpace="1"/> |
| 311 |
<DetectSpaces/> |
| 312 |
<DetectIdentifier/> |
| 313 |
<DetectChar attribute="String" context="string"" char="""/> |
| 314 |
<DetectChar attribute="String" context="string'" char="'"/> |
| 315 |
<DetectChar attribute="Operator" context="dollar" char="$"/> |
| 316 |
<Detect2Chars attribute="Special" context="#stay" char="\" char1="#"/> |
| 317 |
<Detect2Chars attribute="Special" context="#stay" char="\" char1="\"/> |
| 318 |
<AnyChar attribute="Operator" context="silent" String="@-" firstNonSpace="1"/> |
| 319 |
<DetectChar attribute="Comment" context="Comment" char="#"/> |
| 320 |
</context> |
| 321 |
|
| 322 |
<context name="silent" attribute="Silent" lineEndContext="#pop"> |
| 323 |
<LineContinue attribute="Operator" context="#stay"/> |
| 324 |
<DetectSpaces/> |
| 325 |
<DetectIdentifier/> |
| 326 |
<DetectChar attribute="String" context="string"" char="""/> |
| 327 |
<DetectChar attribute="String" context="string'" char="'"/> |
| 328 |
<DetectChar attribute="Operator" context="dollar" char="$"/> |
| 329 |
<Detect2Chars attribute="Special" context="#stay" char="\" char1="#"/> |
| 330 |
<Detect2Chars attribute="Special" context="#stay" char="\" char1="\"/> |
| 331 |
<DetectChar attribute="Comment" context="Comment" char="#"/> |
| 332 |
</context> |
| 333 |
|
| 334 |
<context name="string"" attribute="String" lineEndContext="#pop"> |
| 335 |
<LineContinue attribute="Operator" context="#stay"/> |
| 336 |
<DetectChar attribute="String" context="#pop" char="""/> |
| 337 |
<DetectChar attribute="Operator" context="dollar" char="$"/> |
| 338 |
</context> |
| 339 |
|
| 340 |
<context name="string'" attribute="String" lineEndContext="#pop"> |
| 341 |
<LineContinue attribute="String" context="#stay"/> |
| 342 |
<DetectChar attribute="String" context="#pop" char="'"/> |
| 343 |
<DetectChar attribute="Operator" context="dollar" char="$"/> |
| 344 |
</context> |
| 345 |
|
| 346 |
<context name="assign" attribute="Operator" lineEndContext="#pop"> |
| 347 |
<DetectSpaces attribute="Normal"/> |
| 348 |
<DetectChar attribute="Operator" context="value" char="="/> |
| 349 |
</context> |
| 350 |
|
| 351 |
<context name="value" attribute="String" lineEndContext="#pop#pop"> |
| 352 |
<LineContinue attribute="Operator"/> |
| 353 |
<DetectChar attribute="Operator" context="dollar" char="$"/> |
| 354 |
<RegExpr attribute="Special" context="#pop#pop" String="@[-_\d\w]*@"/> |
| 355 |
<Detect2Chars attribute="String" char="\" char1="#"/> |
| 356 |
<DetectChar attribute="Comment" context="#pop#pop!Comment" char="#"/> |
| 357 |
</context> |
| 358 |
|
| 359 |
<context name="dollar" attribute="Operator" lineEndContext="#pop"> |
| 360 |
<DetectChar attribute="Operator" context="call(" char="("/> |
| 361 |
<DetectChar attribute="Operator" context="call{" char="{"/> |
| 362 |
<RegExpr attribute="Operator" context="#pop" String="."/> |
| 363 |
</context> |
| 364 |
|
| 365 |
<context name="call(" attribute="Variable" lineEndContext="#stay" fallthroughContext="callVar(" fallthrough="1"> |
| 366 |
<keyword attribute="Keyword" context="callFunc(" String="functions"/> |
| 367 |
</context> |
| 368 |
|
| 369 |
<context name="call{" attribute="Variable" lineEndContext="#stay" fallthroughContext="callVar{" fallthrough="1"> |
| 370 |
<keyword attribute="Keyword" context="callFunc{" String="functions"/> |
| 371 |
</context> |
| 372 |
|
| 373 |
<context name="callVar(" attribute="Variable" lineEndContext="#stay"> |
| 374 |
<DetectChar attribute="Operator" char=")" context="#pop#pop#pop"/> |
| 375 |
<DetectChar attribute="Operator" context="dollar" char="$"/> |
| 376 |
<DetectSpaces attribute="Error" context="#stay"/> |
| 377 |
<DetectChar attribute="RealOperator" context="SubstitutionRefs" char=":"/> |
| 378 |
<AnyChar attribute="Error" context="#stay" String="=#"/> |
| 379 |
</context> |
| 380 |
|
| 381 |
<context name="callVar{" attribute="Variable" lineEndContext="#stay"> |
| 382 |
<DetectChar attribute="Operator" char="}" context="#pop#pop#pop"/> |
| 383 |
<DetectChar attribute="Operator" context="dollar" char="$"/> |
| 384 |
<DetectSpaces attribute="Error" context="#stay"/> |
| 385 |
<!-- Handle bmake Variable modifiers: ${variable[:modifier[:...]]} --> |
| 386 |
<Detect2Chars context="#stay" char="\" char1=":"/> |
| 387 |
<!-- other modifiers --> |
| 388 |
<DetectChar attribute="RealOperator" context="bmake_var_modifier" char=":"/> |
| 389 |
<AnyChar attribute="Error" context="#stay" String="=#"/> |
| 390 |
</context> |
| 391 |
|
| 392 |
<context name="bmake_var_modifier_arg" attribute="VarModifier" lineEndContext="#pop"> |
| 393 |
<DetectChar attribute="Operator" context="dollar" char="$"/> |
| 394 |
<Detect2Chars context="#stay" char="\" char1="}"/> |
| 395 |
<DetectChar attribute="Operator" char="}" context="#pop#pop#pop#pop"/> |
| 396 |
<Detect2Chars context="#stay" char="\" char1=":"/> |
| 397 |
<DetectChar attribute="RealOperator" context="#pop!bmake_var_modifier" char=":"/> |
| 398 |
</context> |
| 399 |
|
| 400 |
<!-- TODO: once all modifiers are properly handled change fallthroughContext to "expect}" --> |
| 401 |
<context name="bmake_var_modifier" attribute="VarModifier" lineEndContext="#pop" fallthroughContext="#pop!bmake_var_modifier_arg" fallthrough="true"> |
| 402 |
<DetectChar attribute="Operator" context="dollar" char="$"/> |
| 403 |
|
| 404 |
<!-- |
| 405 |
TODO :?true_string:false_string |
| 406 |
TODO :old_string=new_string This is the AT&T System V UNIX style variable substitution. |
| 407 |
TODO :@temp@string@ This is the loop expansion mechanism from the OSF Development Environment (ODE) make. |
| 408 |
TODO :!cmd! The output of running cmd is the value. |
| 409 |
TODO :[range] |
| 410 |
--> |
| 411 |
<!-- Modifiers without arguments:--> |
| 412 |
<!-- :Ox Randomize words in variable. --> |
| 413 |
<Detect2Chars attribute="Builtin" context="#pop!expect}" char="O" char1="x"/> |
| 414 |
<!-- |
| 415 |
:E Replaces each word in the variable with its suffix. |
| 416 |
:H Replaces each word in the variable with everything but the last component. |
| 417 |
:O Order every word in variable alphabetically. |
| 418 |
:Q Quotes every shell meta-character in the variable |
| 419 |
:R Replaces each word in the variable with everything but its suffix. |
| 420 |
:T Replaces each word in the variable with its last component. |
| 421 |
:u Remove adjacent duplicate words (like uniq(1)). |
| 422 |
:L The name of the variable is the value. |
| 423 |
:P The path of the node which has the same name as the variable is the value. |
| 424 |
--> |
| 425 |
<AnyChar attribute="Builtin" context="#pop!expect}" String="EHOQRTuLP"/> |
| 426 |
<!-- :sh If the variable is non-empty it is run as a command and the output becomes the new value. --> |
| 427 |
<Detect2Chars attribute="Builtin" context="#pop!expect}" char="s" char1="h"/> |
| 428 |
<!-- :tA Attempt to convert variable to an absolute path using realpath(3),--> |
| 429 |
<Detect2Chars attribute="Builtin" context="#pop!expect}" char="t" char1="A"/> |
| 430 |
<!-- :tl Converts variable to lower-case letters.--> |
| 431 |
<Detect2Chars attribute="Builtin" context="#pop!expect}" char="t" char1="L"/> |
| 432 |
<!-- :gmtime The value is a format string for strftime(3), using the current gmtime(3). --> |
| 433 |
<StringDetect attribute="Builtin" String="gmtime" context="#pop!expect}" /> |
| 434 |
<!-- :hash Compute a 32bit hash of the value and encode it as hex digits. --> |
| 435 |
<StringDetect attribute="Builtin" String="hash" context="#pop!expect}" /> |
| 436 |
<!-- :localtime The value is a format string for strftime(3), using the current localtime(3). --> |
| 437 |
<StringDetect attribute="Builtin" String="localtime" context="#pop!expect}" /> |
| 438 |
<!--Now the modifiers with arguments:--> |
| 439 |
<!-- |
| 440 |
:Mpattern Select only those words that match pattern. |
| 441 |
:Npattern This is identical to `:M', but selects all words which do not match pattern. |
| 442 |
:Dnewval If the variable is defined newval is the value. |
| 443 |
:Unewval If the variable is undefined newval is the value. |
| 444 |
--> |
| 445 |
<!-- TODO: add new context to highligh old_string and new_string differently |
| 446 |
:S/old_string/new_string/[1gW] |
| 447 |
:C/pattern/replacement/[1gW] |
| 448 |
--> |
| 449 |
<AnyChar attribute="Builtin" context="#pop!bmake_var_modifier_arg" String="MNDUSC"/> |
| 450 |
<!-- ::=str The variable is assigned the value str after substitution. --> |
| 451 |
<Detect2Chars attribute="Builtin" context="#pop!bmake_var_modifier_arg" char=":" char1="="/> |
| 452 |
<!-- ::?=str As for ::= but only if the variable does not already have a value. --> |
| 453 |
<StringDetect attribute="Builtin" String=":?=" context="#pop!bmake_var_modifier_arg" /> |
| 454 |
<!-- ::+=str Append str to the variable. --> |
| 455 |
<StringDetect attribute="Builtin" String=":+=" context="#pop!bmake_var_modifier_arg" /> |
| 456 |
<!-- ::!=cmd Assign the output of cmd to the variable. --> |
| 457 |
<StringDetect attribute="Builtin" String=":!=" context="#pop!bmake_var_modifier_arg" /> |
| 458 |
<!-- :tu Converts variable to upper-case letters. --> |
| 459 |
<Detect2Chars attribute="Builtin" context="#pop!bmake_var_modifier_arg" char="t" char1="u"/> |
| 460 |
<!-- :tW Causes the value to be treated as a single word. See also `:[*]'. --> |
| 461 |
<Detect2Chars attribute="Builtin" context="#pop!bmake_var_modifier_arg" char="t" char1="W"/> |
| 462 |
<!-- :tw Causes the value to be treated as a sequence of words delimited by white space. See also `:[@]'.--> |
| 463 |
<Detect2Chars attribute="Builtin" context="#pop!bmake_var_modifier_arg" char="t" char1="w"/> |
| 464 |
<!-- :tsc Words in the variable are normally separated by a space on |
| 465 |
expansion. This modifier sets the separator to the character c. If |
| 466 |
c is omitted, then no separator is used. The common escapes |
| 467 |
(including octal numeric codes), work as expected. --> |
| 468 |
<Detect2Chars attribute="Builtin" context="#pop!bmake_var_modifier_arg" char="t" char1="s"/> |
| 469 |
|
| 470 |
<IncludeRules context="bmake_var_modifier_arg"/> |
| 471 |
</context> |
| 472 |
|
| 473 |
<context name="expect}" attribute="Error" lineEndContext="#pop#pop#pop#pop"> |
| 474 |
<Detect2Chars context="#stay" char="\" char1="}"/> |
| 475 |
<DetectChar attribute="Operator" char="}" context="#pop#pop#pop#pop"/> |
| 476 |
</context> |
| 477 |
|
| 478 |
<context name="callFunc(" attribute="FuncParam" lineEndContext="#stay"> |
| 479 |
<DetectChar attribute="Operator" char=")" context="#pop#pop#pop"/> |
| 480 |
<DetectChar attribute="Operator" context="dollar" char="$"/> |
| 481 |
<DetectChar attribute="Keyword" context="#stay" char=","/> |
| 482 |
<DetectChar attribute="String" context="string"" char="""/> |
| 483 |
<DetectChar attribute="String" context="string'" char="'"/> |
| 484 |
</context> |
| 485 |
|
| 486 |
<context name="callFunc{" attribute="FuncParam" lineEndContext="#stay"> |
| 487 |
<DetectChar attribute="Operator" char="}" context="#pop#pop#pop"/> |
| 488 |
<DetectChar attribute="Operator" context="dollar" char="$"/> |
| 489 |
<DetectChar attribute="Keyword" context="#stay" char=","/> |
| 490 |
<DetectChar attribute="String" context="string"" char="""/> |
| 491 |
<DetectChar attribute="String" context="string'" char="'"/> |
| 492 |
</context> |
| 493 |
|
| 494 |
<!-- $(var:pattern=replacement) --> |
| 495 |
<context name="SubstitutionRefs" attribute="VarModifier" lineEndContext="#stay"> |
| 496 |
<DetectChar attribute="RealOperator" context="#pop!SubstitutionRefsReplacement" char="="/> |
| 497 |
<IncludeRules context="SubstitutionRefsReplacement"/> |
| 498 |
</context> |
| 499 |
<context name="SubstitutionRefsReplacement" attribute="VarModifier" lineEndContext="#stay"> |
| 500 |
<DetectChar attribute="Operator" char=")" context="#pop#pop#pop#pop"/> |
| 501 |
<DetectChar attribute="Operator" context="dollar" char="$"/> |
| 502 |
</context> |
| 503 |
|
| 504 |
<context attribute="Comment" lineEndContext="#pop" name="Comment"> |
| 505 |
<LineContinue attribute="Comment" context="#stay" /> |
| 506 |
<IncludeRules context="##Comments" /> |
| 507 |
</context> |
| 508 |
|
| 509 |
</contexts> |
| 510 |
<itemDatas> |
| 511 |
<itemData name="Normal" defStyleNum="dsNormal" spellChecking="0"/> |
| 512 |
<itemData name="Keyword" defStyleNum="dsKeyword" spellChecking="0"/> |
| 513 |
<itemData name="Comment" defStyleNum="dsComment"/> |
| 514 |
<itemData name="String" defStyleNum="dsString" spellChecking="0"/> |
| 515 |
<itemData name="Variable" defStyleNum="dsDataType" spellChecking="0"/> |
| 516 |
<itemData name="Target" defStyleNum="dsDecVal" spellChecking="0"/> |
| 517 |
<itemData name="Section" defStyleNum="dsOthers" spellChecking="0"/> |
| 518 |
<itemData name="Prereq" defStyleNum="dsDataType" spellChecking="0"/> |
| 519 |
<itemData name="FuncParam" defStyleNum="dsString" spellChecking="0"/> |
| 520 |
<itemData name="Operator" defStyleNum="dsChar" spellChecking="0"/> |
| 521 |
<itemData name="Silent" defStyleNum="dsFunction" spellChecking="0"/> |
| 522 |
<itemData name="Special" defStyleNum="dsFloat" spellChecking="0"/> |
| 523 |
<itemData name="Error" defStyleNum="dsError" spellChecking="0"/> |
| 524 |
<itemData name="Builtin" defStyleNum="dsBuiltIn" spellChecking="0"/> |
| 525 |
<itemData name="Number" defStyleNum="dsDecVal" spellChecking="0"/> |
| 526 |
<itemData name="Include" defStyleNum="dsImport" spellChecking="0"/> |
| 527 |
<itemData name="ControlFlow" defStyleNum="dsControlFlow" spellChecking="0"/> |
| 528 |
<itemData name="VarModifier" defStyleNum="dsSpecialString" spellChecking="0"/> |
| 529 |
<itemData name="RealOperator" defStyleNum="dsKeyword" spellChecking="0"/> |
| 530 |
<itemData name="SpecialTarget" defStyleNum="dsOthers" spellChecking="0" bold="1"/> |
| 531 |
<itemData name="SpecialPrereq" defStyleNum="dsDataType" spellChecking="0" bold="1"/> |
| 532 |
</itemDatas> |
| 533 |
</highlighting> |
| 534 |
<general> |
| 535 |
<comments> |
| 536 |
<comment name = "singleLine" start = "#"/> |
| 537 |
</comments> |
| 538 |
<!-- '-' is not a deliminator in function filter-out --> |
| 539 |
<keywords casesensitive="1" weakDeliminator = ".-"/> |
| 540 |
</general> |
| 541 |
</language> |
| 542 |
<!-- kate: syntax XML; space-indent on; indent-width 2; replace-tabs on; --> |