| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<!DOCTYPE language[ |
| 3 |
<!ENTITY ident "[-_a-zA-Z0-9]+"> |
| 4 |
<!ENTITY deplist "[^$|:]+"> |
| 5 |
]> |
| 6 |
<language |
| 7 |
name="Ninja" section="Other" |
| 8 |
version="3" kateversion="5.0" |
| 9 |
extensions="*.ninja" |
| 10 |
author="Jonathan Poelen ([email protected])" license="MIT" |
| 11 |
> |
| 12 |
<highlighting> |
| 13 |
<list name="keywords"> |
| 14 |
<item>rule</item> |
| 15 |
<item>build</item> |
| 16 |
<item>pool</item> |
| 17 |
<item>default</item> |
| 18 |
<item>include</item> |
| 19 |
<item>subninja</item> |
| 20 |
</list> |
| 21 |
|
| 22 |
<list name="other keywords"> |
| 23 |
<item>console</item> |
| 24 |
<item>phony</item> |
| 25 |
<item>depth</item> |
| 26 |
</list> |
| 27 |
|
| 28 |
<list name="topVariables"> |
| 29 |
<item>builddir</item> |
| 30 |
<item>ninja_required_version</item> |
| 31 |
</list> |
| 32 |
|
| 33 |
<list name="ruleVariables"> |
| 34 |
<item>command</item> |
| 35 |
<item>console</item> |
| 36 |
<item>depfile</item> |
| 37 |
<item>deps</item> |
| 38 |
<item>msvc_deps_prefix</item> |
| 39 |
<item>description</item> |
| 40 |
<item>dyndep</item> |
| 41 |
<item>generator</item> |
| 42 |
<item>in</item> |
| 43 |
<item>in_newline</item> |
| 44 |
<item>out</item> |
| 45 |
<item>pool</item> |
| 46 |
<item>restat</item> |
| 47 |
<item>rspfile</item> |
| 48 |
<item>rspfile_content</item> |
| 49 |
</list> |
| 50 |
|
| 51 |
<contexts> |
| 52 |
<context attribute="Normal" name="Normal" lineEndContext="#stay" fallthrough="1" fallthroughContext="ErrorOrComment"> |
| 53 |
<DetectChar attribute="Comment" context="Comment" char="#"/> |
| 54 |
<WordDetect attribute="Keyword" context="BuildStatement" String="build"/> |
| 55 |
<WordDetect attribute="Keyword" context="RuleStatement" String="rule"/> |
| 56 |
<WordDetect attribute="Keyword" context="PoolStatement" String="pool"/> |
| 57 |
<keyword attribute="Keyword" context="SimpleStatement" String="keywords"/> |
| 58 |
<keyword attribute="Special Key" context="VariableAssignment" String="topVariables"/> |
| 59 |
<RegExpr attribute="Key" context="VariableAssignment" String="&ident;"/> |
| 60 |
</context> |
| 61 |
|
| 62 |
<context attribute="Normal" name="ErrorOrComment" lineEndContext="#pop" fallthrough="1" fallthroughContext="#pop!Error"> |
| 63 |
<DetectSpaces/> |
| 64 |
<DetectChar attribute="Comment" context="Comment" char="#"/> |
| 65 |
</context> |
| 66 |
|
| 67 |
<context attribute="Error" name="Error" lineEndContext="#pop"/> |
| 68 |
|
| 69 |
<!-- rule --> |
| 70 |
|
| 71 |
<context attribute="Normal" name="RuleStatement" lineEndContext="#pop" fallthrough="1" fallthroughContext="Error"> |
| 72 |
<DetectSpaces/> |
| 73 |
<RegExpr attribute="Normal" context="#pop!RuleKeys" String="&ident;"/> |
| 74 |
</context> |
| 75 |
|
| 76 |
<context attribute="Normal" name="RuleKeys" lineEndContext="#stay" fallthrough="1" fallthroughContext="#pop"> |
| 77 |
<DetectSpaces context="RuleKey"/> |
| 78 |
<DetectChar attribute="Comment" context="Comment" char="#"/> |
| 79 |
</context> |
| 80 |
|
| 81 |
<context attribute="Normal" name="RuleKey" lineEndContext="#pop" fallthrough="1" fallthroughContext="#pop!Error"> |
| 82 |
<DetectChar attribute="Comment" context="#pop!Comment" char="#"/> |
| 83 |
<WordDetect attribute="Special Key" context="#pop!PoolVariableAssignment" String="pool"/> |
| 84 |
<keyword attribute="Special Key" context="#pop!RuleVariableAssignment" String="ruleVariables"/> |
| 85 |
</context> |
| 86 |
|
| 87 |
<context attribute="Normal" name="RuleVariableAssignment" lineEndContext="#pop" fallthrough="1" fallthroughContext="Error"> |
| 88 |
<DetectSpaces/> |
| 89 |
<DetectChar attribute="Operator" context="#pop!RuleValue" char="="/> |
| 90 |
</context> |
| 91 |
|
| 92 |
<context attribute="Normal" name="RuleValue" lineEndContext="#pop"> |
| 93 |
<DetectSpaces/> |
| 94 |
<DetectChar attribute="Normal" context="RuleDollar" char="$" lookAhead="true"/> |
| 95 |
<AnyChar attribute="Symbol" context="#stay" String="<>&|=(){}[]"';!%?*"/> |
| 96 |
<RegExpr attribute="Normal" context="#stay" String="[^<>&|=(){}[\]"';!%?*$]"/> |
| 97 |
</context> |
| 98 |
|
| 99 |
<context attribute="Error" name="RuleDollar" lineEndContext="#pop"> |
| 100 |
<LineContinue attribute="Line Continuation" context="#pop!LineContinuation" char="$"/> |
| 101 |
<Detect2Chars attribute="Special Char" context="#pop" char="$" char1=" "/> |
| 102 |
<Detect2Chars attribute="Special Char" context="#pop" char="$" char1="$"/> |
| 103 |
<Detect2Chars attribute="Special Char" context="#pop" char="$" char1=":"/> |
| 104 |
<Detect2Chars attribute="Variable Delimiter" context="#pop!RuleOpenVariableName" char="$" char1="{"/> |
| 105 |
<DetectChar attribute="Variable Delimiter" context="#pop!RuleVariableName" char="$"/> |
| 106 |
</context> |
| 107 |
|
| 108 |
<context attribute="Variable" name="RuleOpenVariableName" lineEndContext="#pop" fallthrough="1" fallthroughContext="Error"> |
| 109 |
<DetectChar attribute="Variable Delimiter" context="#pop" char="}"/> |
| 110 |
<keyword attribute="Special Variable" context="#stay" String="ruleVariables"/> |
| 111 |
<RegExpr attribute="Variable" context="#stay" String="&ident;"/> |
| 112 |
</context> |
| 113 |
|
| 114 |
<context attribute="Variable" name="RuleVariableName" lineEndContext="#pop" fallthrough="1" fallthroughContext="Error"> |
| 115 |
<keyword attribute="Special Variable" context="#pop" String="ruleVariables"/> |
| 116 |
<RegExpr attribute="Variable" context="#pop" String="&ident;"/> |
| 117 |
</context> |
| 118 |
|
| 119 |
<!-- build --> |
| 120 |
|
| 121 |
<context attribute="Normal" name="BuildStatement" lineEndContext="#pop"> |
| 122 |
<DetectSpaces/> |
| 123 |
<DetectChar attribute="Normal" context="Dollar" char="$" lookAhead="true"/> |
| 124 |
<DetectChar attribute="Operator" context="#pop!BuildRuleName" char=":"/> |
| 125 |
<DetectChar attribute="Operator" context="#pop!ImplicitOutput" char="|"/> |
| 126 |
<RegExpr attribute="Normal" context="#stay" String="&deplist;"/> |
| 127 |
</context> |
| 128 |
|
| 129 |
<context attribute="Implicit Output" name="ImplicitOutput" lineEndContext="#pop"> |
| 130 |
<DetectSpaces/> |
| 131 |
<DetectChar attribute="Normal" context="Dollar" char="$" lookAhead="true"/> |
| 132 |
<DetectChar attribute="Operator" context="#pop!BuildRuleName" char=":"/> |
| 133 |
<RegExpr attribute="Implicit Output" context="#stay" String="&deplist;"/> |
| 134 |
</context> |
| 135 |
|
| 136 |
<context attribute="Normal" name="BuildRuleName" lineEndContext="#pop" fallthrough="1" fallthroughContext="#pop!Error"> |
| 137 |
<DetectSpaces/> |
| 138 |
<WordDetect attribute="Special Rule Name" context="#pop!BuildDependancies" String="phony"/> |
| 139 |
<RegExpr attribute="Rule Name" context="#pop!BuildDependancies" String="&ident;"/> |
| 140 |
</context> |
| 141 |
|
| 142 |
<context attribute="Dependancy" name="BuildDependancies" lineEndContext="#pop!BuildKeys"> |
| 143 |
<DetectSpaces/> |
| 144 |
<DetectChar attribute="Normal" context="Dollar" char="$" lookAhead="true"/> |
| 145 |
<Detect2Chars attribute="Operator" context="#pop!ImplicitBuildDependancies" char="|" char1="@"/> |
| 146 |
<DetectChar attribute="Operator" context="#pop!ImplicitBuildDependancies" char="|"/> |
| 147 |
<DetectChar attribute="Error" context="#stay" char=":"/> |
| 148 |
<RegExpr attribute="Dependancy" context="#stay" String="&deplist;"/> |
| 149 |
</context> |
| 150 |
|
| 151 |
<context attribute="Implicit Dependancy" name="ImplicitBuildDependancies" lineEndContext="#pop!BuildKeys"> |
| 152 |
<DetectSpaces/> |
| 153 |
<DetectChar attribute="Normal" context="Dollar" char="$" lookAhead="true"/> |
| 154 |
<Detect2Chars attribute="Operator" context="#stay" char="|" char1="@"/> |
| 155 |
<DetectChar attribute="Operator" context="#stay" char="|"/> |
| 156 |
<DetectChar attribute="Error" context="#stay" char=":"/> |
| 157 |
<RegExpr attribute="Implicit Dependancy" context="#stay" String="&deplist;"/> |
| 158 |
</context> |
| 159 |
|
| 160 |
<context attribute="Normal" name="BuildKeys" lineEndContext="#stay" fallthrough="1" fallthroughContext="#pop"> |
| 161 |
<DetectSpaces context="BuildKey"/> |
| 162 |
<DetectChar attribute="Comment" context="Comment" char="#"/> |
| 163 |
</context> |
| 164 |
|
| 165 |
<context attribute="Normal" name="BuildKey" lineEndContext="#pop" fallthrough="1" fallthroughContext="#pop!Error"> |
| 166 |
<DetectChar attribute="Comment" context="#pop!Comment" char="#"/> |
| 167 |
<WordDetect attribute="Special Key" context="#pop!PoolVariableAssignment" String="pool"/> |
| 168 |
<keyword attribute="Special Key" context="#pop!VariableAssignment" String="ruleVariables"/> |
| 169 |
<RegExpr attribute="Key" context="#pop!VariableAssignment" String="&ident;"/> |
| 170 |
</context> |
| 171 |
|
| 172 |
<!-- pool --> |
| 173 |
|
| 174 |
<context attribute="Normal" name="PoolStatement" lineEndContext="#pop" fallthrough="1" fallthroughContext="#pop!Error"> |
| 175 |
<DetectSpaces/> |
| 176 |
<RegExpr attribute="Normal" context="#pop!PoolKeys" String="&ident;"/> |
| 177 |
</context> |
| 178 |
|
| 179 |
<context attribute="Normal" name="PoolKeys" lineEndContext="#stay" fallthrough="1" fallthroughContext="#pop"> |
| 180 |
<DetectSpaces context="PoolKey"/> |
| 181 |
<DetectChar attribute="Comment" context="Comment" char="#"/> |
| 182 |
</context> |
| 183 |
|
| 184 |
<context attribute="Normal" name="PoolKey" lineEndContext="#pop" fallthrough="1" fallthroughContext="#pop!Error"> |
| 185 |
<DetectChar attribute="Comment" context="#pop!Comment" char="#"/> |
| 186 |
<WordDetect attribute="Special Key" context="#pop!PoolVariableAssignment" String="depth"/> |
| 187 |
</context> |
| 188 |
|
| 189 |
<context attribute="Normal" name="PoolVariableAssignment" lineEndContext="#pop" fallthrough="1" fallthroughContext="Error"> |
| 190 |
<DetectSpaces/> |
| 191 |
<DetectChar attribute="Operator" context="#pop!PoolValue" char="="/> |
| 192 |
</context> |
| 193 |
|
| 194 |
<context attribute="Normal" name="PoolValue" lineEndContext="#pop"> |
| 195 |
<DetectSpaces/> |
| 196 |
<DetectChar attribute="Normal" context="Dollar" char="$" lookAhead="true"/> |
| 197 |
<WordDetect attribute="Special Value" context="BuildStatement" String="console"/> |
| 198 |
<RegExpr attribute="Normal" context="#stay" String="&ident;"/> |
| 199 |
</context> |
| 200 |
|
| 201 |
<!-- default, include, subninja --> |
| 202 |
|
| 203 |
<context attribute="Normal" name="SimpleStatement" lineEndContext="#pop" fallthrough="1" fallthroughContext="#pop!Error"> |
| 204 |
<DetectChar attribute="Normal" context="Dollar" char="$" lookAhead="true"/> |
| 205 |
<RegExpr attribute="Normal" context="#stay" String="&deplist;"/> |
| 206 |
</context> |
| 207 |
|
| 208 |
<!-- Value --> |
| 209 |
|
| 210 |
<context attribute="Normal" name="VariableAssignment" lineEndContext="#pop" fallthrough="1" fallthroughContext="Error"> |
| 211 |
<DetectSpaces/> |
| 212 |
<DetectChar attribute="Operator" context="#pop!Value" char="="/> |
| 213 |
</context> |
| 214 |
|
| 215 |
<context attribute="Normal" name="Value" lineEndContext="#pop"> |
| 216 |
<DetectSpaces/> |
| 217 |
<DetectChar attribute="Normal" context="Dollar" char="$" lookAhead="true"/> |
| 218 |
<AnyChar attribute="Symbol" context="#stay" String="<>&|=(){}[]"';!%?*"/> |
| 219 |
<RegExpr attribute="Normal" context="#stay" String="[^<>&|=(){}[\]"';!%?*$]"/> |
| 220 |
</context> |
| 221 |
|
| 222 |
<!-- $ --> |
| 223 |
|
| 224 |
<context attribute="Error" name="Dollar" lineEndContext="#pop"> |
| 225 |
<LineContinue attribute="Line Continuation" context="#pop!LineContinuation" char="$"/> |
| 226 |
<Detect2Chars attribute="Special Char" context="#pop" char="$" char1=" "/> |
| 227 |
<Detect2Chars attribute="Special Char" context="#pop" char="$" char1="$"/> |
| 228 |
<Detect2Chars attribute="Special Char" context="#pop" char="$" char1=":"/> |
| 229 |
<Detect2Chars attribute="Variable Delimiter" context="#pop!OpenVariableName" char="$" char1="{"/> |
| 230 |
<DetectChar attribute="Variable Delimiter" context="#pop!VariableName" char="$"/> |
| 231 |
</context> |
| 232 |
|
| 233 |
<context attribute="Variable" name="OpenVariableName" lineEndContext="#pop" fallthrough="1" fallthroughContext="Error"> |
| 234 |
<DetectChar attribute="Variable Delimiter" context="#pop" char="}"/> |
| 235 |
<RegExpr attribute="Variable" context="#stay" String="&ident;"/> |
| 236 |
</context> |
| 237 |
|
| 238 |
<context attribute="Variable" name="VariableName" lineEndContext="#pop" fallthrough="1" fallthroughContext="Error"> |
| 239 |
<RegExpr attribute="Variable" context="#pop" String="&ident;"/> |
| 240 |
</context> |
| 241 |
|
| 242 |
<context attribute="Line Continuation" name="LineContinuation" lineEndContext="#pop" fallthrough="1" fallthroughContext="#pop"> |
| 243 |
<DetectSpaces/> |
| 244 |
</context> |
| 245 |
|
| 246 |
<!-- comment --> |
| 247 |
|
| 248 |
<context attribute="Comment" lineEndContext="#pop" name="Comment"> |
| 249 |
<DetectSpaces/> |
| 250 |
<IncludeRules context="##Comments" /> |
| 251 |
<DetectIdentifier attribute="Comment" /> |
| 252 |
</context> |
| 253 |
|
| 254 |
</contexts> |
| 255 |
|
| 256 |
<itemDatas> |
| 257 |
<itemData name="Normal" defStyleNum="dsNormal" spellChecking="0"/> |
| 258 |
<itemData name="Keyword" defStyleNum="dsKeyword" spellChecking="0"/> |
| 259 |
<itemData name="Comment" defStyleNum="dsComment"/> |
| 260 |
<itemData name="Rule Name" defStyleNum="dsFunction" spellChecking="0"/> |
| 261 |
<itemData name="Special Rule Name" defStyleNum="dsBuiltIn" spellChecking="0"/> |
| 262 |
<itemData name="Dependancy" defStyleNum="dsNormal" spellChecking="0"/> |
| 263 |
<itemData name="Implicit Dependancy" defStyleNum="dsNormal" italic="1" spellChecking="0"/> |
| 264 |
<itemData name="Implicit Output" defStyleNum="dsNormal" italic="1" spellChecking="0"/> |
| 265 |
<itemData name="Special Key" defStyleNum="dsBuiltIn" spellChecking="0"/> |
| 266 |
<itemData name="Key" defStyleNum="dsVariable" spellChecking="0"/> |
| 267 |
<itemData name="Variable Delimiter" defStyleNum="dsOperator" spellChecking="0"/> |
| 268 |
<itemData name="Special Variable" defStyleNum="dsBuiltIn" spellChecking="0"/> |
| 269 |
<itemData name="Variable" defStyleNum="dsVariable" spellChecking="0"/> |
| 270 |
<itemData name="Special Value" defStyleNum="dsBuiltIn" spellChecking="0"/> |
| 271 |
<itemData name="Operator" defStyleNum="dsOperator" spellChecking="0"/> |
| 272 |
<itemData name="Line Continuation" defStyleNum="dsSpecialChar" spellChecking="0"/> |
| 273 |
<itemData name="Special Char" defStyleNum="dsSpecialChar" spellChecking="0"/> |
| 274 |
<itemData name="Symbol" defStyleNum="dsNormal" bold="1" spellChecking="0"/> |
| 275 |
<itemData name="Error" defStyleNum="dsError" spellChecking="0"/> |
| 276 |
</itemDatas> |
| 277 |
</highlighting> |
| 278 |
<general> |
| 279 |
<comments> |
| 280 |
<comment name="singleLine" start="#"/> |
| 281 |
</comments> |
| 282 |
</general> |
| 283 |
</language> |
| 284 |
<!-- kate: space-indent on; indent-width 2; replace-tabs on; --> |