| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<!-- |
| 3 |
|
| 4 |
gedit syntax highlighter for the Nasal scripting language. |
| 5 |
|
| 6 |
Just drop it in the gtksourceview-X.X/lanugage-specs folder: |
| 7 |
Linux: /usr/share/gtksourceview-X.X/language-specs/ |
| 8 |
Mac: Applications/gedit/Contents/Resources/share/gtksourceview-X.X/language specs |
| 9 |
|
| 10 |
Copyright (C) 2013 Philosopher |
| 11 |
Author: Philosopher (Flightgear forums) |
| 12 |
http://forum.flightgear.org/viewtopic.php?f=30&t=17265#p164133 |
| 13 |
|
| 14 |
This library is free software; you can redistribute it and/or |
| 15 |
modify it under the terms of the GNU Library General Public |
| 16 |
License as published by the Free Software Foundation; either |
| 17 |
version 2 of the License, or (at your option) any later version. |
| 18 |
|
| 19 |
This library is distributed in the hope that it will be useful, |
| 20 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 21 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 22 |
Library General Public License for more details. |
| 23 |
|
| 24 |
You should have received a copy of the GNU Library General Public |
| 25 |
License along with this library; if not, write to the |
| 26 |
Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 27 |
Boston, MA 02111-1307, USA. |
| 28 |
|
| 29 |
--> |
| 30 |
<language id="nasal" _name="Nasal" version="2.0" _section="Scripts"> |
| 31 |
<metadata> |
| 32 |
<property name="globs">*.nas</property> |
| 33 |
<property name="line-comment-start">#</property> |
| 34 |
</metadata> |
| 35 |
|
| 36 |
<styles> |
| 37 |
<style id="module-handler" _name="Module Handler" map-to="def:preprocessor"/> |
| 38 |
<style id="keyword" _name="Keyword" map-to="def:keyword"/> |
| 39 |
<style id="blockoid" _name="Blockoid" map-to="def:keyword"/> |
| 40 |
<style id="operator" _name="Operator" map-to="def:operator"/> |
| 41 |
|
| 42 |
<style id="builtin-constant" _name="Builtin Constant" map-to="def:special-constant"/> |
| 43 |
<style id="builtin-object" _name="Builtin Object" map-to="def:type"/> |
| 44 |
<style id="node-object" _name="Flightgear Node" map-to="def:type"/> |
| 45 |
<style id="builtin-function" _name="Builtin Function" map-to="def:builtin"/> |
| 46 |
|
| 47 |
<style id="boolean" _name="Boolean" map-to="def:boolean"/> |
| 48 |
<style id="floating-point" _name="Floating point number" map-to="def:floating-point"/> |
| 49 |
<style id="decimal" _name="Decimal number" map-to="def:decimal"/> |
| 50 |
<style id="base-n-integer" _name="Base-N number" map-to="def:base-n-integer"/> |
| 51 |
<style id="special-variable" _name="Special Variable" map-to="def:preprocessor"/><!-- def:identifier --> |
| 52 |
<style id="string-conversion" _name="String conversion numeric"/> |
| 53 |
|
| 54 |
<style id="string" _name="String" map-to="def:string"/> |
| 55 |
<style id="escaped-char" _name="Escaped Character" map-to="def:special-char"/> |
| 56 |
<style id="format" _name="Format" map-to="def:special-char"/> |
| 57 |
<style id="path" _name="Path" map-to="def:type"/> |
| 58 |
<style id="types" _name="Type Object" map-to="def:type"/> |
| 59 |
</styles> |
| 60 |
|
| 61 |
<definitions> |
| 62 |
<!-- Basic lexing constructs: --> |
| 63 |
<define-regex id="identifier">[_a-zA-Z][_a-zA-Z0-9]*</define-regex> |
| 64 |
<define-regex id="number">[1-9][0-9]*</define-regex> |
| 65 |
<context id="number" style-ref="decimal"> |
| 66 |
<match>(?<![0-9a-zA-Z])(0x[0-9a-fA-F]+|([0-9]*\.)?[0-9]+([eE][-+]?[0-9]+)?)</match> |
| 67 |
</context> |
| 68 |
|
| 69 |
<!-- Builtin Nasal keyword-operators --> |
| 70 |
<context id="keyword" style-ref="keyword"> |
| 71 |
<keyword>and</keyword> |
| 72 |
<keyword>or</keyword> |
| 73 |
<keyword>var</keyword> |
| 74 |
<keyword>return</keyword> |
| 75 |
<keyword>break(\s+[_a-zA-Z]\w*)?</keyword> |
| 76 |
<keyword>continue(\s+[_a-zA-Z]\w*)?</keyword> |
| 77 |
</context> |
| 78 |
|
| 79 |
<!-- Builtin Nasal blockoids --> |
| 80 |
<context id="blockoid" style-ref="blockoid"> |
| 81 |
<keyword>while</keyword> |
| 82 |
<keyword>for</keyword> |
| 83 |
<keyword>foreach</keyword> |
| 84 |
<keyword>forindex</keyword> |
| 85 |
<keyword>if</keyword> |
| 86 |
<keyword>elsif</keyword> |
| 87 |
<keyword>else</keyword> |
| 88 |
<keyword>func</keyword> |
| 89 |
</context> |
| 90 |
|
| 91 |
<context id="builtin-constants" style-ref="builtin-constant"> |
| 92 |
<prefix>(?<![\w\.])</prefix> <!-- look behind for anything but a word or period as a prefix, e.g. a space or tab --> |
| 93 |
<keyword>nil</keyword> |
| 94 |
<keyword>math\.e</keyword> |
| 95 |
<keyword>math\.pi</keyword> |
| 96 |
<!-- Flightgear global constants from globals.nas --> |
| 97 |
<keyword>D2R</keyword> |
| 98 |
<keyword>R2D</keyword> |
| 99 |
<keyword>FT2M</keyword> |
| 100 |
<keyword>M2FT</keyword> |
| 101 |
<keyword>IN2M</keyword> |
| 102 |
<keyword>M2IN</keyword> |
| 103 |
<keyword>NM2M</keyword> |
| 104 |
<keyword>M2NM</keyword> |
| 105 |
<keyword>KT2MPS</keyword> |
| 106 |
<keyword>MPS2KT</keyword> |
| 107 |
<keyword>LB2KG</keyword> |
| 108 |
<keyword>KG2LB</keyword> |
| 109 |
<keyword>GAL2L</keyword> |
| 110 |
<keyword>L2GAL</keyword> |
| 111 |
<!-- Non-official --> |
| 112 |
<keyword>FG_ROOT</keyword> |
| 113 |
<keyword>FG_HOME</keyword> |
| 114 |
<keyword>MODEL_PATH</keyword> |
| 115 |
</context> |
| 116 |
|
| 117 |
<!-- Other operators --> |
| 118 |
<context id="operators" style-ref="operator" extend-parent="false"> |
| 119 |
<match>[-~+*/!=?<>]</match> |
| 120 |
</context> |
| 121 |
|
| 122 |
|
| 123 |
<!-- Strings: --> |
| 124 |
|
| 125 |
<context id="format" style-ref="format" extend-parent="false"> |
| 126 |
<match extended="true"> |
| 127 |
% # leading % sign |
| 128 |
[#0\-\ \+]* # conversion flags |
| 129 |
(\-?\%{number})? # minimum field width |
| 130 |
(\.(\-?\%{number}))? # precision |
| 131 |
[%sdicouxXeEfFgG] # conversion type |
| 132 |
</match> |
| 133 |
</context> |
| 134 |
<context id="escaped-char" style-ref="escaped-char" extend-parent="true"> |
| 135 |
<match extended="true"> |
| 136 |
\\( # leading backslash |
| 137 |
[\\"abfnrtv] | # single escaped char |
| 138 |
N\{[A-Z\ ]+\} | # named unicode character |
| 139 |
u[0-9A-Fa-f]{4} | # xxxx - character with 16-bit hex value xxxx |
| 140 |
U[0-9A-Fa-f]{8} | # xxxxxxxx - character with 32-bit hex value xxxxxxxx |
| 141 |
x[0-9A-Fa-f]{1,2} | # \xhh - character with hex value hh |
| 142 |
[0-7]{1,3} # \ooo - character with octal value ooo |
| 143 |
) |
| 144 |
</match> |
| 145 |
</context> |
| 146 |
<context id="double-escaped-char" style-ref="escaped-char" extend-parent="true"> |
| 147 |
<match extended="true"> |
| 148 |
\\\\( # double leading backslash |
| 149 |
\\" | # escaped quote (needs an extra backslash) |
| 150 |
[\\abfnrtv] | # single escaped char |
| 151 |
N\{[A-Z\ ]+\} | # named unicode character |
| 152 |
u[0-9A-Fa-f]{4} | # xxxx - character with 16-bit hex value xxxx |
| 153 |
U[0-9A-Fa-f]{8} | # xxxxxxxx - character with 32-bit hex value xxxxxxxx |
| 154 |
x[0-9A-Fa-f]{1,2} | # \xhh - character with hex value hh |
| 155 |
[0-7]{1,3} # \ooo - character with octal value ooo |
| 156 |
) |
| 157 |
</match> |
| 158 |
</context> |
| 159 |
|
| 160 |
<context id="object-types" style-ref="builtin-object"> |
| 161 |
<prefix>(?<=['"])</prefix> <!-- look behind for ' or " as a prefix --> |
| 162 |
<suffix>(?=['"])</suffix> <!-- look ahead for ' or " as a suffix --> |
| 163 |
<keyword>func</keyword> |
| 164 |
<keyword>code</keyword><!-- not official --> |
| 165 |
<keyword>hash</keyword> |
| 166 |
<keyword>scalar</keyword> |
| 167 |
<keyword>vector</keyword> |
| 168 |
<keyword>nil</keyword> |
| 169 |
<keyword>ghost</keyword> |
| 170 |
<!-- GitHub/AndyRoss/Nasal or Gitorious/nasal-standalone --> |
| 171 |
<keyword>iofile</keyword> |
| 172 |
<keyword>cairo</keyword> |
| 173 |
<keyword>cairo_surface</keyword> |
| 174 |
<keyword>GObject</keyword> |
| 175 |
<keyword>regex</keyword> |
| 176 |
<keyword>sqlite_db</keyword> |
| 177 |
<keyword>sqlite_statement</keyword> |
| 178 |
<keyword>dir</keyword> |
| 179 |
<!-- SimGear --> |
| 180 |
<keyword>prop</keyword> |
| 181 |
<!-- FlightGear --> |
| 182 |
<keyword>positioned</keyword> |
| 183 |
<keyword>airport</keyword> |
| 184 |
<keyword>aircraft</keyword> |
| 185 |
<keyword>helipad</keyword> |
| 186 |
</context> |
| 187 |
|
| 188 |
<define-regex id="property-path" extended="true"> |
| 189 |
( # optional first (root) node |
| 190 |
[a-zA-Z] # first character has to be an alpha |
| 191 |
[-a-zA-Z0-9_]* # now it can be alpha, hyphen, or number, repeat this |
| 192 |
(?:\[ # optional index specifier like this: [90] |
| 193 |
(?:[0-9]+) |
| 194 |
\])? |
| 195 |
)? |
| 196 |
/ # require a slash |
| 197 |
( # middle node(s) |
| 198 |
[a-zA-Z] # first character has to be an alpha |
| 199 |
[-a-zA-Z0-9_]* # now it can be alpha, hyphen, or number, repeat this |
| 200 |
(?:\[ # optional index specifier like this: [90] |
| 201 |
(?:[0-9]+) |
| 202 |
\])? |
| 203 |
/ # slash to separate nodes |
| 204 |
)* # repeat or none |
| 205 |
( # last element, doesn't require a slash at the end |
| 206 |
[a-zA-Z] # first character has to be an alpha |
| 207 |
[-a-zA-Z0-9_]* # now it can be alpha, hyphen, or number, repeat this |
| 208 |
(?:\[ # optional index specifier like this: [90] |
| 209 |
(?:[0-9]+) |
| 210 |
\])? |
| 211 |
/? |
| 212 |
) |
| 213 |
</define-regex> |
| 214 |
<define-regex id="system-path" extended="true"> |
| 215 |
[-a-zA-Z0-9_]* # valid characters, repeat this |
| 216 |
/ # require a slash |
| 217 |
[-a-zA-Z0-9/_]+ # more valid characters, repeat this once or more |
| 218 |
(.[a-zA-Z0-9]+)? # optional extension |
| 219 |
</define-regex> |
| 220 |
|
| 221 |
<context id="string-path" style-ref="path" once-only="true"> |
| 222 |
<match extended="true"> |
| 223 |
(?<=") |
| 224 |
(?: |
| 225 |
(\]/)?\%{property-path}\[? # a recognizeable property path |
| 226 |
|((?:\]/)? # or a "simple" path that isn't covered by above |
| 227 |
[a-zA-Z] # first character has to be an alpha |
| 228 |
[-a-zA-Z0-9_]* # now it can be alpha, hyphen, or number, repeat this |
| 229 |
(\[ # optional index specifier like this: [90] |
| 230 |
(?:[0-9]+\]/?)? # this is the rest after the opening; optional, "node/foo[" is valid |
| 231 |
|/ # or a slash if no opening: sim/ |
| 232 |
) |
| 233 |
) |
| 234 |
|\[|\]/? # or a single bracket (closing can have slash): "]", "[", or "]/" |
| 235 |
|(?<=prop\(") [-a-zA-Z0-9_]+(?:\[([0-9]+)\])?\[? # or a word like in setprop("foo-bar"); |
| 236 |
|(?<=\.getNode\(") [-a-zA-Z0-9_]+(?:\[([0-9]+)\])?\[? # or a word like in props.globals.getNode("foo-bar["~index~"]"); |
| 237 |
|(?<=\.alias\(") [-a-zA-Z0-9_]+(?:\[([0-9]+)\])?\[? # etc. |
| 238 |
|(?<=\.initNode\(") [-a-zA-Z0-9_]+(?:\[([0-9]+)\])?\[? |
| 239 |
|(?<=\.getValue\(") [-a-zA-Z0-9_]+(?:\[([0-9]+)\])?\[? |
| 240 |
|(?<=\.getBoolValue\(") [-a-zA-Z0-9_]+(?:\[([0-9]+)\])?\[? |
| 241 |
|(?<=\.setValue\(") [-a-zA-Z0-9_]+(?:\[([0-9]+)\])?\[? |
| 242 |
|(?<=\.setBoolValue\(") [-a-zA-Z0-9_]+(?:\[([0-9]+)\])?\[? |
| 243 |
|(?<=\.setIntValue\(") [-a-zA-Z0-9_]+(?:\[([0-9]+)\])?\[? |
| 244 |
|(?<=\.setDoubleValue\(")[-a-zA-Z0-9_]+(?:\[([0-9]+)\])?\[? |
| 245 |
|(?<=\.getChild\(") [-a-zA-Z0-9_]+ # while these are simple names |
| 246 |
|(?<=\.getChildren\(") [-a-zA-Z0-9_]+ |
| 247 |
|(?<=\.removeChild\(") [-a-zA-Z0-9_]+ |
| 248 |
|(?<=\.removeChildren\(")[-a-zA-Z0-9_]+ |
| 249 |
) |
| 250 |
(?=") |
| 251 |
</match> |
| 252 |
</context> |
| 253 |
|
| 254 |
<context id="double-quoted-string" style-ref="string" class="string" class-disabled="no-spell-check"> |
| 255 |
<start>"</start> |
| 256 |
<end>"</end> |
| 257 |
<include> |
| 258 |
<context ref="format"/> |
| 259 |
<context ref="escaped-char"/> |
| 260 |
<context ref="string-path"/> |
| 261 |
</include> |
| 262 |
</context> |
| 263 |
|
| 264 |
<context id="single-quoted-string" style-ref="string" class="string" class-disabled="no-spell-check"> |
| 265 |
<start>'</start> |
| 266 |
<end>'</end> |
| 267 |
<include> |
| 268 |
<context ref="format"/> |
| 269 |
<context id="escaped-single-quote" style-ref="escaped-char" extend-parent="true"> |
| 270 |
<match>\\'</match> |
| 271 |
</context> |
| 272 |
<context ref="object-types"/> |
| 273 |
</include> |
| 274 |
</context> |
| 275 |
|
| 276 |
<context id="escaped-double-quoted-string" style-ref="string" class="string" class-disabled="no-spell-check"> |
| 277 |
<start>\\"</start> |
| 278 |
<end>\\"</end> |
| 279 |
<include> |
| 280 |
<context ref="format"/> |
| 281 |
<context ref="double-escaped-char"/> |
| 282 |
<context ref="string-path"/> |
| 283 |
</include> |
| 284 |
</context> |
| 285 |
|
| 286 |
<context id="escaped-single-quoted-string" style-ref="string" class="string" class-disabled="no-spell-check"> |
| 287 |
<start>\\'</start> |
| 288 |
<end>\\'</end> |
| 289 |
<include> |
| 290 |
<context ref="format"/> |
| 291 |
<context id="double-escaped-single-quote" style-ref="escaped-char" extend-parent="true"> |
| 292 |
<match>\\\\'</match> |
| 293 |
</context> |
| 294 |
<context ref="object-types"/> |
| 295 |
</include> |
| 296 |
</context> |
| 297 |
|
| 298 |
<context id="string-conversion" style-ref="string-conversion"> |
| 299 |
<match extended="true"> |
| 300 |
` |
| 301 |
( |
| 302 |
[^`\\] # any single character except for backqote or backslash |
| 303 |
| # or: |
| 304 |
\\( # leading backslash |
| 305 |
[\\`abfnrtv] | # single escaped char |
| 306 |
N\{[A-Z\ ]+\} | # named unicode character |
| 307 |
u[0-9A-Fa-f]{4} | # xxxx - character with 16-bit hex value xxxx |
| 308 |
U[0-9A-Fa-f]{8} | # xxxxxxxx - character with 32-bit hex value xxxxxxxx |
| 309 |
x[0-9A-Fa-f]{1,2} | # \xhh - character with hex value hh |
| 310 |
[0-7]{1,3} # \ooo - character with octal value ooo |
| 311 |
) |
| 312 |
) |
| 313 |
` |
| 314 |
</match> |
| 315 |
</context> |
| 316 |
|
| 317 |
<!-- Variables (special, chosen between FlightGear/Nasal-Standalone) --> |
| 318 |
|
| 319 |
<context id="special-variables" style-ref="special-variable"> |
| 320 |
<prefix>(?<![\w\.])</prefix> |
| 321 |
<keyword>_?cmdarg</keyword> |
| 322 |
<keyword>arg</keyword> |
| 323 |
<keyword>me</keyword> |
| 324 |
<keyword>parents</keyword> |
| 325 |
<keyword>globals</keyword> |
| 326 |
</context> |
| 327 |
<context id="module-handler" style-ref="module-handler"> |
| 328 |
<prefix>(?<![\w\.])</prefix> |
| 329 |
<!-- Nasal-standalone/lib/driver.nas --> |
| 330 |
<keyword>import</keyword> |
| 331 |
<!-- $FG_ROOT/nasal_boostrap.nas --> |
| 332 |
<keyword>require</keyword> |
| 333 |
</context> |
| 334 |
|
| 335 |
<context id="builtin-function" style-ref="builtin-function"> |
| 336 |
<prefix>((?<![\w\.])|(?<=globals\.))</prefix> <!-- look behind for anything but a word or period as a prefix, e.g. a space or tab, or lookbehind for globals. (since it will result in the same path) --> |
| 337 |
|
| 338 |
<!-- Builtin to Nasal --> |
| 339 |
<keyword>append</keyword> |
| 340 |
<keyword>setsize</keyword> |
| 341 |
<keyword>subvec</keyword> |
| 342 |
<keyword>contains</keyword> |
| 343 |
<keyword>delete</keyword> |
| 344 |
<keyword>num</keyword> |
| 345 |
<keyword>keys</keyword> |
| 346 |
<keyword>pop</keyword> |
| 347 |
<keyword>size</keyword> |
| 348 |
<keyword>streq</keyword> |
| 349 |
<keyword>cmp</keyword> |
| 350 |
<keyword>abs</keyword> |
| 351 |
<keyword>chr</keyword> |
| 352 |
<keyword>sort</keyword> |
| 353 |
<keyword>substr</keyword> |
| 354 |
<keyword>sprintf</keyword> |
| 355 |
<keyword>find</keyword> |
| 356 |
<keyword>split</keyword> |
| 357 |
<keyword>rand</keyword> |
| 358 |
<keyword>typeof</keyword> |
| 359 |
<keyword>die</keyword> |
| 360 |
<keyword>call</keyword> |
| 361 |
<keyword>compile</keyword> |
| 362 |
<keyword>closure</keyword> |
| 363 |
<keyword>caller</keyword> |
| 364 |
<keyword>bind</keyword> |
| 365 |
<keyword>print</keyword> |
| 366 |
<keyword>bits\.fld</keyword> |
| 367 |
<keyword>bits\.sfld</keyword> |
| 368 |
<keyword>bits\.setfld</keyword> |
| 369 |
<keyword>bits\.buf</keyword> |
| 370 |
<keyword>math\.sin</keyword> |
| 371 |
<keyword>math\.cos</keyword> |
| 372 |
<keyword>math\.exp</keyword> |
| 373 |
<keyword>math\.ln</keyword> |
| 374 |
<keyword>math\.sqrt</keyword> |
| 375 |
<keyword>math\.atan2</keyword> |
| 376 |
<keyword>io\.open</keyword> |
| 377 |
<keyword>io\.close</keyword> |
| 378 |
<keyword>io\.read</keyword> |
| 379 |
<keyword>io\.write</keyword> |
| 380 |
<keyword>io\.seek</keyword> |
| 381 |
<keyword>io\.tell</keyword> |
| 382 |
<keyword>io\.readln</keyword> |
| 383 |
<keyword>io\.stat</keyword> |
| 384 |
<keyword>utf8\.chstr</keyword> |
| 385 |
<keyword>utf8\.strc</keyword> |
| 386 |
<keyword>utf8\.substr</keyword> |
| 387 |
<keyword>utf8\.size</keyword> |
| 388 |
<keyword>utf8\.validate</keyword> |
| 389 |
<keyword>thread\.newthread</keyword> |
| 390 |
<keyword>thread\.newlock</keyword> |
| 391 |
<keyword>thread\.lock</keyword> |
| 392 |
<keyword>thread\.unlock</keyword> |
| 393 |
<keyword>thread\.newsem</keyword> |
| 394 |
<keyword>thread\.semdown</keyword> |
| 395 |
<keyword>thread\.semup</keyword> |
| 396 |
<keyword>unix\.pipe</keyword> |
| 397 |
<keyword>unix\.fork</keyword> |
| 398 |
<keyword>unix\.dup2</keyword> |
| 399 |
<keyword>unix\.exec</keyword> |
| 400 |
<keyword>unix\.waitpid</keyword> |
| 401 |
<keyword>unix\.opendir</keyword> |
| 402 |
<keyword>unix\.readdir</keyword> |
| 403 |
<keyword>unix\.closedir</keyword> |
| 404 |
<keyword>unix\.time</keyword> |
| 405 |
<keyword>unix\.chdir</keyword> |
| 406 |
<keyword>unix\.environ</keyword> |
| 407 |
<keyword>regex\.comp</keyword> |
| 408 |
<keyword>regex\.exec</keyword> |
| 409 |
<keyword>sqlite\.open</keyword> |
| 410 |
<keyword>sqlite\.close</keyword> |
| 411 |
<keyword>sqlite\.prepare</keyword> |
| 412 |
<keyword>sqlite\.finalize</keyword> |
| 413 |
<keyword>readline</keyword> |
| 414 |
|
| 415 |
<!-- Flightgear-specific --> |
| 416 |
<!-- $FG_SRC/NasalSys.cxx --> |
| 417 |
<keyword>getprop</keyword> |
| 418 |
<keyword>setprop</keyword> |
| 419 |
<keyword>print</keyword> |
| 420 |
<keyword>logprint</keyword> |
| 421 |
<keyword>_fgcommand</keyword> |
| 422 |
<keyword>settimer</keyword> |
| 423 |
<keyword>maketimer</keyword> |
| 424 |
<keyword>_setlistener</keyword> |
| 425 |
<keyword>removelistener</keyword> |
| 426 |
<keyword>addcommand</keyword> |
| 427 |
<keyword>removecommand</keyword> |
| 428 |
<keyword>_interpolate</keyword> |
| 429 |
<keyword>rand</keyword> |
| 430 |
<keyword>srand</keyword> |
| 431 |
<keyword>abort</keyword> |
| 432 |
<keyword>directory</keyword> |
| 433 |
<keyword>resolvepath</keyword> |
| 434 |
<keyword>parsexml</keyword> |
| 435 |
<keyword>systime</keyword> |
| 436 |
<!-- globals.nas --> |
| 437 |
<keyword>setlistener</keyword> |
| 438 |
<keyword>fgcommand</keyword> |
| 439 |
<keyword>interpolate</keyword> |
| 440 |
<keyword>isa</keyword> |
| 441 |
<keyword>abs</keyword> |
| 442 |
<keyword>defined</keyword> |
| 443 |
<keyword>thisfunc</keyword> |
| 444 |
<keyword>printf</keyword> |
| 445 |
<keyword>sprintf</keyword> |
| 446 |
<keyword>values</keyword> |
| 447 |
<keyword>printlog</keyword> |
| 448 |
<!-- io.nas --> |
| 449 |
<keyword>io\.readfile</keyword> |
| 450 |
<keyword>io\.load_nasal</keyword> |
| 451 |
<keyword>io\.read_properties</keyword> |
| 452 |
<keyword>io\.read_airport_properties</keyword> |
| 453 |
<keyword>io\.write_properties</keyword> |
| 454 |
<keyword>io\.readxml</keyword> |
| 455 |
<keyword>io\.writexml</keyword> |
| 456 |
<!-- string.nas --> |
| 457 |
<keyword>string\.match</keyword> |
| 458 |
<keyword>string\.normpath</keyword> |
| 459 |
<keyword>string\.join</keyword> |
| 460 |
<keyword>string\.replace</keyword> |
| 461 |
<keyword>string\.iscntrl</keyword> |
| 462 |
<keyword>string\.isascii</keyword> |
| 463 |
<keyword>string\.isupper</keyword> |
| 464 |
<keyword>string\.islower</keyword> |
| 465 |
<keyword>string\.isdigit</keyword> |
| 466 |
<keyword>string\.isblank</keyword> |
| 467 |
<keyword>string\.ispunct</keyword> |
| 468 |
<keyword>string\.isxdigit</keyword> |
| 469 |
<keyword>string\.isspace</keyword> |
| 470 |
<keyword>string\.isalpha</keyword> |
| 471 |
<keyword>string\.isalnum</keyword> |
| 472 |
<keyword>string\.isgraph</keyword> |
| 473 |
<keyword>string\.isprint</keyword> |
| 474 |
<keyword>string\.toupper</keyword> |
| 475 |
<keyword>string\.tolower</keyword> |
| 476 |
<keyword>string\.isxspace</keyword> |
| 477 |
<keyword>string\.trim</keyword> |
| 478 |
<keyword>string\.uc</keyword> |
| 479 |
<keyword>string\.lc</keyword> |
| 480 |
<keyword>string\.icmp</keyword> |
| 481 |
<keyword>string\.imatch</keyword> |
| 482 |
<keyword>string\.scanf</keyword> |
| 483 |
<keyword>string\.setcolors</keyword> |
| 484 |
<keyword>string\.color</keyword> |
| 485 |
<!-- gui.nas --> |
| 486 |
<keyword>gui\.Dialog\.new</keyword> |
| 487 |
<keyword>gui\.OverlaySelector\.new</keyword> |
| 488 |
<keyword>gui\.FileSelector\.new</keyword> |
| 489 |
<keyword>gui\.DirSelector\.new</keyword> |
| 490 |
<keyword>gui\.findElementByName</keyword> |
| 491 |
<keyword>gui\.popupTip</keyword> |
| 492 |
<keyword>gui\.showDialog</keyword> |
| 493 |
<keyword>gui\.showHelpDialog</keyword> |
| 494 |
<keyword>gui\.menuEnable</keyword> |
| 495 |
<keyword>gui\.menuBind</keyword> |
| 496 |
<keyword>gui\.setCursor</keyword> |
| 497 |
<keyword>gui\.save_flight</keyword> |
| 498 |
<keyword>gui\.load_flight</keyword> |
| 499 |
<keyword>gui\.set_screenshotdir</keyword> |
| 500 |
<keyword>gui\.property_browser</keyword> |
| 501 |
<keyword>gui\.dialog_apply</keyword> |
| 502 |
<keyword>gui\.dialog_update</keyword> |
| 503 |
<keyword>gui\.enable_widgets</keyword> |
| 504 |
<!-- props.nas --> |
| 505 |
<keyword>props\.Node\.new</keyword> |
| 506 |
<keyword>props\.Node</keyword> |
| 507 |
<keyword>props\.globals</keyword> |
| 508 |
<keyword>props\.setAll</keyword> |
| 509 |
<keyword>props\.wrap</keyword> |
| 510 |
<keyword>props\.wrapNode</keyword> |
| 511 |
<keyword>props\.copy</keyword> |
| 512 |
<keyword>props\.dump</keyword> |
| 513 |
<keyword>props\.nodeList</keyword> |
| 514 |
<keyword>props\.condition</keyword> |
| 515 |
<keyword>props\.runBinding</keyword> |
| 516 |
<!-- nasal-props.cxx --> |
| 517 |
<keyword>props\._new</keyword> |
| 518 |
<keyword>props\._globals</keyword> |
| 519 |
<keyword>props\._getNode</keyword> |
| 520 |
<keyword>props\._getParent</keyword> |
| 521 |
<keyword>props\._getChild</keyword> |
| 522 |
<keyword>props\._getChildren</keyword> |
| 523 |
<keyword>props\._removeChild</keyword> |
| 524 |
<keyword>props\._removeChildren</keyword> |
| 525 |
<keyword>props\._getAliasTarget</keyword> |
| 526 |
<keyword>props\._getName</keyword> |
| 527 |
<keyword>props\._getIndex</keyword> |
| 528 |
<keyword>props\._getType</keyword> |
| 529 |
<keyword>props\._getAttribute</keyword> |
| 530 |
<keyword>props\._setAttribute</keyword> |
| 531 |
<keyword>props\._getValue</keyword> |
| 532 |
<keyword>props\._setValue</keyword> |
| 533 |
<keyword>props\._setIntValue</keyword> |
| 534 |
<keyword>props\._setBoolValue</keyword> |
| 535 |
<keyword>props\._setDoubleValue</keyword> |
| 536 |
<keyword>props\._unalias</keyword> |
| 537 |
<keyword>props\._alias</keyword> |
| 538 |
<!-- debug.nas --> |
| 539 |
<keyword>debug\.dump</keyword> |
| 540 |
<keyword>debug\.local</keyword> |
| 541 |
<keyword>debug\.backtrace</keyword> |
| 542 |
<keyword>debug\.bt</keyword> |
| 543 |
<keyword>debug\.proptrace</keyword> |
| 544 |
<keyword>debug\.tree</keyword> |
| 545 |
<keyword>debug\.string</keyword> |
| 546 |
<keyword>debug\.attributes</keyword> |
| 547 |
<keyword>debug\.isnan</keyword> |
| 548 |
<keyword>debug\.benchmark</keyword> |
| 549 |
<keyword>debug\.printerror</keyword> |
| 550 |
<keyword>debug\.warn</keyword> |
| 551 |
<keyword>debug\.propify</keyword> |
| 552 |
<!-- math.nas --> |
| 553 |
<keyword>math\.abs</keyword> |
| 554 |
<keyword>math\.sgn</keyword> |
| 555 |
<keyword>math\.max</keyword> |
| 556 |
<keyword>math\.min</keyword> |
| 557 |
<keyword>math\.avg</keyword> |
| 558 |
<keyword>math\.pow</keyword> |
| 559 |
<keyword>math\.mod</keyword> |
| 560 |
<keyword>math\.asin</keyword> |
| 561 |
<keyword>math\.acos</keyword> |
| 562 |
<keyword>math\.tan</keyword> |
| 563 |
<keyword>math\.log10</keyword> |
| 564 |
<keyword>math\.to_base</keyword> |
| 565 |
<keyword>math\.print_base</keyword> |
| 566 |
<!-- view.nas --> |
| 567 |
<keyword>view\.panViewDir</keyword> |
| 568 |
<keyword>view\.panViewPitch</keyword> |
| 569 |
<keyword>view\.resetView</keyword> |
| 570 |
<keyword>view\.manager\.register</keyword> |
| 571 |
<!-- screen.nas --> |
| 572 |
<keyword>screen\.log\.write</keyword> |
| 573 |
<!-- controls.nas --> |
| 574 |
<keyword>controls\.startEngine</keyword> |
| 575 |
<keyword>controls\.selectEngine</keyword> |
| 576 |
<keyword>controls\.stepMagnetos</keyword> |
| 577 |
<keyword>controls\.centerFlightControls</keyword> |
| 578 |
<keyword>controls\.throttleAxis</keyword> |
| 579 |
<keyword>controls\.propellerAxis</keyword> |
| 580 |
<keyword>controls\.mixtureAxis</keyword> |
| 581 |
<keyword>controls\.carbHeatAxis</keyword> |
| 582 |
<keyword>controls\.flapsDown</keyword> |
| 583 |
<keyword>controls\.wingSweep</keyword> |
| 584 |
<keyword>controls\.wingsDown</keyword> |
| 585 |
<keyword>controls\.stepSpoilers</keyword> |
| 586 |
<keyword>controls\.stepSlats</keyword> |
| 587 |
<keyword>controls\.elevatorTrim</keyword> |
| 588 |
<keyword>controls\.aileronTrim</keyword> |
| 589 |
<keyword>controls\.rudderTrim</keyword> |
| 590 |
<keyword>controls\.adjThrottle</keyword> |
| 591 |
<keyword>controls\.adjMixture</keyword> |
| 592 |
<keyword>controls\.adjCondition</keyword> |
| 593 |
<keyword>controls\.adjPropeller</keyword> |
| 594 |
<keyword>controls\.incThrottle</keyword> |
| 595 |
<keyword>controls\.incAileron</keyword> |
| 596 |
<keyword>controls\.incElevator</keyword> |
| 597 |
<keyword>controls\.elevatorTrimAxis</keyword> |
| 598 |
<keyword>controls\.aileronTrimAxis</keyword> |
| 599 |
<keyword>controls\.rudderTrimAxis</keyword> |
| 600 |
<keyword>controls\.gearDown</keyword> |
| 601 |
<keyword>controls\.gearToggle</keyword> |
| 602 |
<keyword>controls\.applyBrakes</keyword> |
| 603 |
<keyword>controls\.applyParkingBrake</keyword> |
| 604 |
<keyword>controls\.deployChute</keyword> |
| 605 |
<keyword>controls\.trigger</keyword> |
| 606 |
<keyword>controls\.ptt</keyword> |
| 607 |
<keyword>controls\.toggleLights</keyword> |
| 608 |
<!-- aircraft.nas --> |
| 609 |
<keyword>aircraft\.door\.new</keyword> |
| 610 |
<keyword>aircraft\.light\.new</keyword> |
| 611 |
<keyword>aircraft\.lowpass\.new</keyword> |
| 612 |
<keyword>aircraft\.angular_lowpass\.new</keyword> |
| 613 |
<keyword>aircraft\.data\.init</keyword> |
| 614 |
<keyword>aircraft\.data\.load</keyword> |
| 615 |
<keyword>aircraft\.data\.save</keyword> |
| 616 |
<keyword>aircraft\.data\.add</keyword> |
| 617 |
<keyword>aircraft\.timer\.new</keyword> |
| 618 |
<keyword>aircraft\.livery\.new</keyword> |
| 619 |
<keyword>aircraft\.livery_update\.new</keyword> |
| 620 |
<keyword>aircraft\.overlay_update\.new</keyword> |
| 621 |
<keyword>aircraft\.steering\.init</keyword> |
| 622 |
<keyword>aircraft\.steering\.setbrakes</keyword> |
| 623 |
<keyword>aircraft\.autotrim\.init</keyword> |
| 624 |
<keyword>aircraft\.autotrim\.start</keyword> |
| 625 |
<keyword>aircraft\.autotrim\.stop</keyword> |
| 626 |
<keyword>aircraft\.tyresmoke\.new</keyword> |
| 627 |
<keyword>aircraft\.tyresmoke_system\.new</keyword> |
| 628 |
<keyword>aircraft\.rain\.init</keyword> |
| 629 |
<keyword>aircraft\.rain\.update</keyword> |
| 630 |
<keyword>aircraft\.teleport</keyword> |
| 631 |
<keyword>aircraft\.wind_speed_from</keyword> |
| 632 |
<keyword>aircraft\.kias_to_ktas</keyword> |
| 633 |
<keyword>aircraft\.HUD\.init</keyword> |
| 634 |
<keyword>aircraft\.HUD\.cycle_color</keyword> |
| 635 |
<keyword>aircraft\.HUD\.cycle_brightness</keyword> |
| 636 |
<keyword>aircraft\.HUD\.normal_type</keyword> |
| 637 |
<keyword>aircraft\.HUD\.cycle_type</keyword> |
| 638 |
<keyword>aircraft\.HUD\.is_active</keyword> |
| 639 |
<keyword>aircraft\.crossfeed_valve\.new</keyword> |
| 640 |
<!-- screen.nas --> |
| 641 |
<keyword>screen\.window\.new</keyword> |
| 642 |
<keyword>screen\.display\.new</keyword> |
| 643 |
<keyword>screen\.msg_repeat</keyword> |
| 644 |
<!-- geo.nas --> |
| 645 |
<keyword>geo\.Coord\.new</keyword> |
| 646 |
<keyword>geo\.normdeg</keyword> |
| 647 |
<keyword>geo\.tile_index</keyword> |
| 648 |
<keyword>geo\.format</keyword> |
| 649 |
<keyword>geo\.tile_path</keyword> |
| 650 |
<keyword>geo\.put_model</keyword> |
| 651 |
<keyword>geo\.click_position</keyword> |
| 652 |
<keyword>geo\.aircraft_position</keyword> |
| 653 |
<keyword>geo\.viewer_position</keyword> |
| 654 |
|
| 655 |
<!-- Mine (ignore) --> |
| 656 |
<keyword>setlocalprop</keyword> |
| 657 |
<keyword>getlocalprop</keyword> |
| 658 |
</context> |
| 659 |
|
| 660 |
<!-- Flightgear props.Node methods --> |
| 661 |
<context id="node-object" style-ref="builtin-function"> |
| 662 |
<prefix>(?<=\.)</prefix> <!-- look behind for . as a prefix--> |
| 663 |
<keyword>initNode</keyword> |
| 664 |
<keyword>getNode</keyword> |
| 665 |
<keyword>getType</keyword> |
| 666 |
<keyword>getName</keyword> |
| 667 |
<keyword>getPath</keyword> |
| 668 |
<keyword>getIndex</keyword> |
| 669 |
<keyword>getValue</keyword> |
| 670 |
<keyword>getBoolValue</keyword> |
| 671 |
<keyword>getValues</keyword> |
| 672 |
<keyword>getParent</keyword> |
| 673 |
<keyword>getChildren</keyword> |
| 674 |
<keyword>getChild</keyword> |
| 675 |
<keyword>getAttribute</keyword> |
| 676 |
<keyword>setIntValue</keyword> |
| 677 |
<keyword>setBoolValue</keyword> |
| 678 |
<keyword>setDoubleValue</keyword> |
| 679 |
<keyword>setValues</keyword> |
| 680 |
<keyword>setValue</keyword> |
| 681 |
<keyword>setAttribute</keyword> |
| 682 |
<keyword>addChildren</keyword> |
| 683 |
<keyword>addChild</keyword> |
| 684 |
<keyword>removeAllChildren</keyword> |
| 685 |
<keyword>removeChildren</keyword> |
| 686 |
<keyword>removeChild</keyword> |
| 687 |
<keyword>remove</keyword> |
| 688 |
<keyword>clearValue</keyword> |
| 689 |
<keyword>unalias</keyword> |
| 690 |
<keyword>alias</keyword> |
| 691 |
</context> |
| 692 |
|
| 693 |
<context id="nasal" class="no-spell-check"> |
| 694 |
<include> |
| 695 |
<context ref="def:shebang"/> |
| 696 |
<context ref="def:shell-like-comment"/> |
| 697 |
<context ref="nasal-code-string-double"/> |
| 698 |
<context ref="nasal-code-string-single"/> |
| 699 |
<context ref="double-quoted-string"/> |
| 700 |
<context ref="single-quoted-string"/> |
| 701 |
<context ref="string-conversion"/> |
| 702 |
<context ref="number"/> |
| 703 |
<context ref="operators"/> |
| 704 |
<context ref="keyword"/> |
| 705 |
<context ref="blockoid"/> |
| 706 |
<context ref="builtin-constants"/> |
| 707 |
<context ref="builtin-function"/> |
| 708 |
<context ref="node-object"/> |
| 709 |
<context ref="special-variables"/> |
| 710 |
<context ref="module-handler"/> |
| 711 |
<context ref="escaped-char"/> |
| 712 |
</include> |
| 713 |
</context> |
| 714 |
<context id="nasal-noextend" class="no-spell-check" extend-parent="false"> |
| 715 |
<start>.</start> |
| 716 |
<end>.</end> |
| 717 |
<include> |
| 718 |
<context ref="def:shebang"/> |
| 719 |
<context ref="def:shell-like-comment"/> |
| 720 |
<context ref="nasal-code-string-double"/> |
| 721 |
<context ref="nasal-code-string-single"/> |
| 722 |
<context ref="double-quoted-string"/> |
| 723 |
<context ref="single-quoted-string"/> |
| 724 |
<context ref="string-conversion"/> |
| 725 |
<context ref="number"/> |
| 726 |
<context ref="operators"/> |
| 727 |
<context ref="keyword"/> |
| 728 |
<context ref="blockoid"/> |
| 729 |
<context ref="builtin-constants"/> |
| 730 |
<context ref="builtin-function"/> |
| 731 |
<context ref="node-object"/> |
| 732 |
<context ref="special-variables"/> |
| 733 |
<context ref="module-handler"/> |
| 734 |
<context ref="escaped-char"/> |
| 735 |
</include> |
| 736 |
</context> |
| 737 |
|
| 738 |
<context id="nasal-code-string-double"> |
| 739 |
<start>"""</start> |
| 740 |
<end>"""</end> |
| 741 |
<include> |
| 742 |
<!-- Highlight our delimiters --> |
| 743 |
<context sub-pattern="0" where="start" style-ref="string"/> |
| 744 |
<context sub-pattern="0" where="end" style-ref="string"/> |
| 745 |
<context ref="def:shebang"/> |
| 746 |
<context ref="def:shell-like-comment"/> |
| 747 |
<context ref="escaped-double-quoted-string"/> |
| 748 |
<context ref="single-quoted-string"/> |
| 749 |
<context id="double-quote-error" style-ref="def:error"> |
| 750 |
<match>"(?! *~|"")</match> |
| 751 |
</context> |
| 752 |
<context id="non-string-double" extend-parent="false"> |
| 753 |
<start>"</start> |
| 754 |
<end>"</end> |
| 755 |
<include><context ref="nasal-noextend"/></include> |
| 756 |
</context> |
| 757 |
<context ref="string-conversion"/> |
| 758 |
<context ref="number"/> |
| 759 |
<context ref="operators"/> |
| 760 |
<context ref="keyword"/> |
| 761 |
<context ref="blockoid"/> |
| 762 |
<context ref="builtin-constants"/> |
| 763 |
<context ref="builtin-function"/> |
| 764 |
<context ref="node-object"/> |
| 765 |
<context ref="special-variables"/> |
| 766 |
<context ref="module-handler"/> |
| 767 |
</include> |
| 768 |
</context> |
| 769 |
<context id="nasal-code-string-single"> |
| 770 |
<start>'''</start> |
| 771 |
<end>'''</end> |
| 772 |
<include> |
| 773 |
<!-- Highlight our delimiters --> |
| 774 |
<context sub-pattern="0" where="start" style-ref="string"/> |
| 775 |
<context sub-pattern="0" where="end" style-ref="string"/> |
| 776 |
<context ref="def:shebang"/> |
| 777 |
<context ref="def:shell-like-comment"/> |
| 778 |
<context ref="double-quoted-string"/> |
| 779 |
<context ref="escaped-single-quoted-string"/> |
| 780 |
<context id="single-quote-error" style-ref="def:error"> |
| 781 |
<match>'(?! *~|'')</match> |
| 782 |
</context> |
| 783 |
<context id="non-string-single" extend-parent="false"> |
| 784 |
<start>'</start> |
| 785 |
<end>'</end> |
| 786 |
<include><context ref="nasal-noextend"/></include> |
| 787 |
</context> |
| 788 |
<context ref="string-conversion"/> |
| 789 |
<context ref="number"/> |
| 790 |
<context ref="operators"/> |
| 791 |
<context ref="keyword"/> |
| 792 |
<context ref="blockoid"/> |
| 793 |
<context ref="builtin-constants"/> |
| 794 |
<context ref="builtin-function"/> |
| 795 |
<context ref="node-object"/> |
| 796 |
<context ref="special-variables"/> |
| 797 |
<context ref="module-handler"/> |
| 798 |
</include> |
| 799 |
</context> |
| 800 |
|
| 801 |
<context id="xml-extras"> |
| 802 |
<include> |
| 803 |
<context ref="xml:comment"/> |
| 804 |
<context id="cdata"> |
| 805 |
<start><!\[CDATA\[</start> |
| 806 |
<end>\]\]></end> |
| 807 |
<include> |
| 808 |
<!-- Highlight our delimiters --> |
| 809 |
<context sub-pattern="0" where="start" style-ref="xml:cdata-delim" class="no-spell-check"/> |
| 810 |
<context sub-pattern="0" where="end" style-ref="xml:cdata-delim"/> |
| 811 |
<!-- And include regular Nasal (no XML extensions) --> |
| 812 |
<context ref="nasal"/> |
| 813 |
</include> |
| 814 |
</context> |
| 815 |
<context id="character-reference" style-ref="xml:entity"> |
| 816 |
<match>&(#([0-9]+|x[a-fA-F0-9]+)|lt|gt|amp|quot|apos);</match> |
| 817 |
</context> |
| 818 |
<context id="unallowed-chars" style-ref="xml:error" extend-parent="false"> |
| 819 |
<match>[&<>]</match> |
| 820 |
</context> |
| 821 |
</include> |
| 822 |
</context> |
| 823 |
|
| 824 |
<!-- For use when embedded in XML, e.g. in a <script> tag. --> |
| 825 |
<context id="xml"> |
| 826 |
<include> |
| 827 |
<context id="script"> |
| 828 |
<start>(?<=<script>)</start><!-- look behind for <script> as a start --> |
| 829 |
<end>(?=</script>)</end><!-- look ahead for </script> as an end --> |
| 830 |
<include> |
| 831 |
<context ref="xml-extras"/> |
| 832 |
<context ref="nasal"/> |
| 833 |
</include> |
| 834 |
</context> |
| 835 |
<context id="dialog-open"> |
| 836 |
<start>(?<=<open>)</start><!-- look behind for <open> as a start --> |
| 837 |
<end>(?=</open>)</end><!-- look ahead for </open> as an end --> |
| 838 |
<include> |
| 839 |
<context ref="xml-extras"/> |
| 840 |
<context ref="nasal"/> |
| 841 |
</include> |
| 842 |
</context> |
| 843 |
<context id="dialog-close"> |
| 844 |
<start>(?<=<close>)</start><!-- look behind for <close> as a start --> |
| 845 |
<end>(?=</close>)</end><!-- look ahead for </close> as an end --> |
| 846 |
<include> |
| 847 |
<context ref="xml-extras"/> |
| 848 |
<context ref="nasal"/> |
| 849 |
</include> |
| 850 |
</context> |
| 851 |
<context id="model-load"> |
| 852 |
<start>(?<=<load>)</start><!-- look behind for <load> as a start --> |
| 853 |
<end>(?=</load>)</end><!-- look ahead for </load> as an end --> |
| 854 |
<include> |
| 855 |
<context ref="xml-extras"/> |
| 856 |
<context ref="nasal"/> |
| 857 |
</include> |
| 858 |
</context> |
| 859 |
<context id="model-unload"> |
| 860 |
<start>(?<=<unload>)</start><!-- look behind for <unload> as a start --> |
| 861 |
<end>(?=</unload>)</end><!-- look ahead for </unload> as an end --> |
| 862 |
<include> |
| 863 |
<context ref="xml-extras"/> |
| 864 |
<context ref="nasal"/> |
| 865 |
</include> |
| 866 |
</context> |
| 867 |
</include> |
| 868 |
</context> |
| 869 |
</definitions> |
| 870 |
</language> |