@omicronenergy/oscd-ui 0.0.18 → 0.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (724) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/custom-elements.json +12341 -8939
  3. package/dist/ace-editor/OscdAceEditor.d.ts +34 -0
  4. package/dist/ace-editor/OscdAceEditor.js +33 -0
  5. package/dist/ace-editor/OscdAceEditor.js.map +1 -0
  6. package/dist/ace-editor/OscdAceEditor.spec.d.ts +1 -0
  7. package/dist/ace-editor/OscdAceEditor.spec.js +16 -0
  8. package/dist/ace-editor/OscdAceEditor.spec.js.map +1 -0
  9. package/dist/ace-editor/OscdAceEditor.stories.d.ts +28 -0
  10. package/dist/ace-editor/OscdAceEditor.stories.js +22 -0
  11. package/dist/ace-editor/OscdAceEditor.stories.js.map +1 -0
  12. package/dist/ace-editor/ace/ace.js +22045 -0
  13. package/dist/ace-editor/ace/ext-beautify.js +343 -0
  14. package/dist/ace-editor/ace/ext-code_lens.js +204 -0
  15. package/dist/ace-editor/ace/ext-command_bar.js +469 -0
  16. package/dist/ace-editor/ace/ext-diff.js +4270 -0
  17. package/dist/ace-editor/ace/ext-elastic_tabstops_lite.js +238 -0
  18. package/dist/ace-editor/ace/ext-emmet.js +1303 -0
  19. package/dist/ace-editor/ace/ext-error_marker.js +9 -0
  20. package/dist/ace-editor/ace/ext-hardwrap.js +127 -0
  21. package/dist/ace-editor/ace/ext-inline_autocomplete.js +3547 -0
  22. package/dist/ace-editor/ace/ext-keybinding_menu.js +185 -0
  23. package/dist/ace-editor/ace/ext-language_tools.js +2724 -0
  24. package/dist/ace-editor/ace/ext-linking.js +66 -0
  25. package/dist/ace-editor/ace/ext-modelist.js +279 -0
  26. package/dist/ace-editor/ace/ext-options.js +862 -0
  27. package/dist/ace-editor/ace/ext-prompt.js +3164 -0
  28. package/dist/ace-editor/ace/ext-rtl.js +146 -0
  29. package/dist/ace-editor/ace/ext-searchbox.js +385 -0
  30. package/dist/ace-editor/ace/ext-settings_menu.js +862 -0
  31. package/dist/ace-editor/ace/ext-simple_tokenizer.js +137 -0
  32. package/dist/ace-editor/ace/ext-spellcheck.js +79 -0
  33. package/dist/ace-editor/ace/ext-split.js +203 -0
  34. package/dist/ace-editor/ace/ext-static_highlight.js +194 -0
  35. package/dist/ace-editor/ace/ext-statusbar.js +63 -0
  36. package/dist/ace-editor/ace/ext-textarea.js +400 -0
  37. package/dist/ace-editor/ace/ext-themelist.js +80 -0
  38. package/dist/ace-editor/ace/ext-whitespace.js +201 -0
  39. package/dist/ace-editor/ace/ext-whitespaces_in_selection.js +325 -0
  40. package/dist/ace-editor/ace/keybinding-emacs.js +1067 -0
  41. package/dist/ace-editor/ace/keybinding-sublime.js +409 -0
  42. package/dist/ace-editor/ace/keybinding-vim.js +7101 -0
  43. package/dist/ace-editor/ace/keybinding-vscode.js +255 -0
  44. package/dist/ace-editor/ace/mode-abap.js +200 -0
  45. package/dist/ace-editor/ace/mode-abc.js +243 -0
  46. package/dist/ace-editor/ace/mode-actionscript.js +234 -0
  47. package/dist/ace-editor/ace/mode-ada.js +108 -0
  48. package/dist/ace-editor/ace/mode-alda.js +279 -0
  49. package/dist/ace-editor/ace/mode-apache_conf.js +318 -0
  50. package/dist/ace-editor/ace/mode-apex.js +402 -0
  51. package/dist/ace-editor/ace/mode-applescript.js +232 -0
  52. package/dist/ace-editor/ace/mode-aql.js +92 -0
  53. package/dist/ace-editor/ace/mode-asciidoc.js +311 -0
  54. package/dist/ace-editor/ace/mode-asl.js +357 -0
  55. package/dist/ace-editor/ace/mode-assembly_arm32.js +185 -0
  56. package/dist/ace-editor/ace/mode-assembly_x86.js +170 -0
  57. package/dist/ace-editor/ace/mode-astro.js +2475 -0
  58. package/dist/ace-editor/ace/mode-autohotkey.js +208 -0
  59. package/dist/ace-editor/ace/mode-basic.js +201 -0
  60. package/dist/ace-editor/ace/mode-batchfile.js +199 -0
  61. package/dist/ace-editor/ace/mode-bibtex.js +318 -0
  62. package/dist/ace-editor/ace/mode-c9search.js +250 -0
  63. package/dist/ace-editor/ace/mode-c_cpp.js +417 -0
  64. package/dist/ace-editor/ace/mode-cedar.js +289 -0
  65. package/dist/ace-editor/ace/mode-cedarschema.js +275 -0
  66. package/dist/ace-editor/ace/mode-cirru.js +192 -0
  67. package/dist/ace-editor/ace/mode-clojure.js +322 -0
  68. package/dist/ace-editor/ace/mode-clue.js +361 -0
  69. package/dist/ace-editor/ace/mode-cobol.js +82 -0
  70. package/dist/ace-editor/ace/mode-coffee.js +335 -0
  71. package/dist/ace-editor/ace/mode-coldfusion.js +2410 -0
  72. package/dist/ace-editor/ace/mode-crystal.js +586 -0
  73. package/dist/ace-editor/ace/mode-csharp.js +413 -0
  74. package/dist/ace-editor/ace/mode-csound_document.js +4073 -0
  75. package/dist/ace-editor/ace/mode-csound_orchestra.js +2923 -0
  76. package/dist/ace-editor/ace/mode-csound_score.js +409 -0
  77. package/dist/ace-editor/ace/mode-csp.js +59 -0
  78. package/dist/ace-editor/ace/mode-css.js +632 -0
  79. package/dist/ace-editor/ace/mode-csv.js +97 -0
  80. package/dist/ace-editor/ace/mode-curly.js +2382 -0
  81. package/dist/ace-editor/ace/mode-cuttlefish.js +56 -0
  82. package/dist/ace-editor/ace/mode-d.js +450 -0
  83. package/dist/ace-editor/ace/mode-dart.js +618 -0
  84. package/dist/ace-editor/ace/mode-diff.js +129 -0
  85. package/dist/ace-editor/ace/mode-django.js +2423 -0
  86. package/dist/ace-editor/ace/mode-dockerfile.js +427 -0
  87. package/dist/ace-editor/ace/mode-dot.js +348 -0
  88. package/dist/ace-editor/ace/mode-drools.js +607 -0
  89. package/dist/ace-editor/ace/mode-edifact.js +130 -0
  90. package/dist/ace-editor/ace/mode-eiffel.js +120 -0
  91. package/dist/ace-editor/ace/mode-ejs.js +3278 -0
  92. package/dist/ace-editor/ace/mode-elixir.js +443 -0
  93. package/dist/ace-editor/ace/mode-elm.js +274 -0
  94. package/dist/ace-editor/ace/mode-erlang.js +836 -0
  95. package/dist/ace-editor/ace/mode-flix.js +163 -0
  96. package/dist/ace-editor/ace/mode-forth.js +253 -0
  97. package/dist/ace-editor/ace/mode-fortran.js +361 -0
  98. package/dist/ace-editor/ace/mode-fsharp.js +277 -0
  99. package/dist/ace-editor/ace/mode-fsl.js +226 -0
  100. package/dist/ace-editor/ace/mode-ftl.js +1256 -0
  101. package/dist/ace-editor/ace/mode-gcode.js +74 -0
  102. package/dist/ace-editor/ace/mode-gherkin.js +154 -0
  103. package/dist/ace-editor/ace/mode-gitignore.js +49 -0
  104. package/dist/ace-editor/ace/mode-glsl.js +475 -0
  105. package/dist/ace-editor/ace/mode-gobstones.js +1460 -0
  106. package/dist/ace-editor/ace/mode-golang.js +341 -0
  107. package/dist/ace-editor/ace/mode-graphqlschema.js +174 -0
  108. package/dist/ace-editor/ace/mode-groovy.js +1402 -0
  109. package/dist/ace-editor/ace/mode-groq.js +288 -0
  110. package/dist/ace-editor/ace/mode-haml.js +1907 -0
  111. package/dist/ace-editor/ace/mode-handlebars.js +2439 -0
  112. package/dist/ace-editor/ace/mode-haskell.js +324 -0
  113. package/dist/ace-editor/ace/mode-haskell_cabal.js +135 -0
  114. package/dist/ace-editor/ace/mode-haxe.js +313 -0
  115. package/dist/ace-editor/ace/mode-hjson.js +318 -0
  116. package/dist/ace-editor/ace/mode-html.js +2340 -0
  117. package/dist/ace-editor/ace/mode-html_elixir.js +2846 -0
  118. package/dist/ace-editor/ace/mode-html_ruby.js +3295 -0
  119. package/dist/ace-editor/ace/mode-ini.js +138 -0
  120. package/dist/ace-editor/ace/mode-io.js +210 -0
  121. package/dist/ace-editor/ace/mode-ion.js +477 -0
  122. package/dist/ace-editor/ace/mode-jack.js +293 -0
  123. package/dist/ace-editor/ace/mode-jade.js +2018 -0
  124. package/dist/ace-editor/ace/mode-java.js +1566 -0
  125. package/dist/ace-editor/ace/mode-javascript.js +1192 -0
  126. package/dist/ace-editor/ace/mode-jexl.js +270 -0
  127. package/dist/ace-editor/ace/mode-json.js +275 -0
  128. package/dist/ace-editor/ace/mode-json5.js +308 -0
  129. package/dist/ace-editor/ace/mode-jsoniq.js +2577 -0
  130. package/dist/ace-editor/ace/mode-jsp.js +1619 -0
  131. package/dist/ace-editor/ace/mode-jssm.js +293 -0
  132. package/dist/ace-editor/ace/mode-jsx.js +1210 -0
  133. package/dist/ace-editor/ace/mode-julia.js +254 -0
  134. package/dist/ace-editor/ace/mode-kotlin.js +445 -0
  135. package/dist/ace-editor/ace/mode-latex.js +252 -0
  136. package/dist/ace-editor/ace/mode-latte.js +2523 -0
  137. package/dist/ace-editor/ace/mode-less.js +742 -0
  138. package/dist/ace-editor/ace/mode-liquid.js +2742 -0
  139. package/dist/ace-editor/ace/mode-lisp.js +104 -0
  140. package/dist/ace-editor/ace/mode-livescript.js +272 -0
  141. package/dist/ace-editor/ace/mode-logiql.js +272 -0
  142. package/dist/ace-editor/ace/mode-logtalk.js +309 -0
  143. package/dist/ace-editor/ace/mode-lsl.js +287 -0
  144. package/dist/ace-editor/ace/mode-lua.js +393 -0
  145. package/dist/ace-editor/ace/mode-luapage.js +2786 -0
  146. package/dist/ace-editor/ace/mode-lucene.js +145 -0
  147. package/dist/ace-editor/ace/mode-makefile.js +374 -0
  148. package/dist/ace-editor/ace/mode-mariadb.js +149 -0
  149. package/dist/ace-editor/ace/mode-markdown.js +2936 -0
  150. package/dist/ace-editor/ace/mode-mask.js +1758 -0
  151. package/dist/ace-editor/ace/mode-matlab.js +239 -0
  152. package/dist/ace-editor/ace/mode-maze.js +256 -0
  153. package/dist/ace-editor/ace/mode-mediawiki.js +580 -0
  154. package/dist/ace-editor/ace/mode-mel.js +213 -0
  155. package/dist/ace-editor/ace/mode-mips.js +231 -0
  156. package/dist/ace-editor/ace/mode-mixal.js +110 -0
  157. package/dist/ace-editor/ace/mode-mushcode.js +642 -0
  158. package/dist/ace-editor/ace/mode-mysql.js +150 -0
  159. package/dist/ace-editor/ace/mode-nasal.js +513 -0
  160. package/dist/ace-editor/ace/mode-nginx.js +262 -0
  161. package/dist/ace-editor/ace/mode-nim.js +325 -0
  162. package/dist/ace-editor/ace/mode-nix.js +555 -0
  163. package/dist/ace-editor/ace/mode-nsis.js +279 -0
  164. package/dist/ace-editor/ace/mode-nunjucks.js +2678 -0
  165. package/dist/ace-editor/ace/mode-objectivec.js +626 -0
  166. package/dist/ace-editor/ace/mode-ocaml.js +378 -0
  167. package/dist/ace-editor/ace/mode-odin.js +449 -0
  168. package/dist/ace-editor/ace/mode-partiql.js +750 -0
  169. package/dist/ace-editor/ace/mode-pascal.js +204 -0
  170. package/dist/ace-editor/ace/mode-perl.js +318 -0
  171. package/dist/ace-editor/ace/mode-pgsql.js +1861 -0
  172. package/dist/ace-editor/ace/mode-php.js +14079 -0
  173. package/dist/ace-editor/ace/mode-php_laravel_blade.js +14267 -0
  174. package/dist/ace-editor/ace/mode-pig.js +278 -0
  175. package/dist/ace-editor/ace/mode-plain_text.js +27 -0
  176. package/dist/ace-editor/ace/mode-plsql.js +268 -0
  177. package/dist/ace-editor/ace/mode-powershell.js +567 -0
  178. package/dist/ace-editor/ace/mode-praat.js +412 -0
  179. package/dist/ace-editor/ace/mode-prisma.js +457 -0
  180. package/dist/ace-editor/ace/mode-prolog.js +305 -0
  181. package/dist/ace-editor/ace/mode-properties.js +69 -0
  182. package/dist/ace-editor/ace/mode-protobuf.js +498 -0
  183. package/dist/ace-editor/ace/mode-prql.js +323 -0
  184. package/dist/ace-editor/ace/mode-puppet.js +316 -0
  185. package/dist/ace-editor/ace/mode-python.js +476 -0
  186. package/dist/ace-editor/ace/mode-qml.js +346 -0
  187. package/dist/ace-editor/ace/mode-r.js +387 -0
  188. package/dist/ace-editor/ace/mode-raku.js +516 -0
  189. package/dist/ace-editor/ace/mode-razor.js +2698 -0
  190. package/dist/ace-editor/ace/mode-rdoc.js +286 -0
  191. package/dist/ace-editor/ace/mode-red.js +388 -0
  192. package/dist/ace-editor/ace/mode-redshift.js +321 -0
  193. package/dist/ace-editor/ace/mode-rhtml.js +2751 -0
  194. package/dist/ace-editor/ace/mode-robot.js +168 -0
  195. package/dist/ace-editor/ace/mode-rst.js +245 -0
  196. package/dist/ace-editor/ace/mode-ruby.js +921 -0
  197. package/dist/ace-editor/ace/mode-rust.js +393 -0
  198. package/dist/ace-editor/ace/mode-sac.js +349 -0
  199. package/dist/ace-editor/ace/mode-sass.js +480 -0
  200. package/dist/ace-editor/ace/mode-scad.js +350 -0
  201. package/dist/ace-editor/ace/mode-scala.js +1396 -0
  202. package/dist/ace-editor/ace/mode-scheme.js +210 -0
  203. package/dist/ace-editor/ace/mode-scrypt.js +317 -0
  204. package/dist/ace-editor/ace/mode-scss.js +768 -0
  205. package/dist/ace-editor/ace/mode-sh.js +387 -0
  206. package/dist/ace-editor/ace/mode-sjs.js +1394 -0
  207. package/dist/ace-editor/ace/mode-slim.js +4771 -0
  208. package/dist/ace-editor/ace/mode-smarty.js +2437 -0
  209. package/dist/ace-editor/ace/mode-smithy.js +456 -0
  210. package/dist/ace-editor/ace/mode-snippets.js +183 -0
  211. package/dist/ace-editor/ace/mode-soy_template.js +2612 -0
  212. package/dist/ace-editor/ace/mode-space.js +151 -0
  213. package/dist/ace-editor/ace/mode-sparql.js +288 -0
  214. package/dist/ace-editor/ace/mode-sql.js +221 -0
  215. package/dist/ace-editor/ace/mode-sqlserver.js +391 -0
  216. package/dist/ace-editor/ace/mode-stylus.js +443 -0
  217. package/dist/ace-editor/ace/mode-svg.js +1488 -0
  218. package/dist/ace-editor/ace/mode-swift.js +342 -0
  219. package/dist/ace-editor/ace/mode-tcl.js +338 -0
  220. package/dist/ace-editor/ace/mode-terraform.js +346 -0
  221. package/dist/ace-editor/ace/mode-tex.js +212 -0
  222. package/dist/ace-editor/ace/mode-text.js +9 -0
  223. package/dist/ace-editor/ace/mode-textile.js +125 -0
  224. package/dist/ace-editor/ace/mode-toml.js +129 -0
  225. package/dist/ace-editor/ace/mode-tsv.js +124 -0
  226. package/dist/ace-editor/ace/mode-tsx.js +1277 -0
  227. package/dist/ace-editor/ace/mode-turtle.js +264 -0
  228. package/dist/ace-editor/ace/mode-twig.js +2503 -0
  229. package/dist/ace-editor/ace/mode-typescript.js +1255 -0
  230. package/dist/ace-editor/ace/mode-vala.js +554 -0
  231. package/dist/ace-editor/ace/mode-vbscript.js +731 -0
  232. package/dist/ace-editor/ace/mode-velocity.js +2581 -0
  233. package/dist/ace-editor/ace/mode-verilog.js +98 -0
  234. package/dist/ace-editor/ace/mode-vhdl.js +94 -0
  235. package/dist/ace-editor/ace/mode-visualforce.js +2455 -0
  236. package/dist/ace-editor/ace/mode-vue.js +3835 -0
  237. package/dist/ace-editor/ace/mode-wollok.js +1330 -0
  238. package/dist/ace-editor/ace/mode-xml.js +477 -0
  239. package/dist/ace-editor/ace/mode-xquery.js +2589 -0
  240. package/dist/ace-editor/ace/mode-yaml.js +395 -0
  241. package/dist/ace-editor/ace/mode-zeek.js +502 -0
  242. package/dist/ace-editor/ace/mode-zig.js +585 -0
  243. package/dist/ace-editor/ace/snippets/abap.js +9 -0
  244. package/dist/ace-editor/ace/snippets/abc.js +16 -0
  245. package/dist/ace-editor/ace/snippets/actionscript.js +16 -0
  246. package/dist/ace-editor/ace/snippets/ada.js +9 -0
  247. package/dist/ace-editor/ace/snippets/alda.js +9 -0
  248. package/dist/ace-editor/ace/snippets/apache_conf.js +9 -0
  249. package/dist/ace-editor/ace/snippets/apex.js +9 -0
  250. package/dist/ace-editor/ace/snippets/applescript.js +9 -0
  251. package/dist/ace-editor/ace/snippets/aql.js +9 -0
  252. package/dist/ace-editor/ace/snippets/asciidoc.js +9 -0
  253. package/dist/ace-editor/ace/snippets/asl.js +9 -0
  254. package/dist/ace-editor/ace/snippets/assembly_arm32.js +9 -0
  255. package/dist/ace-editor/ace/snippets/assembly_x86.js +9 -0
  256. package/dist/ace-editor/ace/snippets/astro.js +9 -0
  257. package/dist/ace-editor/ace/snippets/autohotkey.js +9 -0
  258. package/dist/ace-editor/ace/snippets/basic.js +9 -0
  259. package/dist/ace-editor/ace/snippets/batchfile.js +9 -0
  260. package/dist/ace-editor/ace/snippets/bibtex.js +9 -0
  261. package/dist/ace-editor/ace/snippets/c9search.js +9 -0
  262. package/dist/ace-editor/ace/snippets/c_cpp.js +16 -0
  263. package/dist/ace-editor/ace/snippets/cedar.js +16 -0
  264. package/dist/ace-editor/ace/snippets/cedarschema.js +16 -0
  265. package/dist/ace-editor/ace/snippets/cirru.js +9 -0
  266. package/dist/ace-editor/ace/snippets/clojure.js +16 -0
  267. package/dist/ace-editor/ace/snippets/clue.js +9 -0
  268. package/dist/ace-editor/ace/snippets/cobol.js +9 -0
  269. package/dist/ace-editor/ace/snippets/coffee.js +16 -0
  270. package/dist/ace-editor/ace/snippets/coldfusion.js +9 -0
  271. package/dist/ace-editor/ace/snippets/crystal.js +9 -0
  272. package/dist/ace-editor/ace/snippets/csharp.js +9 -0
  273. package/dist/ace-editor/ace/snippets/csound_document.js +16 -0
  274. package/dist/ace-editor/ace/snippets/csound_orchestra.js +16 -0
  275. package/dist/ace-editor/ace/snippets/csound_score.js +9 -0
  276. package/dist/ace-editor/ace/snippets/csp.js +9 -0
  277. package/dist/ace-editor/ace/snippets/css.js +16 -0
  278. package/dist/ace-editor/ace/snippets/csv.js +9 -0
  279. package/dist/ace-editor/ace/snippets/curly.js +9 -0
  280. package/dist/ace-editor/ace/snippets/cuttlefish.js +9 -0
  281. package/dist/ace-editor/ace/snippets/d.js +9 -0
  282. package/dist/ace-editor/ace/snippets/dart.js +16 -0
  283. package/dist/ace-editor/ace/snippets/diff.js +16 -0
  284. package/dist/ace-editor/ace/snippets/django.js +16 -0
  285. package/dist/ace-editor/ace/snippets/dockerfile.js +9 -0
  286. package/dist/ace-editor/ace/snippets/dot.js +9 -0
  287. package/dist/ace-editor/ace/snippets/drools.js +16 -0
  288. package/dist/ace-editor/ace/snippets/edifact.js +16 -0
  289. package/dist/ace-editor/ace/snippets/eiffel.js +9 -0
  290. package/dist/ace-editor/ace/snippets/ejs.js +9 -0
  291. package/dist/ace-editor/ace/snippets/elixir.js +9 -0
  292. package/dist/ace-editor/ace/snippets/elm.js +9 -0
  293. package/dist/ace-editor/ace/snippets/erlang.js +16 -0
  294. package/dist/ace-editor/ace/snippets/flix.js +9 -0
  295. package/dist/ace-editor/ace/snippets/forth.js +9 -0
  296. package/dist/ace-editor/ace/snippets/fortran.js +9 -0
  297. package/dist/ace-editor/ace/snippets/fsharp.js +9 -0
  298. package/dist/ace-editor/ace/snippets/fsl.js +16 -0
  299. package/dist/ace-editor/ace/snippets/ftl.js +9 -0
  300. package/dist/ace-editor/ace/snippets/gcode.js +9 -0
  301. package/dist/ace-editor/ace/snippets/gherkin.js +9 -0
  302. package/dist/ace-editor/ace/snippets/gitignore.js +9 -0
  303. package/dist/ace-editor/ace/snippets/glsl.js +9 -0
  304. package/dist/ace-editor/ace/snippets/gobstones.js +16 -0
  305. package/dist/ace-editor/ace/snippets/golang.js +9 -0
  306. package/dist/ace-editor/ace/snippets/graphqlschema.js +16 -0
  307. package/dist/ace-editor/ace/snippets/groovy.js +9 -0
  308. package/dist/ace-editor/ace/snippets/groq.js +9 -0
  309. package/dist/ace-editor/ace/snippets/haml.js +16 -0
  310. package/dist/ace-editor/ace/snippets/handlebars.js +9 -0
  311. package/dist/ace-editor/ace/snippets/haskell.js +16 -0
  312. package/dist/ace-editor/ace/snippets/haskell_cabal.js +9 -0
  313. package/dist/ace-editor/ace/snippets/haxe.js +9 -0
  314. package/dist/ace-editor/ace/snippets/hjson.js +9 -0
  315. package/dist/ace-editor/ace/snippets/html.js +16 -0
  316. package/dist/ace-editor/ace/snippets/html_elixir.js +9 -0
  317. package/dist/ace-editor/ace/snippets/html_ruby.js +9 -0
  318. package/dist/ace-editor/ace/snippets/ini.js +9 -0
  319. package/dist/ace-editor/ace/snippets/io.js +74 -0
  320. package/dist/ace-editor/ace/snippets/ion.js +9 -0
  321. package/dist/ace-editor/ace/snippets/jack.js +9 -0
  322. package/dist/ace-editor/ace/snippets/jade.js +9 -0
  323. package/dist/ace-editor/ace/snippets/java.js +16 -0
  324. package/dist/ace-editor/ace/snippets/javascript.js +16 -0
  325. package/dist/ace-editor/ace/snippets/jexl.js +9 -0
  326. package/dist/ace-editor/ace/snippets/json.js +9 -0
  327. package/dist/ace-editor/ace/snippets/json5.js +9 -0
  328. package/dist/ace-editor/ace/snippets/jsoniq.js +78 -0
  329. package/dist/ace-editor/ace/snippets/jsp.js +16 -0
  330. package/dist/ace-editor/ace/snippets/jssm.js +9 -0
  331. package/dist/ace-editor/ace/snippets/jsx.js +9 -0
  332. package/dist/ace-editor/ace/snippets/julia.js +9 -0
  333. package/dist/ace-editor/ace/snippets/kotlin.js +9 -0
  334. package/dist/ace-editor/ace/snippets/latex.js +9 -0
  335. package/dist/ace-editor/ace/snippets/latte.js +9 -0
  336. package/dist/ace-editor/ace/snippets/less.js +9 -0
  337. package/dist/ace-editor/ace/snippets/liquid.js +16 -0
  338. package/dist/ace-editor/ace/snippets/lisp.js +9 -0
  339. package/dist/ace-editor/ace/snippets/livescript.js +9 -0
  340. package/dist/ace-editor/ace/snippets/logiql.js +9 -0
  341. package/dist/ace-editor/ace/snippets/logtalk.js +9 -0
  342. package/dist/ace-editor/ace/snippets/lsl.js +16 -0
  343. package/dist/ace-editor/ace/snippets/lua.js +16 -0
  344. package/dist/ace-editor/ace/snippets/luapage.js +9 -0
  345. package/dist/ace-editor/ace/snippets/lucene.js +9 -0
  346. package/dist/ace-editor/ace/snippets/makefile.js +16 -0
  347. package/dist/ace-editor/ace/snippets/mariadb.js +9 -0
  348. package/dist/ace-editor/ace/snippets/markdown.js +16 -0
  349. package/dist/ace-editor/ace/snippets/mask.js +9 -0
  350. package/dist/ace-editor/ace/snippets/matlab.js +9 -0
  351. package/dist/ace-editor/ace/snippets/maze.js +16 -0
  352. package/dist/ace-editor/ace/snippets/mediawiki.js +9 -0
  353. package/dist/ace-editor/ace/snippets/mel.js +9 -0
  354. package/dist/ace-editor/ace/snippets/mips.js +9 -0
  355. package/dist/ace-editor/ace/snippets/mixal.js +9 -0
  356. package/dist/ace-editor/ace/snippets/mushcode.js +9 -0
  357. package/dist/ace-editor/ace/snippets/mysql.js +9 -0
  358. package/dist/ace-editor/ace/snippets/nasal.js +9 -0
  359. package/dist/ace-editor/ace/snippets/nginx.js +9 -0
  360. package/dist/ace-editor/ace/snippets/nim.js +9 -0
  361. package/dist/ace-editor/ace/snippets/nix.js +9 -0
  362. package/dist/ace-editor/ace/snippets/nsis.js +9 -0
  363. package/dist/ace-editor/ace/snippets/nunjucks.js +9 -0
  364. package/dist/ace-editor/ace/snippets/objectivec.js +9 -0
  365. package/dist/ace-editor/ace/snippets/ocaml.js +9 -0
  366. package/dist/ace-editor/ace/snippets/odin.js +9 -0
  367. package/dist/ace-editor/ace/snippets/partiql.js +9 -0
  368. package/dist/ace-editor/ace/snippets/pascal.js +9 -0
  369. package/dist/ace-editor/ace/snippets/perl.js +16 -0
  370. package/dist/ace-editor/ace/snippets/pgsql.js +9 -0
  371. package/dist/ace-editor/ace/snippets/php.js +16 -0
  372. package/dist/ace-editor/ace/snippets/php_laravel_blade.js +9 -0
  373. package/dist/ace-editor/ace/snippets/pig.js +9 -0
  374. package/dist/ace-editor/ace/snippets/plain_text.js +9 -0
  375. package/dist/ace-editor/ace/snippets/plsql.js +9 -0
  376. package/dist/ace-editor/ace/snippets/powershell.js +9 -0
  377. package/dist/ace-editor/ace/snippets/praat.js +9 -0
  378. package/dist/ace-editor/ace/snippets/prisma.js +9 -0
  379. package/dist/ace-editor/ace/snippets/prolog.js +9 -0
  380. package/dist/ace-editor/ace/snippets/properties.js +9 -0
  381. package/dist/ace-editor/ace/snippets/protobuf.js +9 -0
  382. package/dist/ace-editor/ace/snippets/prql.js +9 -0
  383. package/dist/ace-editor/ace/snippets/puppet.js +9 -0
  384. package/dist/ace-editor/ace/snippets/python.js +16 -0
  385. package/dist/ace-editor/ace/snippets/qml.js +9 -0
  386. package/dist/ace-editor/ace/snippets/r.js +16 -0
  387. package/dist/ace-editor/ace/snippets/raku.js +9 -0
  388. package/dist/ace-editor/ace/snippets/razor.js +16 -0
  389. package/dist/ace-editor/ace/snippets/rdoc.js +9 -0
  390. package/dist/ace-editor/ace/snippets/red.js +9 -0
  391. package/dist/ace-editor/ace/snippets/redshift.js +9 -0
  392. package/dist/ace-editor/ace/snippets/rhtml.js +9 -0
  393. package/dist/ace-editor/ace/snippets/robot.js +16 -0
  394. package/dist/ace-editor/ace/snippets/rst.js +16 -0
  395. package/dist/ace-editor/ace/snippets/ruby.js +16 -0
  396. package/dist/ace-editor/ace/snippets/rust.js +9 -0
  397. package/dist/ace-editor/ace/snippets/sac.js +9 -0
  398. package/dist/ace-editor/ace/snippets/sass.js +9 -0
  399. package/dist/ace-editor/ace/snippets/scad.js +9 -0
  400. package/dist/ace-editor/ace/snippets/scala.js +9 -0
  401. package/dist/ace-editor/ace/snippets/scheme.js +9 -0
  402. package/dist/ace-editor/ace/snippets/scrypt.js +9 -0
  403. package/dist/ace-editor/ace/snippets/scss.js +9 -0
  404. package/dist/ace-editor/ace/snippets/sh.js +16 -0
  405. package/dist/ace-editor/ace/snippets/sjs.js +9 -0
  406. package/dist/ace-editor/ace/snippets/slim.js +9 -0
  407. package/dist/ace-editor/ace/snippets/smarty.js +9 -0
  408. package/dist/ace-editor/ace/snippets/smithy.js +9 -0
  409. package/dist/ace-editor/ace/snippets/snippets.js +16 -0
  410. package/dist/ace-editor/ace/snippets/soy_template.js +9 -0
  411. package/dist/ace-editor/ace/snippets/space.js +9 -0
  412. package/dist/ace-editor/ace/snippets/sparql.js +9 -0
  413. package/dist/ace-editor/ace/snippets/sql.js +16 -0
  414. package/dist/ace-editor/ace/snippets/sqlserver.js +16 -0
  415. package/dist/ace-editor/ace/snippets/stylus.js +9 -0
  416. package/dist/ace-editor/ace/snippets/svg.js +9 -0
  417. package/dist/ace-editor/ace/snippets/swift.js +9 -0
  418. package/dist/ace-editor/ace/snippets/tcl.js +16 -0
  419. package/dist/ace-editor/ace/snippets/terraform.js +9 -0
  420. package/dist/ace-editor/ace/snippets/tex.js +16 -0
  421. package/dist/ace-editor/ace/snippets/text.js +9 -0
  422. package/dist/ace-editor/ace/snippets/textile.js +16 -0
  423. package/dist/ace-editor/ace/snippets/toml.js +9 -0
  424. package/dist/ace-editor/ace/snippets/tsv.js +9 -0
  425. package/dist/ace-editor/ace/snippets/tsx.js +9 -0
  426. package/dist/ace-editor/ace/snippets/turtle.js +9 -0
  427. package/dist/ace-editor/ace/snippets/twig.js +9 -0
  428. package/dist/ace-editor/ace/snippets/typescript.js +9 -0
  429. package/dist/ace-editor/ace/snippets/vala.js +199 -0
  430. package/dist/ace-editor/ace/snippets/vbscript.js +9 -0
  431. package/dist/ace-editor/ace/snippets/velocity.js +17 -0
  432. package/dist/ace-editor/ace/snippets/verilog.js +9 -0
  433. package/dist/ace-editor/ace/snippets/vhdl.js +9 -0
  434. package/dist/ace-editor/ace/snippets/visualforce.js +9 -0
  435. package/dist/ace-editor/ace/snippets/vue.js +9 -0
  436. package/dist/ace-editor/ace/snippets/wollok.js +16 -0
  437. package/dist/ace-editor/ace/snippets/xml.js +9 -0
  438. package/dist/ace-editor/ace/snippets/xquery.js +78 -0
  439. package/dist/ace-editor/ace/snippets/yaml.js +9 -0
  440. package/dist/ace-editor/ace/snippets/zeek.js +9 -0
  441. package/dist/ace-editor/ace/snippets/zig.js +9 -0
  442. package/dist/ace-editor/ace/theme-ambiance.js +18 -0
  443. package/dist/ace-editor/ace/theme-chaos.js +18 -0
  444. package/dist/ace-editor/ace/theme-chrome.js +18 -0
  445. package/dist/ace-editor/ace/theme-cloud9_day.js +19 -0
  446. package/dist/ace-editor/ace/theme-cloud9_night.js +18 -0
  447. package/dist/ace-editor/ace/theme-cloud9_night_low_color.js +18 -0
  448. package/dist/ace-editor/ace/theme-cloud_editor.js +19 -0
  449. package/dist/ace-editor/ace/theme-cloud_editor_dark.js +19 -0
  450. package/dist/ace-editor/ace/theme-clouds.js +18 -0
  451. package/dist/ace-editor/ace/theme-clouds_midnight.js +18 -0
  452. package/dist/ace-editor/ace/theme-cobalt.js +18 -0
  453. package/dist/ace-editor/ace/theme-crimson_editor.js +18 -0
  454. package/dist/ace-editor/ace/theme-dawn.js +18 -0
  455. package/dist/ace-editor/ace/theme-dracula.js +19 -0
  456. package/dist/ace-editor/ace/theme-dreamweaver.js +18 -0
  457. package/dist/ace-editor/ace/theme-eclipse.js +19 -0
  458. package/dist/ace-editor/ace/theme-github.js +18 -0
  459. package/dist/ace-editor/ace/theme-github_dark.js +18 -0
  460. package/dist/ace-editor/ace/theme-github_light_default.js +18 -0
  461. package/dist/ace-editor/ace/theme-gob.js +18 -0
  462. package/dist/ace-editor/ace/theme-gruvbox.js +18 -0
  463. package/dist/ace-editor/ace/theme-gruvbox_dark_hard.js +18 -0
  464. package/dist/ace-editor/ace/theme-gruvbox_light_hard.js +18 -0
  465. package/dist/ace-editor/ace/theme-idle_fingers.js +18 -0
  466. package/dist/ace-editor/ace/theme-iplastic.js +18 -0
  467. package/dist/ace-editor/ace/theme-katzenmilch.js +18 -0
  468. package/dist/ace-editor/ace/theme-kr_theme.js +18 -0
  469. package/dist/ace-editor/ace/theme-kuroir.js +18 -0
  470. package/dist/ace-editor/ace/theme-merbivore.js +18 -0
  471. package/dist/ace-editor/ace/theme-merbivore_soft.js +18 -0
  472. package/dist/ace-editor/ace/theme-mono_industrial.js +18 -0
  473. package/dist/ace-editor/ace/theme-monokai.js +18 -0
  474. package/dist/ace-editor/ace/theme-nord_dark.js +19 -0
  475. package/dist/ace-editor/ace/theme-one_dark.js +18 -0
  476. package/dist/ace-editor/ace/theme-pastel_on_dark.js +18 -0
  477. package/dist/ace-editor/ace/theme-solarized_dark.js +18 -0
  478. package/dist/ace-editor/ace/theme-solarized_light.js +18 -0
  479. package/dist/ace-editor/ace/theme-sqlserver.js +18 -0
  480. package/dist/ace-editor/ace/theme-terminal.js +18 -0
  481. package/dist/ace-editor/ace/theme-textmate.js +16 -0
  482. package/dist/ace-editor/ace/theme-tomorrow.js +18 -0
  483. package/dist/ace-editor/ace/theme-tomorrow_night.js +18 -0
  484. package/dist/ace-editor/ace/theme-tomorrow_night_blue.js +18 -0
  485. package/dist/ace-editor/ace/theme-tomorrow_night_bright.js +18 -0
  486. package/dist/ace-editor/ace/theme-tomorrow_night_eighties.js +18 -0
  487. package/dist/ace-editor/ace/theme-twilight.js +18 -0
  488. package/dist/ace-editor/ace/theme-vibrant_ink.js +18 -0
  489. package/dist/ace-editor/ace/theme-xcode.js +18 -0
  490. package/dist/ace-editor/ace/worker-base.js +1337 -0
  491. package/dist/ace-editor/ace/worker-coffee.js +1386 -0
  492. package/dist/ace-editor/ace/worker-css.js +8918 -0
  493. package/dist/ace-editor/ace/worker-html.js +10848 -0
  494. package/dist/ace-editor/ace/worker-javascript.js +15358 -0
  495. package/dist/ace-editor/ace/worker-json.js +1631 -0
  496. package/dist/ace-editor/ace/worker-lua.js +3524 -0
  497. package/dist/ace-editor/ace/worker-php.js +3793 -0
  498. package/dist/ace-editor/ace/worker-xml.js +3127 -0
  499. package/dist/ace-editor/ace/worker-xquery.js +57584 -0
  500. package/dist/ace-editor/ace/worker-yaml.js +5824 -0
  501. package/dist/ace-editor/internal/AceEditor.d.ts +22 -0
  502. package/dist/ace-editor/internal/AceEditor.js +113 -0
  503. package/dist/ace-editor/internal/AceEditor.js.map +1 -0
  504. package/dist/ace-editor/internal/ace-editor-base/AceEditorBase.d.ts +55 -0
  505. package/dist/ace-editor/internal/ace-editor-base/AceEditorBase.js +205 -0
  506. package/dist/ace-editor/internal/ace-editor-base/AceEditorBase.js.map +1 -0
  507. package/dist/ace-editor/internal/ace-editor-base/debounce.d.ts +24 -0
  508. package/dist/ace-editor/internal/ace-editor-base/debounce.js +41 -0
  509. package/dist/ace-editor/internal/ace-editor-base/debounce.js.map +1 -0
  510. package/dist/ace-editor/internal/ace-editor-base/property-decorators.d.ts +66 -0
  511. package/dist/ace-editor/internal/ace-editor-base/property-decorators.js +171 -0
  512. package/dist/ace-editor/internal/ace-editor-base/property-decorators.js.map +1 -0
  513. package/dist/ace-editor/internal/ace-theme-oscd.d.ts +1 -0
  514. package/dist/ace-editor/internal/ace-theme-oscd.js +247 -0
  515. package/dist/ace-editor/internal/ace-theme-oscd.js.map +1 -0
  516. package/dist/ace-editor/internal/ace.config.d.ts +54 -0
  517. package/dist/ace-editor/internal/ace.config.js +61 -0
  518. package/dist/ace-editor/internal/ace.config.js.map +1 -0
  519. package/dist/ace-editor/oscd-ace-editor.d.ts +2 -0
  520. package/dist/ace-editor/oscd-ace-editor.js +4 -0
  521. package/dist/ace-editor/oscd-ace-editor.js.map +1 -0
  522. package/dist/action-icon/OscdActionIcon.js +1 -3
  523. package/dist/action-icon/OscdActionIcon.js.map +1 -1
  524. package/dist/action-list/OscdActionList.js +8 -8
  525. package/dist/action-list/OscdActionList.js.map +1 -1
  526. package/dist/action-pane/OscdActionPane.js +1 -3
  527. package/dist/action-pane/OscdActionPane.js.map +1 -1
  528. package/dist/action-tree/OscdActionTree.d.ts +2 -0
  529. package/dist/action-tree/OscdActionTree.js +32 -62
  530. package/dist/action-tree/OscdActionTree.js.map +1 -1
  531. package/dist/action-tree/oscd-action-tree.spec.js +2 -2
  532. package/dist/action-tree/oscd-action-tree.spec.js.map +1 -1
  533. package/dist/app-bar/OscdAppBar.d.ts +1 -1
  534. package/dist/app-bar/OscdAppBar.js +1 -1
  535. package/dist/app-bar/OscdAppBar.js.map +1 -1
  536. package/dist/app-bar/oscd-app-bar.d.ts +1 -1
  537. package/dist/app-bar/oscd-app-bar.js +1 -1
  538. package/dist/app-bar/oscd-app-bar.js.map +1 -1
  539. package/dist/button/OscdElevatedButton.d.ts +1 -1
  540. package/dist/button/OscdElevatedButton.js +1 -1
  541. package/dist/button/OscdElevatedButton.js.map +1 -1
  542. package/dist/button/OscdFilledButton.d.ts +1 -1
  543. package/dist/button/OscdFilledButton.js +1 -1
  544. package/dist/button/OscdFilledButton.js.map +1 -1
  545. package/dist/button/OscdFilledTonalButton.d.ts +1 -1
  546. package/dist/button/OscdFilledTonalButton.js +1 -1
  547. package/dist/button/OscdFilledTonalButton.js.map +1 -1
  548. package/dist/button/OscdOutlinedButton.d.ts +1 -1
  549. package/dist/button/OscdOutlinedButton.js +1 -1
  550. package/dist/button/OscdOutlinedButton.js.map +1 -1
  551. package/dist/button/OscdTextButton.d.ts +1 -1
  552. package/dist/button/OscdTextButton.js +1 -1
  553. package/dist/button/OscdTextButton.js.map +1 -1
  554. package/dist/checkbox/OscdCheckbox.d.ts +1 -1
  555. package/dist/checkbox/OscdCheckbox.js +1 -1
  556. package/dist/checkbox/OscdCheckbox.js.map +1 -1
  557. package/dist/chips/OscdAssistChip.d.ts +1 -1
  558. package/dist/chips/OscdAssistChip.js +1 -1
  559. package/dist/chips/OscdAssistChip.js.map +1 -1
  560. package/dist/chips/OscdChipSet.d.ts +1 -1
  561. package/dist/chips/OscdChipSet.js.map +1 -1
  562. package/dist/chips/OscdFilterChip.d.ts +1 -1
  563. package/dist/chips/OscdFilterChip.js +1 -1
  564. package/dist/chips/OscdFilterChip.js.map +1 -1
  565. package/dist/chips/OscdInputChip.d.ts +1 -1
  566. package/dist/chips/OscdInputChip.js +1 -1
  567. package/dist/chips/OscdInputChip.js.map +1 -1
  568. package/dist/chips/OscdSuggestionChip.d.ts +1 -1
  569. package/dist/chips/OscdSuggestionChip.js +1 -1
  570. package/dist/chips/OscdSuggestionChip.js.map +1 -1
  571. package/dist/decorators/localstorage.js.map +1 -1
  572. package/dist/dialog/OscdDialog.d.ts +1 -1
  573. package/dist/dialog/OscdDialog.js +1 -1
  574. package/dist/dialog/OscdDialog.js.map +1 -1
  575. package/dist/dialog/warning/OscdWarnDialog.d.ts +31 -0
  576. package/dist/dialog/warning/OscdWarnDialog.js +74 -0
  577. package/dist/dialog/warning/OscdWarnDialog.js.map +1 -0
  578. package/dist/dialog/warning/oscd-warn-dialog.d.ts +2 -0
  579. package/dist/dialog/warning/oscd-warn-dialog.js +4 -0
  580. package/dist/dialog/warning/oscd-warn-dialog.js.map +1 -0
  581. package/dist/divider/OscdDivider.d.ts +1 -1
  582. package/dist/divider/OscdDivider.js.map +1 -1
  583. package/dist/elevation/OscdElevation.d.ts +1 -1
  584. package/dist/elevation/OscdElevation.js.map +1 -1
  585. package/dist/fab/OscdBrandedFab.d.ts +1 -1
  586. package/dist/fab/OscdBrandedFab.js +1 -1
  587. package/dist/fab/OscdBrandedFab.js.map +1 -1
  588. package/dist/fab/OscdFab.d.ts +1 -1
  589. package/dist/fab/OscdFab.js +1 -1
  590. package/dist/fab/OscdFab.js.map +1 -1
  591. package/dist/field/OscdFilledField.d.ts +1 -1
  592. package/dist/field/OscdFilledField.js.map +1 -1
  593. package/dist/field/OscdOutlinedField.d.ts +1 -1
  594. package/dist/field/OscdOutlinedField.js.map +1 -1
  595. package/dist/filter-button/OscdFilterButton.js.map +1 -1
  596. package/dist/focus/OscdFocusRing.d.ts +1 -1
  597. package/dist/focus/OscdFocusRing.js.map +1 -1
  598. package/dist/icon/OscdIcon.d.ts +1 -1
  599. package/dist/icon/OscdIcon.js +1 -1
  600. package/dist/icon/OscdIcon.js.map +1 -1
  601. package/dist/icon/internal/icon.d.ts +1 -1
  602. package/dist/icon/internal/icon.js +1 -1
  603. package/dist/icon/internal/icon.js.map +1 -1
  604. package/dist/iconbutton/OscdFilledIconButton.d.ts +1 -1
  605. package/dist/iconbutton/OscdFilledIconButton.js +1 -1
  606. package/dist/iconbutton/OscdFilledIconButton.js.map +1 -1
  607. package/dist/iconbutton/OscdFilledTonalIconButton.d.ts +1 -1
  608. package/dist/iconbutton/OscdFilledTonalIconButton.js +1 -1
  609. package/dist/iconbutton/OscdFilledTonalIconButton.js.map +1 -1
  610. package/dist/iconbutton/OscdIconButton.d.ts +1 -1
  611. package/dist/iconbutton/OscdIconButton.js +1 -1
  612. package/dist/iconbutton/OscdIconButton.js.map +1 -1
  613. package/dist/iconbutton/OscdOutlinedIconButton.d.ts +1 -1
  614. package/dist/iconbutton/OscdOutlinedIconButton.js +1 -1
  615. package/dist/iconbutton/OscdOutlinedIconButton.js.map +1 -1
  616. package/dist/labs/badge/OscdBadge.d.ts +1 -1
  617. package/dist/labs/badge/OscdBadge.js.map +1 -1
  618. package/dist/labs/card/OscdElevatedCard.d.ts +1 -1
  619. package/dist/labs/card/OscdElevatedCard.js +1 -1
  620. package/dist/labs/card/OscdElevatedCard.js.map +1 -1
  621. package/dist/labs/card/OscdFilledCard.d.ts +1 -1
  622. package/dist/labs/card/OscdFilledCard.js +1 -1
  623. package/dist/labs/card/OscdFilledCard.js.map +1 -1
  624. package/dist/labs/card/OscdOutlinedCard.d.ts +1 -1
  625. package/dist/labs/card/OscdOutlinedCard.js +1 -1
  626. package/dist/labs/card/OscdOutlinedCard.js.map +1 -1
  627. package/dist/labs/item/OscdItem.d.ts +1 -1
  628. package/dist/labs/item/OscdItem.js.map +1 -1
  629. package/dist/labs/navigationbar/OscdNavigationBar.d.ts +1 -1
  630. package/dist/labs/navigationbar/OscdNavigationBar.js +1 -1
  631. package/dist/labs/navigationbar/OscdNavigationBar.js.map +1 -1
  632. package/dist/labs/navigationtab/OscdNavigationTab.d.ts +1 -1
  633. package/dist/labs/navigationtab/OscdNavigationTab.js +1 -1
  634. package/dist/labs/navigationtab/OscdNavigationTab.js.map +1 -1
  635. package/dist/labs/segmentedbutton/OscdOutlinedSegmentedButton.d.ts +1 -1
  636. package/dist/labs/segmentedbutton/OscdOutlinedSegmentedButton.js +1 -1
  637. package/dist/labs/segmentedbutton/OscdOutlinedSegmentedButton.js.map +1 -1
  638. package/dist/labs/segmentedbuttonset/OscdOutlinedSegmentedButtonSet.d.ts +1 -1
  639. package/dist/labs/segmentedbuttonset/OscdOutlinedSegmentedButtonSet.js.map +1 -1
  640. package/dist/list/OscdList.d.ts +1 -1
  641. package/dist/list/OscdList.js.map +1 -1
  642. package/dist/list/OscdListItem.d.ts +1 -1
  643. package/dist/list/OscdListItem.js +1 -1
  644. package/dist/list/OscdListItem.js.map +1 -1
  645. package/dist/menu/OscdMenu.d.ts +1 -1
  646. package/dist/menu/OscdMenu.js +1 -1
  647. package/dist/menu/OscdMenu.js.map +1 -1
  648. package/dist/menu/OscdMenuItem.d.ts +1 -1
  649. package/dist/menu/OscdMenuItem.js +1 -1
  650. package/dist/menu/OscdMenuItem.js.map +1 -1
  651. package/dist/menu/OscdSubMenu.d.ts +1 -1
  652. package/dist/menu/OscdSubMenu.js.map +1 -1
  653. package/dist/navigation-drawer/OscdNavigationDrawer.d.ts +1 -1
  654. package/dist/navigation-drawer/OscdNavigationDrawer.js +1 -1
  655. package/dist/navigation-drawer/OscdNavigationDrawer.js.map +1 -1
  656. package/dist/navigation-drawer/OscdNavigationDrawerHeader.d.ts +1 -1
  657. package/dist/navigation-drawer/OscdNavigationDrawerHeader.js +1 -1
  658. package/dist/navigation-drawer/OscdNavigationDrawerHeader.js.map +1 -1
  659. package/dist/progress/OscdCircularProgress.d.ts +1 -1
  660. package/dist/progress/OscdCircularProgress.js.map +1 -1
  661. package/dist/progress/OscdLinearProgress.d.ts +1 -1
  662. package/dist/progress/OscdLinearProgress.js.map +1 -1
  663. package/dist/radio/OscdRadio.d.ts +1 -1
  664. package/dist/radio/OscdRadio.js +1 -1
  665. package/dist/radio/OscdRadio.js.map +1 -1
  666. package/dist/ripple/OscdRipple.d.ts +1 -1
  667. package/dist/ripple/OscdRipple.js.map +1 -1
  668. package/dist/scl-checkbox/OscdSclCheckbox.js +1 -3
  669. package/dist/scl-checkbox/OscdSclCheckbox.js.map +1 -1
  670. package/dist/scl-icon/OscdSclIcon.d.ts +1 -1
  671. package/dist/scl-icon/OscdSclIcon.js +1 -1
  672. package/dist/scl-icon/OscdSclIcon.js.map +1 -1
  673. package/dist/search-field/internal/OutlinedSearchField.js.map +1 -1
  674. package/dist/search-field/oscd-outlined-search-field.spec.js +5 -6
  675. package/dist/search-field/oscd-outlined-search-field.spec.js.map +1 -1
  676. package/dist/select/OscdFilledSelect.d.ts +1 -1
  677. package/dist/select/OscdFilledSelect.js +1 -1
  678. package/dist/select/OscdFilledSelect.js.map +1 -1
  679. package/dist/select/OscdOutlinedSelect.d.ts +1 -1
  680. package/dist/select/OscdOutlinedSelect.js +1 -1
  681. package/dist/select/OscdOutlinedSelect.js.map +1 -1
  682. package/dist/select/OscdSelectOption.d.ts +1 -1
  683. package/dist/select/OscdSelectOption.js +1 -1
  684. package/dist/select/OscdSelectOption.js.map +1 -1
  685. package/dist/selection-list/OscdSelectionList.js.map +1 -1
  686. package/dist/slider/OscdSlider.d.ts +1 -1
  687. package/dist/slider/OscdSlider.js +1 -1
  688. package/dist/slider/OscdSlider.js.map +1 -1
  689. package/dist/switch/OscdSwitch.d.ts +1 -1
  690. package/dist/switch/OscdSwitch.js +1 -1
  691. package/dist/switch/OscdSwitch.js.map +1 -1
  692. package/dist/tabs/OscdPrimaryTab.d.ts +1 -1
  693. package/dist/tabs/OscdPrimaryTab.js +1 -1
  694. package/dist/tabs/OscdPrimaryTab.js.map +1 -1
  695. package/dist/tabs/OscdPrimaryTab.stories.js +1 -3
  696. package/dist/tabs/OscdPrimaryTab.stories.js.map +1 -1
  697. package/dist/tabs/OscdSecondaryTab.d.ts +1 -1
  698. package/dist/tabs/OscdSecondaryTab.js +1 -1
  699. package/dist/tabs/OscdSecondaryTab.js.map +1 -1
  700. package/dist/tabs/OscdSecondaryTab.stories.js +1 -3
  701. package/dist/tabs/OscdSecondaryTab.stories.js.map +1 -1
  702. package/dist/tabs/OscdTabs.d.ts +1 -1
  703. package/dist/tabs/OscdTabs.js +1 -1
  704. package/dist/tabs/OscdTabs.js.map +1 -1
  705. package/dist/textfield/OscdFilledTextField.d.ts +1 -1
  706. package/dist/textfield/OscdFilledTextField.js +1 -1
  707. package/dist/textfield/OscdFilledTextField.js.map +1 -1
  708. package/dist/textfield/OscdOutlinedTextField.d.ts +1 -1
  709. package/dist/textfield/OscdOutlinedTextField.js +1 -1
  710. package/dist/textfield/OscdOutlinedTextField.js.map +1 -1
  711. package/dist/tree/OscdTree.stories.js +22 -4
  712. package/dist/tree/OscdTree.stories.js.map +1 -1
  713. package/dist/tree/internal/Tree.js +30 -6
  714. package/dist/tree/internal/Tree.js.map +1 -1
  715. package/dist/tree/internal/TreeItem.js +22 -8
  716. package/dist/tree/internal/TreeItem.js.map +1 -1
  717. package/dist/tree-grid/OscdTreeGrid.js +1 -4
  718. package/dist/tree-grid/OscdTreeGrid.js.map +1 -1
  719. package/dist/utils/storybook/getStorybookHelpers.js +2 -2
  720. package/dist/utils/storybook/getStorybookHelpers.js.map +1 -1
  721. package/dist/utils/storybook/getStorybookMeta.d.ts +5 -0
  722. package/dist/utils/storybook/getStorybookMeta.js +2 -1
  723. package/dist/utils/storybook/getStorybookMeta.js.map +1 -1
  724. package/package.json +39 -71
@@ -0,0 +1,3524 @@
1
+ "no use strict";
2
+ !(function(window) {
3
+ if (typeof window.window != "undefined" && window.document)
4
+ return;
5
+ if (window.require && window.define)
6
+ return;
7
+
8
+ if (!window.console) {
9
+ window.console = function() {
10
+ var msgs = Array.prototype.slice.call(arguments, 0);
11
+ postMessage({type: "log", data: msgs});
12
+ };
13
+ window.console.error =
14
+ window.console.warn =
15
+ window.console.log =
16
+ window.console.trace = window.console;
17
+ }
18
+ window.window = window;
19
+ window.ace = window;
20
+
21
+ window.onerror = function(message, file, line, col, err) {
22
+ postMessage({type: "error", data: {
23
+ message: message,
24
+ data: err && err.data,
25
+ file: file,
26
+ line: line,
27
+ col: col,
28
+ stack: err && err.stack
29
+ }});
30
+ };
31
+
32
+ window.normalizeModule = function(parentId, moduleName) {
33
+ // normalize plugin requires
34
+ if (moduleName.indexOf("!") !== -1) {
35
+ var chunks = moduleName.split("!");
36
+ return window.normalizeModule(parentId, chunks[0]) + "!" + window.normalizeModule(parentId, chunks[1]);
37
+ }
38
+ // normalize relative requires
39
+ if (moduleName.charAt(0) == ".") {
40
+ var base = parentId.split("/").slice(0, -1).join("/");
41
+ moduleName = (base ? base + "/" : "") + moduleName;
42
+
43
+ while (moduleName.indexOf(".") !== -1 && previous != moduleName) {
44
+ var previous = moduleName;
45
+ moduleName = moduleName.replace(/^\.\//, "").replace(/\/\.\//, "/").replace(/[^\/]+\/\.\.\//, "");
46
+ }
47
+ }
48
+
49
+ return moduleName;
50
+ };
51
+
52
+ window.require = function require(parentId, id) {
53
+ if (!id) {
54
+ id = parentId;
55
+ parentId = null;
56
+ }
57
+ if (!id.charAt)
58
+ throw new Error("worker.js require() accepts only (parentId, id) as arguments");
59
+
60
+ id = window.normalizeModule(parentId, id);
61
+
62
+ var module = window.require.modules[id];
63
+ if (module) {
64
+ if (!module.initialized) {
65
+ module.initialized = true;
66
+ module.exports = module.factory().exports;
67
+ }
68
+ return module.exports;
69
+ }
70
+
71
+ if (!window.require.tlns)
72
+ return console.log("unable to load " + id);
73
+
74
+ var path = resolveModuleId(id, window.require.tlns);
75
+ if (path.slice(-3) != ".js") path += ".js";
76
+
77
+ window.require.id = id;
78
+ window.require.modules[id] = {}; // prevent infinite loop on broken modules
79
+ importScripts(path);
80
+ return window.require(parentId, id);
81
+ };
82
+ function resolveModuleId(id, paths) {
83
+ var testPath = id, tail = "";
84
+ while (testPath) {
85
+ var alias = paths[testPath];
86
+ if (typeof alias == "string") {
87
+ return alias + tail;
88
+ } else if (alias) {
89
+ return alias.location.replace(/\/*$/, "/") + (tail || alias.main || alias.name);
90
+ } else if (alias === false) {
91
+ return "";
92
+ }
93
+ var i = testPath.lastIndexOf("/");
94
+ if (i === -1) break;
95
+ tail = testPath.substr(i) + tail;
96
+ testPath = testPath.slice(0, i);
97
+ }
98
+ return id;
99
+ }
100
+ window.require.modules = {};
101
+ window.require.tlns = {};
102
+
103
+ window.define = function(id, deps, factory) {
104
+ if (arguments.length == 2) {
105
+ factory = deps;
106
+ if (typeof id != "string") {
107
+ deps = id;
108
+ id = window.require.id;
109
+ }
110
+ } else if (arguments.length == 1) {
111
+ factory = id;
112
+ deps = [];
113
+ id = window.require.id;
114
+ }
115
+
116
+ if (typeof factory != "function") {
117
+ window.require.modules[id] = {
118
+ exports: factory,
119
+ initialized: true
120
+ };
121
+ return;
122
+ }
123
+
124
+ if (!deps.length)
125
+ // If there is no dependencies, we inject "require", "exports" and
126
+ // "module" as dependencies, to provide CommonJS compatibility.
127
+ deps = ["require", "exports", "module"];
128
+
129
+ var req = function(childId) {
130
+ return window.require(id, childId);
131
+ };
132
+
133
+ window.require.modules[id] = {
134
+ exports: {},
135
+ factory: function() {
136
+ var module = this;
137
+ var returnExports = factory.apply(this, deps.slice(0, factory.length).map(function(dep) {
138
+ switch (dep) {
139
+ // Because "require", "exports" and "module" aren't actual
140
+ // dependencies, we must handle them seperately.
141
+ case "require": return req;
142
+ case "exports": return module.exports;
143
+ case "module": return module;
144
+ // But for all other dependencies, we can just go ahead and
145
+ // require them.
146
+ default: return req(dep);
147
+ }
148
+ }));
149
+ if (returnExports)
150
+ module.exports = returnExports;
151
+ return module;
152
+ }
153
+ };
154
+ };
155
+ window.define.amd = {};
156
+ window.require.tlns = {};
157
+ window.initBaseUrls = function initBaseUrls(topLevelNamespaces) {
158
+ for (var i in topLevelNamespaces)
159
+ this.require.tlns[i] = topLevelNamespaces[i];
160
+ };
161
+
162
+ window.initSender = function initSender() {
163
+
164
+ var EventEmitter = window.require("ace/lib/event_emitter").EventEmitter;
165
+ var oop = window.require("ace/lib/oop");
166
+
167
+ var Sender = function() {};
168
+
169
+ (function() {
170
+
171
+ oop.implement(this, EventEmitter);
172
+
173
+ this.callback = function(data, callbackId) {
174
+ postMessage({
175
+ type: "call",
176
+ id: callbackId,
177
+ data: data
178
+ });
179
+ };
180
+
181
+ this.emit = function(name, data) {
182
+ postMessage({
183
+ type: "event",
184
+ name: name,
185
+ data: data
186
+ });
187
+ };
188
+
189
+ }).call(Sender.prototype);
190
+
191
+ return new Sender();
192
+ };
193
+
194
+ var main = window.main = null;
195
+ var sender = window.sender = null;
196
+
197
+ window.onmessage = function(e) {
198
+ var msg = e.data;
199
+ if (msg.event && sender) {
200
+ sender._signal(msg.event, msg.data);
201
+ }
202
+ else if (msg.command) {
203
+ if (main[msg.command])
204
+ main[msg.command].apply(main, msg.args);
205
+ else if (window[msg.command])
206
+ window[msg.command].apply(window, msg.args);
207
+ else
208
+ throw new Error("Unknown command:" + msg.command);
209
+ }
210
+ else if (msg.init) {
211
+ window.initBaseUrls(msg.tlns);
212
+ sender = window.sender = window.initSender();
213
+ var clazz = this.require(msg.module)[msg.classname];
214
+ main = window.main = new clazz(sender);
215
+ }
216
+ };
217
+ })(this);
218
+
219
+ ace.define("ace/lib/oop",[], function(require, exports, module){"use strict";
220
+ exports.inherits = function (ctor, superCtor) {
221
+ ctor.super_ = superCtor;
222
+ ctor.prototype = Object.create(superCtor.prototype, {
223
+ constructor: {
224
+ value: ctor,
225
+ enumerable: false,
226
+ writable: true,
227
+ configurable: true
228
+ }
229
+ });
230
+ };
231
+ exports.mixin = function (obj, mixin) {
232
+ for (var key in mixin) {
233
+ obj[key] = mixin[key];
234
+ }
235
+ return obj;
236
+ };
237
+ exports.implement = function (proto, mixin) {
238
+ exports.mixin(proto, mixin);
239
+ };
240
+
241
+ });
242
+
243
+ ace.define("ace/apply_delta",[], function(require, exports, module){"use strict";
244
+ function throwDeltaError(delta, errorText) {
245
+ console.log("Invalid Delta:", delta);
246
+ throw "Invalid Delta: " + errorText;
247
+ }
248
+ function positionInDocument(docLines, position) {
249
+ return position.row >= 0 && position.row < docLines.length &&
250
+ position.column >= 0 && position.column <= docLines[position.row].length;
251
+ }
252
+ function validateDelta(docLines, delta) {
253
+ if (delta.action != "insert" && delta.action != "remove")
254
+ throwDeltaError(delta, "delta.action must be 'insert' or 'remove'");
255
+ if (!(delta.lines instanceof Array))
256
+ throwDeltaError(delta, "delta.lines must be an Array");
257
+ if (!delta.start || !delta.end)
258
+ throwDeltaError(delta, "delta.start/end must be an present");
259
+ var start = delta.start;
260
+ if (!positionInDocument(docLines, delta.start))
261
+ throwDeltaError(delta, "delta.start must be contained in document");
262
+ var end = delta.end;
263
+ if (delta.action == "remove" && !positionInDocument(docLines, end))
264
+ throwDeltaError(delta, "delta.end must contained in document for 'remove' actions");
265
+ var numRangeRows = end.row - start.row;
266
+ var numRangeLastLineChars = (end.column - (numRangeRows == 0 ? start.column : 0));
267
+ if (numRangeRows != delta.lines.length - 1 || delta.lines[numRangeRows].length != numRangeLastLineChars)
268
+ throwDeltaError(delta, "delta.range must match delta lines");
269
+ }
270
+ exports.applyDelta = function (docLines, delta, doNotValidate) {
271
+ var row = delta.start.row;
272
+ var startColumn = delta.start.column;
273
+ var line = docLines[row] || "";
274
+ switch (delta.action) {
275
+ case "insert":
276
+ var lines = delta.lines;
277
+ if (lines.length === 1) {
278
+ docLines[row] = line.substring(0, startColumn) + delta.lines[0] + line.substring(startColumn);
279
+ }
280
+ else {
281
+ var args = [row, 1].concat(delta.lines);
282
+ docLines.splice.apply(docLines, args);
283
+ docLines[row] = line.substring(0, startColumn) + docLines[row];
284
+ docLines[row + delta.lines.length - 1] += line.substring(startColumn);
285
+ }
286
+ break;
287
+ case "remove":
288
+ var endColumn = delta.end.column;
289
+ var endRow = delta.end.row;
290
+ if (row === endRow) {
291
+ docLines[row] = line.substring(0, startColumn) + line.substring(endColumn);
292
+ }
293
+ else {
294
+ docLines.splice(row, endRow - row + 1, line.substring(0, startColumn) + docLines[endRow].substring(endColumn));
295
+ }
296
+ break;
297
+ }
298
+ };
299
+
300
+ });
301
+
302
+ ace.define("ace/lib/event_emitter",[], function(require, exports, module){"use strict";
303
+ var EventEmitter = {};
304
+ var stopPropagation = function () { this.propagationStopped = true; };
305
+ var preventDefault = function () { this.defaultPrevented = true; };
306
+ EventEmitter._emit =
307
+ EventEmitter._dispatchEvent = function (eventName, e) {
308
+ this._eventRegistry || (this._eventRegistry = {});
309
+ this._defaultHandlers || (this._defaultHandlers = {});
310
+ var listeners = this._eventRegistry[eventName] || [];
311
+ var defaultHandler = this._defaultHandlers[eventName];
312
+ if (!listeners.length && !defaultHandler)
313
+ return;
314
+ if (typeof e != "object" || !e)
315
+ e = {};
316
+ if (!e.type)
317
+ e.type = eventName;
318
+ if (!e.stopPropagation)
319
+ e.stopPropagation = stopPropagation;
320
+ if (!e.preventDefault)
321
+ e.preventDefault = preventDefault;
322
+ listeners = listeners.slice();
323
+ for (var i = 0; i < listeners.length; i++) {
324
+ listeners[i](e, this);
325
+ if (e.propagationStopped)
326
+ break;
327
+ }
328
+ if (defaultHandler && !e.defaultPrevented)
329
+ return defaultHandler(e, this);
330
+ };
331
+ EventEmitter._signal = function (eventName, e) {
332
+ var listeners = (this._eventRegistry || {})[eventName];
333
+ if (!listeners)
334
+ return;
335
+ listeners = listeners.slice();
336
+ for (var i = 0; i < listeners.length; i++)
337
+ listeners[i](e, this);
338
+ };
339
+ EventEmitter.once = function (eventName, callback) {
340
+ var _self = this;
341
+ this.on(eventName, function newCallback() {
342
+ _self.off(eventName, newCallback);
343
+ callback.apply(null, arguments);
344
+ });
345
+ if (!callback) {
346
+ return new Promise(function (resolve) {
347
+ callback = resolve;
348
+ });
349
+ }
350
+ };
351
+ EventEmitter.setDefaultHandler = function (eventName, callback) {
352
+ var handlers = this._defaultHandlers;
353
+ if (!handlers)
354
+ handlers = this._defaultHandlers = { _disabled_: {} };
355
+ if (handlers[eventName]) {
356
+ var old = handlers[eventName];
357
+ var disabled = handlers._disabled_[eventName];
358
+ if (!disabled)
359
+ handlers._disabled_[eventName] = disabled = [];
360
+ disabled.push(old);
361
+ var i = disabled.indexOf(callback);
362
+ if (i != -1)
363
+ disabled.splice(i, 1);
364
+ }
365
+ handlers[eventName] = callback;
366
+ };
367
+ EventEmitter.removeDefaultHandler = function (eventName, callback) {
368
+ var handlers = this._defaultHandlers;
369
+ if (!handlers)
370
+ return;
371
+ var disabled = handlers._disabled_[eventName];
372
+ if (handlers[eventName] == callback) {
373
+ if (disabled)
374
+ this.setDefaultHandler(eventName, disabled.pop());
375
+ }
376
+ else if (disabled) {
377
+ var i = disabled.indexOf(callback);
378
+ if (i != -1)
379
+ disabled.splice(i, 1);
380
+ }
381
+ };
382
+ EventEmitter.on =
383
+ EventEmitter.addEventListener = function (eventName, callback, capturing) {
384
+ this._eventRegistry = this._eventRegistry || {};
385
+ var listeners = this._eventRegistry[eventName];
386
+ if (!listeners)
387
+ listeners = this._eventRegistry[eventName] = [];
388
+ if (listeners.indexOf(callback) == -1)
389
+ listeners[capturing ? "unshift" : "push"](callback);
390
+ return callback;
391
+ };
392
+ EventEmitter.off =
393
+ EventEmitter.removeListener =
394
+ EventEmitter.removeEventListener = function (eventName, callback) {
395
+ this._eventRegistry = this._eventRegistry || {};
396
+ var listeners = this._eventRegistry[eventName];
397
+ if (!listeners)
398
+ return;
399
+ var index = listeners.indexOf(callback);
400
+ if (index !== -1)
401
+ listeners.splice(index, 1);
402
+ };
403
+ EventEmitter.removeAllListeners = function (eventName) {
404
+ if (!eventName)
405
+ this._eventRegistry = this._defaultHandlers = undefined;
406
+ if (this._eventRegistry)
407
+ this._eventRegistry[eventName] = undefined;
408
+ if (this._defaultHandlers)
409
+ this._defaultHandlers[eventName] = undefined;
410
+ };
411
+ exports.EventEmitter = EventEmitter;
412
+
413
+ });
414
+
415
+ ace.define("ace/range",[], function(require, exports, module){"use strict";
416
+ var Range = /** @class */ (function () {
417
+ function Range(startRow, startColumn, endRow, endColumn) {
418
+ this.start = {
419
+ row: startRow,
420
+ column: startColumn
421
+ };
422
+ this.end = {
423
+ row: endRow,
424
+ column: endColumn
425
+ };
426
+ }
427
+ Range.prototype.isEqual = function (range) {
428
+ return this.start.row === range.start.row &&
429
+ this.end.row === range.end.row &&
430
+ this.start.column === range.start.column &&
431
+ this.end.column === range.end.column;
432
+ };
433
+ Range.prototype.toString = function () {
434
+ return ("Range: [" + this.start.row + "/" + this.start.column +
435
+ "] -> [" + this.end.row + "/" + this.end.column + "]");
436
+ };
437
+ Range.prototype.contains = function (row, column) {
438
+ return this.compare(row, column) == 0;
439
+ };
440
+ Range.prototype.compareRange = function (range) {
441
+ var cmp, end = range.end, start = range.start;
442
+ cmp = this.compare(end.row, end.column);
443
+ if (cmp == 1) {
444
+ cmp = this.compare(start.row, start.column);
445
+ if (cmp == 1) {
446
+ return 2;
447
+ }
448
+ else if (cmp == 0) {
449
+ return 1;
450
+ }
451
+ else {
452
+ return 0;
453
+ }
454
+ }
455
+ else if (cmp == -1) {
456
+ return -2;
457
+ }
458
+ else {
459
+ cmp = this.compare(start.row, start.column);
460
+ if (cmp == -1) {
461
+ return -1;
462
+ }
463
+ else if (cmp == 1) {
464
+ return 42;
465
+ }
466
+ else {
467
+ return 0;
468
+ }
469
+ }
470
+ };
471
+ Range.prototype.comparePoint = function (p) {
472
+ return this.compare(p.row, p.column);
473
+ };
474
+ Range.prototype.containsRange = function (range) {
475
+ return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0;
476
+ };
477
+ Range.prototype.intersects = function (range) {
478
+ var cmp = this.compareRange(range);
479
+ return (cmp == -1 || cmp == 0 || cmp == 1);
480
+ };
481
+ Range.prototype.isEnd = function (row, column) {
482
+ return this.end.row == row && this.end.column == column;
483
+ };
484
+ Range.prototype.isStart = function (row, column) {
485
+ return this.start.row == row && this.start.column == column;
486
+ };
487
+ Range.prototype.setStart = function (row, column) {
488
+ if (typeof row == "object") {
489
+ this.start.column = row.column;
490
+ this.start.row = row.row;
491
+ }
492
+ else {
493
+ this.start.row = row;
494
+ this.start.column = column;
495
+ }
496
+ };
497
+ Range.prototype.setEnd = function (row, column) {
498
+ if (typeof row == "object") {
499
+ this.end.column = row.column;
500
+ this.end.row = row.row;
501
+ }
502
+ else {
503
+ this.end.row = row;
504
+ this.end.column = column;
505
+ }
506
+ };
507
+ Range.prototype.inside = function (row, column) {
508
+ if (this.compare(row, column) == 0) {
509
+ if (this.isEnd(row, column) || this.isStart(row, column)) {
510
+ return false;
511
+ }
512
+ else {
513
+ return true;
514
+ }
515
+ }
516
+ return false;
517
+ };
518
+ Range.prototype.insideStart = function (row, column) {
519
+ if (this.compare(row, column) == 0) {
520
+ if (this.isEnd(row, column)) {
521
+ return false;
522
+ }
523
+ else {
524
+ return true;
525
+ }
526
+ }
527
+ return false;
528
+ };
529
+ Range.prototype.insideEnd = function (row, column) {
530
+ if (this.compare(row, column) == 0) {
531
+ if (this.isStart(row, column)) {
532
+ return false;
533
+ }
534
+ else {
535
+ return true;
536
+ }
537
+ }
538
+ return false;
539
+ };
540
+ Range.prototype.compare = function (row, column) {
541
+ if (!this.isMultiLine()) {
542
+ if (row === this.start.row) {
543
+ return column < this.start.column ? -1 : (column > this.end.column ? 1 : 0);
544
+ }
545
+ }
546
+ if (row < this.start.row)
547
+ return -1;
548
+ if (row > this.end.row)
549
+ return 1;
550
+ if (this.start.row === row)
551
+ return column >= this.start.column ? 0 : -1;
552
+ if (this.end.row === row)
553
+ return column <= this.end.column ? 0 : 1;
554
+ return 0;
555
+ };
556
+ Range.prototype.compareStart = function (row, column) {
557
+ if (this.start.row == row && this.start.column == column) {
558
+ return -1;
559
+ }
560
+ else {
561
+ return this.compare(row, column);
562
+ }
563
+ };
564
+ Range.prototype.compareEnd = function (row, column) {
565
+ if (this.end.row == row && this.end.column == column) {
566
+ return 1;
567
+ }
568
+ else {
569
+ return this.compare(row, column);
570
+ }
571
+ };
572
+ Range.prototype.compareInside = function (row, column) {
573
+ if (this.end.row == row && this.end.column == column) {
574
+ return 1;
575
+ }
576
+ else if (this.start.row == row && this.start.column == column) {
577
+ return -1;
578
+ }
579
+ else {
580
+ return this.compare(row, column);
581
+ }
582
+ };
583
+ Range.prototype.clipRows = function (firstRow, lastRow) {
584
+ if (this.end.row > lastRow)
585
+ var end = { row: lastRow + 1, column: 0 };
586
+ else if (this.end.row < firstRow)
587
+ var end = { row: firstRow, column: 0 };
588
+ if (this.start.row > lastRow)
589
+ var start = { row: lastRow + 1, column: 0 };
590
+ else if (this.start.row < firstRow)
591
+ var start = { row: firstRow, column: 0 };
592
+ return Range.fromPoints(start || this.start, end || this.end);
593
+ };
594
+ Range.prototype.extend = function (row, column) {
595
+ var cmp = this.compare(row, column);
596
+ if (cmp == 0)
597
+ return this;
598
+ else if (cmp == -1)
599
+ var start = { row: row, column: column };
600
+ else
601
+ var end = { row: row, column: column };
602
+ return Range.fromPoints(start || this.start, end || this.end);
603
+ };
604
+ Range.prototype.isEmpty = function () {
605
+ return (this.start.row === this.end.row && this.start.column === this.end.column);
606
+ };
607
+ Range.prototype.isMultiLine = function () {
608
+ return (this.start.row !== this.end.row);
609
+ };
610
+ Range.prototype.clone = function () {
611
+ return Range.fromPoints(this.start, this.end);
612
+ };
613
+ Range.prototype.collapseRows = function () {
614
+ if (this.end.column == 0)
615
+ return new Range(this.start.row, 0, Math.max(this.start.row, this.end.row - 1), 0);
616
+ else
617
+ return new Range(this.start.row, 0, this.end.row, 0);
618
+ };
619
+ Range.prototype.toScreenRange = function (session) {
620
+ var screenPosStart = session.documentToScreenPosition(this.start);
621
+ var screenPosEnd = session.documentToScreenPosition(this.end);
622
+ return new Range(screenPosStart.row, screenPosStart.column, screenPosEnd.row, screenPosEnd.column);
623
+ };
624
+ Range.prototype.moveBy = function (row, column) {
625
+ this.start.row += row;
626
+ this.start.column += column;
627
+ this.end.row += row;
628
+ this.end.column += column;
629
+ };
630
+ return Range;
631
+ }());
632
+ Range.fromPoints = function (start, end) {
633
+ return new Range(start.row, start.column, end.row, end.column);
634
+ };
635
+ Range.comparePoints = function (p1, p2) {
636
+ return p1.row - p2.row || p1.column - p2.column;
637
+ };
638
+ exports.Range = Range;
639
+
640
+ });
641
+
642
+ ace.define("ace/anchor",[], function(require, exports, module){"use strict";
643
+ var oop = require("./lib/oop");
644
+ var EventEmitter = require("./lib/event_emitter").EventEmitter;
645
+ var Anchor = /** @class */ (function () {
646
+ function Anchor(doc, row, column) {
647
+ this.$onChange = this.onChange.bind(this);
648
+ this.attach(doc);
649
+ if (typeof row != "number")
650
+ this.setPosition(row.row, row.column);
651
+ else
652
+ this.setPosition(row, column);
653
+ }
654
+ Anchor.prototype.getPosition = function () {
655
+ return this.$clipPositionToDocument(this.row, this.column);
656
+ };
657
+ Anchor.prototype.getDocument = function () {
658
+ return this.document;
659
+ };
660
+ Anchor.prototype.onChange = function (delta) {
661
+ if (delta.start.row == delta.end.row && delta.start.row != this.row)
662
+ return;
663
+ if (delta.start.row > this.row)
664
+ return;
665
+ var point = $getTransformedPoint(delta, { row: this.row, column: this.column }, this.$insertRight);
666
+ this.setPosition(point.row, point.column, true);
667
+ };
668
+ Anchor.prototype.setPosition = function (row, column, noClip) {
669
+ var pos;
670
+ if (noClip) {
671
+ pos = {
672
+ row: row,
673
+ column: column
674
+ };
675
+ }
676
+ else {
677
+ pos = this.$clipPositionToDocument(row, column);
678
+ }
679
+ if (this.row == pos.row && this.column == pos.column)
680
+ return;
681
+ var old = {
682
+ row: this.row,
683
+ column: this.column
684
+ };
685
+ this.row = pos.row;
686
+ this.column = pos.column;
687
+ this._signal("change", {
688
+ old: old,
689
+ value: pos
690
+ });
691
+ };
692
+ Anchor.prototype.detach = function () {
693
+ this.document.off("change", this.$onChange);
694
+ };
695
+ Anchor.prototype.attach = function (doc) {
696
+ this.document = doc || this.document;
697
+ this.document.on("change", this.$onChange);
698
+ };
699
+ Anchor.prototype.$clipPositionToDocument = function (row, column) {
700
+ var pos = {};
701
+ if (row >= this.document.getLength()) {
702
+ pos.row = Math.max(0, this.document.getLength() - 1);
703
+ pos.column = this.document.getLine(pos.row).length;
704
+ }
705
+ else if (row < 0) {
706
+ pos.row = 0;
707
+ pos.column = 0;
708
+ }
709
+ else {
710
+ pos.row = row;
711
+ pos.column = Math.min(this.document.getLine(pos.row).length, Math.max(0, column));
712
+ }
713
+ if (column < 0)
714
+ pos.column = 0;
715
+ return pos;
716
+ };
717
+ return Anchor;
718
+ }());
719
+ Anchor.prototype.$insertRight = false;
720
+ oop.implement(Anchor.prototype, EventEmitter);
721
+ function $pointsInOrder(point1, point2, equalPointsInOrder) {
722
+ var bColIsAfter = equalPointsInOrder ? point1.column <= point2.column : point1.column < point2.column;
723
+ return (point1.row < point2.row) || (point1.row == point2.row && bColIsAfter);
724
+ }
725
+ function $getTransformedPoint(delta, point, moveIfEqual) {
726
+ var deltaIsInsert = delta.action == "insert";
727
+ var deltaRowShift = (deltaIsInsert ? 1 : -1) * (delta.end.row - delta.start.row);
728
+ var deltaColShift = (deltaIsInsert ? 1 : -1) * (delta.end.column - delta.start.column);
729
+ var deltaStart = delta.start;
730
+ var deltaEnd = deltaIsInsert ? deltaStart : delta.end; // Collapse insert range.
731
+ if ($pointsInOrder(point, deltaStart, moveIfEqual)) {
732
+ return {
733
+ row: point.row,
734
+ column: point.column
735
+ };
736
+ }
737
+ if ($pointsInOrder(deltaEnd, point, !moveIfEqual)) {
738
+ return {
739
+ row: point.row + deltaRowShift,
740
+ column: point.column + (point.row == deltaEnd.row ? deltaColShift : 0)
741
+ };
742
+ }
743
+ return {
744
+ row: deltaStart.row,
745
+ column: deltaStart.column
746
+ };
747
+ }
748
+ exports.Anchor = Anchor;
749
+
750
+ });
751
+
752
+ ace.define("ace/document",[], function(require, exports, module){"use strict";
753
+ var oop = require("./lib/oop");
754
+ var applyDelta = require("./apply_delta").applyDelta;
755
+ var EventEmitter = require("./lib/event_emitter").EventEmitter;
756
+ var Range = require("./range").Range;
757
+ var Anchor = require("./anchor").Anchor;
758
+ var Document = /** @class */ (function () {
759
+ function Document(textOrLines) {
760
+ this.$lines = [""];
761
+ if (textOrLines.length === 0) {
762
+ this.$lines = [""];
763
+ }
764
+ else if (Array.isArray(textOrLines)) {
765
+ this.insertMergedLines({ row: 0, column: 0 }, textOrLines);
766
+ }
767
+ else {
768
+ this.insert({ row: 0, column: 0 }, textOrLines);
769
+ }
770
+ }
771
+ Document.prototype.setValue = function (text) {
772
+ var len = this.getLength() - 1;
773
+ this.remove(new Range(0, 0, len, this.getLine(len).length));
774
+ this.insert({ row: 0, column: 0 }, text || "");
775
+ };
776
+ Document.prototype.getValue = function () {
777
+ return this.getAllLines().join(this.getNewLineCharacter());
778
+ };
779
+ Document.prototype.createAnchor = function (row, column) {
780
+ return new Anchor(this, row, column);
781
+ };
782
+ Document.prototype.$detectNewLine = function (text) {
783
+ var match = text.match(/^.*?(\r\n|\r|\n)/m);
784
+ this.$autoNewLine = match ? match[1] : "\n";
785
+ this._signal("changeNewLineMode");
786
+ };
787
+ Document.prototype.getNewLineCharacter = function () {
788
+ switch (this.$newLineMode) {
789
+ case "windows":
790
+ return "\r\n";
791
+ case "unix":
792
+ return "\n";
793
+ default:
794
+ return this.$autoNewLine || "\n";
795
+ }
796
+ };
797
+ Document.prototype.setNewLineMode = function (newLineMode) {
798
+ if (this.$newLineMode === newLineMode)
799
+ return;
800
+ this.$newLineMode = newLineMode;
801
+ this._signal("changeNewLineMode");
802
+ };
803
+ Document.prototype.getNewLineMode = function () {
804
+ return this.$newLineMode;
805
+ };
806
+ Document.prototype.isNewLine = function (text) {
807
+ return (text == "\r\n" || text == "\r" || text == "\n");
808
+ };
809
+ Document.prototype.getLine = function (row) {
810
+ return this.$lines[row] || "";
811
+ };
812
+ Document.prototype.getLines = function (firstRow, lastRow) {
813
+ return this.$lines.slice(firstRow, lastRow + 1);
814
+ };
815
+ Document.prototype.getAllLines = function () {
816
+ return this.getLines(0, this.getLength());
817
+ };
818
+ Document.prototype.getLength = function () {
819
+ return this.$lines.length;
820
+ };
821
+ Document.prototype.getTextRange = function (range) {
822
+ return this.getLinesForRange(range).join(this.getNewLineCharacter());
823
+ };
824
+ Document.prototype.getLinesForRange = function (range) {
825
+ var lines;
826
+ if (range.start.row === range.end.row) {
827
+ lines = [this.getLine(range.start.row).substring(range.start.column, range.end.column)];
828
+ }
829
+ else {
830
+ lines = this.getLines(range.start.row, range.end.row);
831
+ lines[0] = (lines[0] || "").substring(range.start.column);
832
+ var l = lines.length - 1;
833
+ if (range.end.row - range.start.row == l)
834
+ lines[l] = lines[l].substring(0, range.end.column);
835
+ }
836
+ return lines;
837
+ };
838
+ Document.prototype.insertLines = function (row, lines) {
839
+ console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead.");
840
+ return this.insertFullLines(row, lines);
841
+ };
842
+ Document.prototype.removeLines = function (firstRow, lastRow) {
843
+ console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead.");
844
+ return this.removeFullLines(firstRow, lastRow);
845
+ };
846
+ Document.prototype.insertNewLine = function (position) {
847
+ console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead.");
848
+ return this.insertMergedLines(position, ["", ""]);
849
+ };
850
+ Document.prototype.insert = function (position, text) {
851
+ if (this.getLength() <= 1)
852
+ this.$detectNewLine(text);
853
+ return this.insertMergedLines(position, this.$split(text));
854
+ };
855
+ Document.prototype.insertInLine = function (position, text) {
856
+ var start = this.clippedPos(position.row, position.column);
857
+ var end = this.pos(position.row, position.column + text.length);
858
+ this.applyDelta({
859
+ start: start,
860
+ end: end,
861
+ action: "insert",
862
+ lines: [text]
863
+ }, true);
864
+ return this.clonePos(end);
865
+ };
866
+ Document.prototype.clippedPos = function (row, column) {
867
+ var length = this.getLength();
868
+ if (row === undefined) {
869
+ row = length;
870
+ }
871
+ else if (row < 0) {
872
+ row = 0;
873
+ }
874
+ else if (row >= length) {
875
+ row = length - 1;
876
+ column = undefined;
877
+ }
878
+ var line = this.getLine(row);
879
+ if (column == undefined)
880
+ column = line.length;
881
+ column = Math.min(Math.max(column, 0), line.length);
882
+ return { row: row, column: column };
883
+ };
884
+ Document.prototype.clonePos = function (pos) {
885
+ return { row: pos.row, column: pos.column };
886
+ };
887
+ Document.prototype.pos = function (row, column) {
888
+ return { row: row, column: column };
889
+ };
890
+ Document.prototype.$clipPosition = function (position) {
891
+ var length = this.getLength();
892
+ if (position.row >= length) {
893
+ position.row = Math.max(0, length - 1);
894
+ position.column = this.getLine(length - 1).length;
895
+ }
896
+ else {
897
+ position.row = Math.max(0, position.row);
898
+ position.column = Math.min(Math.max(position.column, 0), this.getLine(position.row).length);
899
+ }
900
+ return position;
901
+ };
902
+ Document.prototype.insertFullLines = function (row, lines) {
903
+ row = Math.min(Math.max(row, 0), this.getLength());
904
+ var column = 0;
905
+ if (row < this.getLength()) {
906
+ lines = lines.concat([""]);
907
+ column = 0;
908
+ }
909
+ else {
910
+ lines = [""].concat(lines);
911
+ row--;
912
+ column = this.$lines[row].length;
913
+ }
914
+ this.insertMergedLines({ row: row, column: column }, lines);
915
+ };
916
+ Document.prototype.insertMergedLines = function (position, lines) {
917
+ var start = this.clippedPos(position.row, position.column);
918
+ var end = {
919
+ row: start.row + lines.length - 1,
920
+ column: (lines.length == 1 ? start.column : 0) + lines[lines.length - 1].length
921
+ };
922
+ this.applyDelta({
923
+ start: start,
924
+ end: end,
925
+ action: "insert",
926
+ lines: lines
927
+ });
928
+ return this.clonePos(end);
929
+ };
930
+ Document.prototype.remove = function (range) {
931
+ var start = this.clippedPos(range.start.row, range.start.column);
932
+ var end = this.clippedPos(range.end.row, range.end.column);
933
+ this.applyDelta({
934
+ start: start,
935
+ end: end,
936
+ action: "remove",
937
+ lines: this.getLinesForRange({ start: start, end: end })
938
+ });
939
+ return this.clonePos(start);
940
+ };
941
+ Document.prototype.removeInLine = function (row, startColumn, endColumn) {
942
+ var start = this.clippedPos(row, startColumn);
943
+ var end = this.clippedPos(row, endColumn);
944
+ this.applyDelta({
945
+ start: start,
946
+ end: end,
947
+ action: "remove",
948
+ lines: this.getLinesForRange({ start: start, end: end })
949
+ }, true);
950
+ return this.clonePos(start);
951
+ };
952
+ Document.prototype.removeFullLines = function (firstRow, lastRow) {
953
+ firstRow = Math.min(Math.max(0, firstRow), this.getLength() - 1);
954
+ lastRow = Math.min(Math.max(0, lastRow), this.getLength() - 1);
955
+ var deleteFirstNewLine = lastRow == this.getLength() - 1 && firstRow > 0;
956
+ var deleteLastNewLine = lastRow < this.getLength() - 1;
957
+ var startRow = (deleteFirstNewLine ? firstRow - 1 : firstRow);
958
+ var startCol = (deleteFirstNewLine ? this.getLine(startRow).length : 0);
959
+ var endRow = (deleteLastNewLine ? lastRow + 1 : lastRow);
960
+ var endCol = (deleteLastNewLine ? 0 : this.getLine(endRow).length);
961
+ var range = new Range(startRow, startCol, endRow, endCol);
962
+ var deletedLines = this.$lines.slice(firstRow, lastRow + 1);
963
+ this.applyDelta({
964
+ start: range.start,
965
+ end: range.end,
966
+ action: "remove",
967
+ lines: this.getLinesForRange(range)
968
+ });
969
+ return deletedLines;
970
+ };
971
+ Document.prototype.removeNewLine = function (row) {
972
+ if (row < this.getLength() - 1 && row >= 0) {
973
+ this.applyDelta({
974
+ start: this.pos(row, this.getLine(row).length),
975
+ end: this.pos(row + 1, 0),
976
+ action: "remove",
977
+ lines: ["", ""]
978
+ });
979
+ }
980
+ };
981
+ Document.prototype.replace = function (range, text) {
982
+ if (!(range instanceof Range))
983
+ range = Range.fromPoints(range.start, range.end);
984
+ if (text.length === 0 && range.isEmpty())
985
+ return range.start;
986
+ if (text == this.getTextRange(range))
987
+ return range.end;
988
+ this.remove(range);
989
+ var end;
990
+ if (text) {
991
+ end = this.insert(range.start, text);
992
+ }
993
+ else {
994
+ end = range.start;
995
+ }
996
+ return end;
997
+ };
998
+ Document.prototype.applyDeltas = function (deltas) {
999
+ for (var i = 0; i < deltas.length; i++) {
1000
+ this.applyDelta(deltas[i]);
1001
+ }
1002
+ };
1003
+ Document.prototype.revertDeltas = function (deltas) {
1004
+ for (var i = deltas.length - 1; i >= 0; i--) {
1005
+ this.revertDelta(deltas[i]);
1006
+ }
1007
+ };
1008
+ Document.prototype.applyDelta = function (delta, doNotValidate) {
1009
+ var isInsert = delta.action == "insert";
1010
+ if (isInsert ? delta.lines.length <= 1 && !delta.lines[0]
1011
+ : !Range.comparePoints(delta.start, delta.end)) {
1012
+ return;
1013
+ }
1014
+ if (isInsert && delta.lines.length > 20000) {
1015
+ this.$splitAndapplyLargeDelta(delta, 20000);
1016
+ }
1017
+ else {
1018
+ applyDelta(this.$lines, delta, doNotValidate);
1019
+ this._signal("change", delta);
1020
+ }
1021
+ };
1022
+ Document.prototype.$safeApplyDelta = function (delta) {
1023
+ var docLength = this.$lines.length;
1024
+ if (delta.action == "remove" && delta.start.row < docLength && delta.end.row < docLength
1025
+ || delta.action == "insert" && delta.start.row <= docLength) {
1026
+ this.applyDelta(delta);
1027
+ }
1028
+ };
1029
+ Document.prototype.$splitAndapplyLargeDelta = function (delta, MAX) {
1030
+ var lines = delta.lines;
1031
+ var l = lines.length - MAX + 1;
1032
+ var row = delta.start.row;
1033
+ var column = delta.start.column;
1034
+ for (var from = 0, to = 0; from < l; from = to) {
1035
+ to += MAX - 1;
1036
+ var chunk = lines.slice(from, to);
1037
+ chunk.push("");
1038
+ this.applyDelta({
1039
+ start: this.pos(row + from, column),
1040
+ end: this.pos(row + to, column = 0),
1041
+ action: delta.action,
1042
+ lines: chunk
1043
+ }, true);
1044
+ }
1045
+ delta.lines = lines.slice(from);
1046
+ delta.start.row = row + from;
1047
+ delta.start.column = column;
1048
+ this.applyDelta(delta, true);
1049
+ };
1050
+ Document.prototype.revertDelta = function (delta) {
1051
+ this.$safeApplyDelta({
1052
+ start: this.clonePos(delta.start),
1053
+ end: this.clonePos(delta.end),
1054
+ action: (delta.action == "insert" ? "remove" : "insert"),
1055
+ lines: delta.lines.slice()
1056
+ });
1057
+ };
1058
+ Document.prototype.indexToPosition = function (index, startRow) {
1059
+ var lines = this.$lines || this.getAllLines();
1060
+ var newlineLength = this.getNewLineCharacter().length;
1061
+ for (var i = startRow || 0, l = lines.length; i < l; i++) {
1062
+ index -= lines[i].length + newlineLength;
1063
+ if (index < 0)
1064
+ return { row: i, column: index + lines[i].length + newlineLength };
1065
+ }
1066
+ return { row: l - 1, column: index + lines[l - 1].length + newlineLength };
1067
+ };
1068
+ Document.prototype.positionToIndex = function (pos, startRow) {
1069
+ var lines = this.$lines || this.getAllLines();
1070
+ var newlineLength = this.getNewLineCharacter().length;
1071
+ var index = 0;
1072
+ var row = Math.min(pos.row, lines.length);
1073
+ for (var i = startRow || 0; i < row; ++i)
1074
+ index += lines[i].length + newlineLength;
1075
+ return index + pos.column;
1076
+ };
1077
+ Document.prototype.$split = function (text) {
1078
+ return text.split(/\r\n|\r|\n/);
1079
+ };
1080
+ return Document;
1081
+ }());
1082
+ Document.prototype.$autoNewLine = "";
1083
+ Document.prototype.$newLineMode = "auto";
1084
+ oop.implement(Document.prototype, EventEmitter);
1085
+ exports.Document = Document;
1086
+
1087
+ });
1088
+
1089
+ ace.define("ace/lib/deep_copy",[], function(require, exports, module){exports.deepCopy = function deepCopy(obj) {
1090
+ if (typeof obj !== "object" || !obj)
1091
+ return obj;
1092
+ var copy;
1093
+ if (Array.isArray(obj)) {
1094
+ copy = [];
1095
+ for (var key = 0; key < obj.length; key++) {
1096
+ copy[key] = deepCopy(obj[key]);
1097
+ }
1098
+ return copy;
1099
+ }
1100
+ if (Object.prototype.toString.call(obj) !== "[object Object]")
1101
+ return obj;
1102
+ copy = {};
1103
+ for (var key in obj)
1104
+ copy[key] = deepCopy(obj[key]);
1105
+ return copy;
1106
+ };
1107
+
1108
+ });
1109
+
1110
+ ace.define("ace/lib/lang",[], function(require, exports, module){"use strict";
1111
+ exports.last = function (a) {
1112
+ return a[a.length - 1];
1113
+ };
1114
+ exports.stringReverse = function (string) {
1115
+ return string.split("").reverse().join("");
1116
+ };
1117
+ exports.stringRepeat = function (string, count) {
1118
+ var result = '';
1119
+ while (count > 0) {
1120
+ if (count & 1)
1121
+ result += string;
1122
+ if (count >>= 1)
1123
+ string += string;
1124
+ }
1125
+ return result;
1126
+ };
1127
+ var trimBeginRegexp = /^\s\s*/;
1128
+ var trimEndRegexp = /\s\s*$/;
1129
+ exports.stringTrimLeft = function (string) {
1130
+ return string.replace(trimBeginRegexp, '');
1131
+ };
1132
+ exports.stringTrimRight = function (string) {
1133
+ return string.replace(trimEndRegexp, '');
1134
+ };
1135
+ exports.copyObject = function (obj) {
1136
+ var copy = {};
1137
+ for (var key in obj) {
1138
+ copy[key] = obj[key];
1139
+ }
1140
+ return copy;
1141
+ };
1142
+ exports.copyArray = function (array) {
1143
+ var copy = [];
1144
+ for (var i = 0, l = array.length; i < l; i++) {
1145
+ if (array[i] && typeof array[i] == "object")
1146
+ copy[i] = this.copyObject(array[i]);
1147
+ else
1148
+ copy[i] = array[i];
1149
+ }
1150
+ return copy;
1151
+ };
1152
+ exports.deepCopy = require("./deep_copy").deepCopy;
1153
+ exports.arrayToMap = function (arr) {
1154
+ var map = {};
1155
+ for (var i = 0; i < arr.length; i++) {
1156
+ map[arr[i]] = 1;
1157
+ }
1158
+ return map;
1159
+ };
1160
+ exports.createMap = function (props) {
1161
+ var map = Object.create(null);
1162
+ for (var i in props) {
1163
+ map[i] = props[i];
1164
+ }
1165
+ return map;
1166
+ };
1167
+ exports.arrayRemove = function (array, value) {
1168
+ for (var i = 0; i <= array.length; i++) {
1169
+ if (value === array[i]) {
1170
+ array.splice(i, 1);
1171
+ }
1172
+ }
1173
+ };
1174
+ exports.escapeRegExp = function (str) {
1175
+ return str.replace(/([.*+?^${}()|[\]\/\\])/g, '\\$1');
1176
+ };
1177
+ exports.escapeHTML = function (str) {
1178
+ return ("" + str).replace(/&/g, "&#38;").replace(/"/g, "&#34;").replace(/'/g, "&#39;").replace(/</g, "&#60;");
1179
+ };
1180
+ exports.getMatchOffsets = function (string, regExp) {
1181
+ var matches = [];
1182
+ string.replace(regExp, function (str) {
1183
+ matches.push({
1184
+ offset: arguments[arguments.length - 2],
1185
+ length: str.length
1186
+ });
1187
+ });
1188
+ return matches;
1189
+ };
1190
+ exports.deferredCall = function (fcn) {
1191
+ var timer = null;
1192
+ var callback = function () {
1193
+ timer = null;
1194
+ fcn();
1195
+ };
1196
+ var deferred = function (timeout) {
1197
+ deferred.cancel();
1198
+ timer = setTimeout(callback, timeout || 0);
1199
+ return deferred;
1200
+ };
1201
+ deferred.schedule = deferred;
1202
+ deferred.call = function () {
1203
+ this.cancel();
1204
+ fcn();
1205
+ return deferred;
1206
+ };
1207
+ deferred.cancel = function () {
1208
+ clearTimeout(timer);
1209
+ timer = null;
1210
+ return deferred;
1211
+ };
1212
+ deferred.isPending = function () {
1213
+ return timer;
1214
+ };
1215
+ return deferred;
1216
+ };
1217
+ exports.delayedCall = function (fcn, defaultTimeout) {
1218
+ var timer = null;
1219
+ var callback = function () {
1220
+ timer = null;
1221
+ fcn();
1222
+ };
1223
+ var _self = function (timeout) {
1224
+ if (timer == null)
1225
+ timer = setTimeout(callback, timeout || defaultTimeout);
1226
+ };
1227
+ _self.delay = function (timeout) {
1228
+ timer && clearTimeout(timer);
1229
+ timer = setTimeout(callback, timeout || defaultTimeout);
1230
+ };
1231
+ _self.schedule = _self;
1232
+ _self.call = function () {
1233
+ this.cancel();
1234
+ fcn();
1235
+ };
1236
+ _self.cancel = function () {
1237
+ timer && clearTimeout(timer);
1238
+ timer = null;
1239
+ };
1240
+ _self.isPending = function () {
1241
+ return timer;
1242
+ };
1243
+ return _self;
1244
+ };
1245
+ exports.sleep = function (ms) {
1246
+ return new Promise(function (resolve) {
1247
+ setTimeout(resolve, ms);
1248
+ });
1249
+ };
1250
+ exports.supportsLookbehind = function () {
1251
+ try {
1252
+ new RegExp('(?<=.)');
1253
+ }
1254
+ catch (e) {
1255
+ return false;
1256
+ }
1257
+ return true;
1258
+ };
1259
+ exports.skipEmptyMatch = function (line, last, supportsUnicodeFlag) {
1260
+ return supportsUnicodeFlag && line.codePointAt(last) > 0xffff ? 2 : 1;
1261
+ };
1262
+
1263
+ });
1264
+
1265
+ ace.define("ace/worker/mirror",[], function(require, exports, module) {
1266
+ "use strict";
1267
+
1268
+ var Document = require("../document").Document;
1269
+ var lang = require("../lib/lang");
1270
+
1271
+ var Mirror = exports.Mirror = function(sender) {
1272
+ this.sender = sender;
1273
+ var doc = this.doc = new Document("");
1274
+
1275
+ var deferredUpdate = this.deferredUpdate = lang.delayedCall(this.onUpdate.bind(this));
1276
+
1277
+ var _self = this;
1278
+ sender.on("change", function(e) {
1279
+ var data = e.data;
1280
+ if (data[0].start) {
1281
+ doc.applyDeltas(data);
1282
+ } else {
1283
+ for (var i = 0; i < data.length; i += 2) {
1284
+ var d, err;
1285
+ if (Array.isArray(data[i+1])) {
1286
+ d = {action: "insert", start: data[i], lines: data[i+1]};
1287
+ } else {
1288
+ d = {action: "remove", start: data[i], end: data[i+1]};
1289
+ }
1290
+
1291
+ if ((d.action == "insert" ? d.start : d.end).row >= doc.$lines.length) {
1292
+ err = new Error("Invalid delta");
1293
+ err.data = {
1294
+ path: _self.$path,
1295
+ linesLength: doc.$lines.length,
1296
+ start: d.start,
1297
+ end: d.end
1298
+ };
1299
+ throw err;
1300
+ }
1301
+
1302
+ doc.applyDelta(d, true);
1303
+ }
1304
+ }
1305
+ if (_self.$timeout)
1306
+ return deferredUpdate.schedule(_self.$timeout);
1307
+ _self.onUpdate();
1308
+ });
1309
+ };
1310
+
1311
+ (function() {
1312
+
1313
+ this.$timeout = 500;
1314
+
1315
+ this.setTimeout = function(timeout) {
1316
+ this.$timeout = timeout;
1317
+ };
1318
+
1319
+ this.setValue = function(value) {
1320
+ this.doc.setValue(value);
1321
+ this.deferredUpdate.schedule(this.$timeout);
1322
+ };
1323
+
1324
+ this.getValue = function(callbackId) {
1325
+ this.sender.callback(this.doc.getValue(), callbackId);
1326
+ };
1327
+
1328
+ this.onUpdate = function() {
1329
+ };
1330
+
1331
+ this.isPending = function() {
1332
+ return this.deferredUpdate.isPending();
1333
+ };
1334
+
1335
+ }).call(Mirror.prototype);
1336
+
1337
+ });
1338
+
1339
+ ace.define("ace/mode/lua/luaparse",[], function(require, exports, module) {
1340
+
1341
+ (function (root, name, factory) {
1342
+ factory(exports)
1343
+ }(this, 'luaparse', function (exports) {
1344
+ 'use strict';
1345
+
1346
+ exports.version = "0.3.1";
1347
+
1348
+ var input, options, length, features, encodingMode;
1349
+ var defaultOptions = exports.defaultOptions = {
1350
+ wait: false
1351
+ , comments: true
1352
+ , scope: false
1353
+ , locations: false
1354
+ , ranges: false
1355
+ , onCreateNode: null
1356
+ , onCreateScope: null
1357
+ , onDestroyScope: null
1358
+ , onLocalDeclaration: null
1359
+ , luaVersion: '5.3'
1360
+ , encodingMode: 'none'
1361
+ };
1362
+
1363
+ function encodeUTF8(codepoint, highMask) {
1364
+ highMask = highMask || 0;
1365
+
1366
+ if (codepoint < 0x80) {
1367
+ return String.fromCharCode(codepoint);
1368
+ } else if (codepoint < 0x800) {
1369
+ return String.fromCharCode(
1370
+ highMask | 0xc0 | (codepoint >> 6) ,
1371
+ highMask | 0x80 | ( codepoint & 0x3f)
1372
+ );
1373
+ } else if (codepoint < 0x10000) {
1374
+ return String.fromCharCode(
1375
+ highMask | 0xe0 | (codepoint >> 12) ,
1376
+ highMask | 0x80 | ((codepoint >> 6) & 0x3f),
1377
+ highMask | 0x80 | ( codepoint & 0x3f)
1378
+ );
1379
+ } else /* istanbul ignore else */ if (codepoint < 0x110000) {
1380
+ return String.fromCharCode(
1381
+ highMask | 0xf0 | (codepoint >> 18) ,
1382
+ highMask | 0x80 | ((codepoint >> 12) & 0x3f),
1383
+ highMask | 0x80 | ((codepoint >> 6) & 0x3f),
1384
+ highMask | 0x80 | ( codepoint & 0x3f)
1385
+ );
1386
+ } else {
1387
+ return null;
1388
+ }
1389
+ }
1390
+
1391
+ function toHex(num, digits) {
1392
+ var result = num.toString(16);
1393
+ while (result.length < digits)
1394
+ result = '0' + result;
1395
+ return result;
1396
+ }
1397
+
1398
+ function checkChars(rx) {
1399
+ return function (s) {
1400
+ var m = rx.exec(s);
1401
+ if (!m)
1402
+ return s;
1403
+ raise(null, errors.invalidCodeUnit, toHex(m[0].charCodeAt(0), 4).toUpperCase());
1404
+ };
1405
+ }
1406
+
1407
+ var encodingModes = {
1408
+ 'pseudo-latin1': {
1409
+ fixup: checkChars(/[^\x00-\xff]/),
1410
+ encodeByte: function (value) {
1411
+ if (value === null)
1412
+ return '';
1413
+ return String.fromCharCode(value);
1414
+ },
1415
+ encodeUTF8: function (codepoint) {
1416
+ return encodeUTF8(codepoint);
1417
+ },
1418
+ },
1419
+ 'x-user-defined': {
1420
+ fixup: checkChars(/[^\x00-\x7f\uf780-\uf7ff]/),
1421
+ encodeByte: function (value) {
1422
+ if (value === null)
1423
+ return '';
1424
+ if (value >= 0x80)
1425
+ return String.fromCharCode(value | 0xf700);
1426
+ return String.fromCharCode(value);
1427
+ },
1428
+ encodeUTF8: function (codepoint) {
1429
+ return encodeUTF8(codepoint, 0xf700);
1430
+ }
1431
+ },
1432
+ 'none': {
1433
+ discardStrings: true,
1434
+ fixup: function (s) {
1435
+ return s;
1436
+ },
1437
+ encodeByte: function (value) {
1438
+ return '';
1439
+ },
1440
+ encodeUTF8: function (codepoint) {
1441
+ return '';
1442
+ }
1443
+ }
1444
+ };
1445
+
1446
+ var EOF = 1, StringLiteral = 2, Keyword = 4, Identifier = 8
1447
+ , NumericLiteral = 16, Punctuator = 32, BooleanLiteral = 64
1448
+ , NilLiteral = 128, VarargLiteral = 256;
1449
+
1450
+ exports.tokenTypes = { EOF: EOF, StringLiteral: StringLiteral
1451
+ , Keyword: Keyword, Identifier: Identifier, NumericLiteral: NumericLiteral
1452
+ , Punctuator: Punctuator, BooleanLiteral: BooleanLiteral
1453
+ , NilLiteral: NilLiteral, VarargLiteral: VarargLiteral
1454
+ };
1455
+
1456
+ var errors = exports.errors = {
1457
+ unexpected: 'unexpected %1 \'%2\' near \'%3\''
1458
+ , unexpectedEOF: 'unexpected symbol near \'<eof>\''
1459
+ , expected: '\'%1\' expected near \'%2\''
1460
+ , expectedToken: '%1 expected near \'%2\''
1461
+ , unfinishedString: 'unfinished string near \'%1\''
1462
+ , malformedNumber: 'malformed number near \'%1\''
1463
+ , decimalEscapeTooLarge: 'decimal escape too large near \'%1\''
1464
+ , invalidEscape: 'invalid escape sequence near \'%1\''
1465
+ , hexadecimalDigitExpected: 'hexadecimal digit expected near \'%1\''
1466
+ , braceExpected: 'missing \'%1\' near \'%2\''
1467
+ , tooLargeCodepoint: 'UTF-8 value too large near \'%1\''
1468
+ , unfinishedLongString: 'unfinished long string (starting at line %1) near \'%2\''
1469
+ , unfinishedLongComment: 'unfinished long comment (starting at line %1) near \'%2\''
1470
+ , ambiguousSyntax: 'ambiguous syntax (function call x new statement) near \'%1\''
1471
+ , noLoopToBreak: 'no loop to break near \'%1\''
1472
+ , labelAlreadyDefined: 'label \'%1\' already defined on line %2'
1473
+ , labelNotVisible: 'no visible label \'%1\' for <goto>'
1474
+ , gotoJumpInLocalScope: '<goto %1> jumps into the scope of local \'%2\''
1475
+ , cannotUseVararg: 'cannot use \'...\' outside a vararg function near \'%1\''
1476
+ , invalidCodeUnit: 'code unit U+%1 is not allowed in the current encoding mode'
1477
+ };
1478
+
1479
+ var ast = exports.ast = {
1480
+ labelStatement: function(label) {
1481
+ return {
1482
+ type: 'LabelStatement'
1483
+ , label: label
1484
+ };
1485
+ }
1486
+
1487
+ , breakStatement: function() {
1488
+ return {
1489
+ type: 'BreakStatement'
1490
+ };
1491
+ }
1492
+
1493
+ , gotoStatement: function(label) {
1494
+ return {
1495
+ type: 'GotoStatement'
1496
+ , label: label
1497
+ };
1498
+ }
1499
+
1500
+ , returnStatement: function(args) {
1501
+ return {
1502
+ type: 'ReturnStatement'
1503
+ , 'arguments': args
1504
+ };
1505
+ }
1506
+
1507
+ , ifStatement: function(clauses) {
1508
+ return {
1509
+ type: 'IfStatement'
1510
+ , clauses: clauses
1511
+ };
1512
+ }
1513
+ , ifClause: function(condition, body) {
1514
+ return {
1515
+ type: 'IfClause'
1516
+ , condition: condition
1517
+ , body: body
1518
+ };
1519
+ }
1520
+ , elseifClause: function(condition, body) {
1521
+ return {
1522
+ type: 'ElseifClause'
1523
+ , condition: condition
1524
+ , body: body
1525
+ };
1526
+ }
1527
+ , elseClause: function(body) {
1528
+ return {
1529
+ type: 'ElseClause'
1530
+ , body: body
1531
+ };
1532
+ }
1533
+
1534
+ , whileStatement: function(condition, body) {
1535
+ return {
1536
+ type: 'WhileStatement'
1537
+ , condition: condition
1538
+ , body: body
1539
+ };
1540
+ }
1541
+
1542
+ , doStatement: function(body) {
1543
+ return {
1544
+ type: 'DoStatement'
1545
+ , body: body
1546
+ };
1547
+ }
1548
+
1549
+ , repeatStatement: function(condition, body) {
1550
+ return {
1551
+ type: 'RepeatStatement'
1552
+ , condition: condition
1553
+ , body: body
1554
+ };
1555
+ }
1556
+
1557
+ , localStatement: function(variables, init) {
1558
+ return {
1559
+ type: 'LocalStatement'
1560
+ , variables: variables
1561
+ , init: init
1562
+ };
1563
+ }
1564
+
1565
+ , assignmentStatement: function(variables, init) {
1566
+ return {
1567
+ type: 'AssignmentStatement'
1568
+ , variables: variables
1569
+ , init: init
1570
+ };
1571
+ }
1572
+
1573
+ , callStatement: function(expression) {
1574
+ return {
1575
+ type: 'CallStatement'
1576
+ , expression: expression
1577
+ };
1578
+ }
1579
+
1580
+ , functionStatement: function(identifier, parameters, isLocal, body) {
1581
+ return {
1582
+ type: 'FunctionDeclaration'
1583
+ , identifier: identifier
1584
+ , isLocal: isLocal
1585
+ , parameters: parameters
1586
+ , body: body
1587
+ };
1588
+ }
1589
+
1590
+ , forNumericStatement: function(variable, start, end, step, body) {
1591
+ return {
1592
+ type: 'ForNumericStatement'
1593
+ , variable: variable
1594
+ , start: start
1595
+ , end: end
1596
+ , step: step
1597
+ , body: body
1598
+ };
1599
+ }
1600
+
1601
+ , forGenericStatement: function(variables, iterators, body) {
1602
+ return {
1603
+ type: 'ForGenericStatement'
1604
+ , variables: variables
1605
+ , iterators: iterators
1606
+ , body: body
1607
+ };
1608
+ }
1609
+
1610
+ , chunk: function(body) {
1611
+ return {
1612
+ type: 'Chunk'
1613
+ , body: body
1614
+ };
1615
+ }
1616
+
1617
+ , identifier: function(name) {
1618
+ return {
1619
+ type: 'Identifier'
1620
+ , name: name
1621
+ };
1622
+ }
1623
+
1624
+ , literal: function(type, value, raw) {
1625
+ type = (type === StringLiteral) ? 'StringLiteral'
1626
+ : (type === NumericLiteral) ? 'NumericLiteral'
1627
+ : (type === BooleanLiteral) ? 'BooleanLiteral'
1628
+ : (type === NilLiteral) ? 'NilLiteral'
1629
+ : 'VarargLiteral';
1630
+
1631
+ return {
1632
+ type: type
1633
+ , value: value
1634
+ , raw: raw
1635
+ };
1636
+ }
1637
+
1638
+ , tableKey: function(key, value) {
1639
+ return {
1640
+ type: 'TableKey'
1641
+ , key: key
1642
+ , value: value
1643
+ };
1644
+ }
1645
+ , tableKeyString: function(key, value) {
1646
+ return {
1647
+ type: 'TableKeyString'
1648
+ , key: key
1649
+ , value: value
1650
+ };
1651
+ }
1652
+ , tableValue: function(value) {
1653
+ return {
1654
+ type: 'TableValue'
1655
+ , value: value
1656
+ };
1657
+ }
1658
+
1659
+
1660
+ , tableConstructorExpression: function(fields) {
1661
+ return {
1662
+ type: 'TableConstructorExpression'
1663
+ , fields: fields
1664
+ };
1665
+ }
1666
+ , binaryExpression: function(operator, left, right) {
1667
+ var type = ('and' === operator || 'or' === operator) ?
1668
+ 'LogicalExpression' :
1669
+ 'BinaryExpression';
1670
+
1671
+ return {
1672
+ type: type
1673
+ , operator: operator
1674
+ , left: left
1675
+ , right: right
1676
+ };
1677
+ }
1678
+ , unaryExpression: function(operator, argument) {
1679
+ return {
1680
+ type: 'UnaryExpression'
1681
+ , operator: operator
1682
+ , argument: argument
1683
+ };
1684
+ }
1685
+ , memberExpression: function(base, indexer, identifier) {
1686
+ return {
1687
+ type: 'MemberExpression'
1688
+ , indexer: indexer
1689
+ , identifier: identifier
1690
+ , base: base
1691
+ };
1692
+ }
1693
+
1694
+ , indexExpression: function(base, index) {
1695
+ return {
1696
+ type: 'IndexExpression'
1697
+ , base: base
1698
+ , index: index
1699
+ };
1700
+ }
1701
+
1702
+ , callExpression: function(base, args) {
1703
+ return {
1704
+ type: 'CallExpression'
1705
+ , base: base
1706
+ , 'arguments': args
1707
+ };
1708
+ }
1709
+
1710
+ , tableCallExpression: function(base, args) {
1711
+ return {
1712
+ type: 'TableCallExpression'
1713
+ , base: base
1714
+ , 'arguments': args
1715
+ };
1716
+ }
1717
+
1718
+ , stringCallExpression: function(base, argument) {
1719
+ return {
1720
+ type: 'StringCallExpression'
1721
+ , base: base
1722
+ , argument: argument
1723
+ };
1724
+ }
1725
+
1726
+ , comment: function(value, raw) {
1727
+ return {
1728
+ type: 'Comment'
1729
+ , value: value
1730
+ , raw: raw
1731
+ };
1732
+ }
1733
+ };
1734
+
1735
+ function finishNode(node) {
1736
+ if (trackLocations) {
1737
+ var location = locations.pop();
1738
+ location.complete();
1739
+ location.bless(node);
1740
+ }
1741
+ if (options.onCreateNode) options.onCreateNode(node);
1742
+ return node;
1743
+ }
1744
+
1745
+ var slice = Array.prototype.slice
1746
+ , toString = Object.prototype.toString
1747
+ ;
1748
+
1749
+ var indexOf = /* istanbul ignore next */ function (array, element) {
1750
+ for (var i = 0, length = array.length; i < length; ++i) {
1751
+ if (array[i] === element) return i;
1752
+ }
1753
+ return -1;
1754
+ };
1755
+ if (Array.prototype.indexOf)
1756
+ indexOf = function (array, element) {
1757
+ return array.indexOf(element);
1758
+ };
1759
+
1760
+ function indexOfObject(array, property, element) {
1761
+ for (var i = 0, length = array.length; i < length; ++i) {
1762
+ if (array[i][property] === element) return i;
1763
+ }
1764
+ return -1;
1765
+ }
1766
+
1767
+ function sprintf(format) {
1768
+ var args = slice.call(arguments, 1);
1769
+ format = format.replace(/%(\d)/g, function (match, index) {
1770
+ return '' + args[index - 1] || /* istanbul ignore next */ '';
1771
+ });
1772
+ return format;
1773
+ }
1774
+
1775
+ var assign = /* istanbul ignore next */ function (dest) {
1776
+ var args = slice.call(arguments, 1)
1777
+ , src, prop;
1778
+
1779
+ for (var i = 0, length = args.length; i < length; ++i) {
1780
+ src = args[i];
1781
+ for (prop in src)
1782
+ if (Object.prototype.hasOwnProperty.call(src, prop)) {
1783
+ dest[prop] = src[prop];
1784
+ }
1785
+ }
1786
+
1787
+ return dest;
1788
+ };
1789
+ if (Object.assign)
1790
+ assign = Object.assign;
1791
+
1792
+ exports.SyntaxError = SyntaxError;
1793
+
1794
+ function fixupError(e) {
1795
+ if (!Object.create)
1796
+ return e;
1797
+ return Object.create(e, {
1798
+ 'line': { 'writable': true, value: e.line },
1799
+ 'index': { 'writable': true, value: e.index },
1800
+ 'column': { 'writable': true, value: e.column }
1801
+ });
1802
+ }
1803
+
1804
+ function raise(token) {
1805
+ var message = sprintf.apply(null, slice.call(arguments, 1))
1806
+ , error, col;
1807
+
1808
+ if (token === null || typeof token.line === 'undefined') {
1809
+ col = index - lineStart + 1;
1810
+ error = fixupError(new SyntaxError(sprintf('[%1:%2] %3', line, col, message)));
1811
+ error.index = index;
1812
+ error.line = line;
1813
+ error.column = col;
1814
+ } else {
1815
+ col = token.range[0] - token.lineStart;
1816
+ error = fixupError(new SyntaxError(sprintf('[%1:%2] %3', token.line, col, message)));
1817
+ error.line = token.line;
1818
+ error.index = token.range[0];
1819
+ error.column = col;
1820
+ }
1821
+ throw error;
1822
+ }
1823
+
1824
+ function tokenValue(token) {
1825
+ var raw = input.slice(token.range[0], token.range[1]);
1826
+ if (raw)
1827
+ return raw;
1828
+ return token.value;
1829
+ }
1830
+
1831
+ function raiseUnexpectedToken(type, token) {
1832
+ raise(token, errors.expectedToken, type, tokenValue(token));
1833
+ }
1834
+
1835
+ function unexpected(found) {
1836
+ var near = tokenValue(lookahead);
1837
+ if ('undefined' !== typeof found.type) {
1838
+ var type;
1839
+ switch (found.type) {
1840
+ case StringLiteral: type = 'string'; break;
1841
+ case Keyword: type = 'keyword'; break;
1842
+ case Identifier: type = 'identifier'; break;
1843
+ case NumericLiteral: type = 'number'; break;
1844
+ case Punctuator: type = 'symbol'; break;
1845
+ case BooleanLiteral: type = 'boolean'; break;
1846
+ case NilLiteral:
1847
+ return raise(found, errors.unexpected, 'symbol', 'nil', near);
1848
+ case EOF:
1849
+ return raise(found, errors.unexpectedEOF);
1850
+ }
1851
+ return raise(found, errors.unexpected, type, tokenValue(found), near);
1852
+ }
1853
+ return raise(found, errors.unexpected, 'symbol', found, near);
1854
+ }
1855
+
1856
+ var index
1857
+ , token
1858
+ , previousToken
1859
+ , lookahead
1860
+ , comments
1861
+ , tokenStart
1862
+ , line
1863
+ , lineStart;
1864
+
1865
+ exports.lex = lex;
1866
+
1867
+ function lex() {
1868
+ skipWhiteSpace();
1869
+ while (45 === input.charCodeAt(index) &&
1870
+ 45 === input.charCodeAt(index + 1)) {
1871
+ scanComment();
1872
+ skipWhiteSpace();
1873
+ }
1874
+ if (index >= length) return {
1875
+ type : EOF
1876
+ , value: '<eof>'
1877
+ , line: line
1878
+ , lineStart: lineStart
1879
+ , range: [index, index]
1880
+ };
1881
+
1882
+ var charCode = input.charCodeAt(index)
1883
+ , next = input.charCodeAt(index + 1);
1884
+ tokenStart = index;
1885
+ if (isIdentifierStart(charCode)) return scanIdentifierOrKeyword();
1886
+
1887
+ switch (charCode) {
1888
+ case 39: case 34: // '"
1889
+ return scanStringLiteral();
1890
+
1891
+ case 48: case 49: case 50: case 51: case 52: case 53:
1892
+ case 54: case 55: case 56: case 57: // 0-9
1893
+ return scanNumericLiteral();
1894
+
1895
+ case 46: // .
1896
+ if (isDecDigit(next)) return scanNumericLiteral();
1897
+ if (46 === next) {
1898
+ if (46 === input.charCodeAt(index + 2)) return scanVarargLiteral();
1899
+ return scanPunctuator('..');
1900
+ }
1901
+ return scanPunctuator('.');
1902
+
1903
+ case 61: // =
1904
+ if (61 === next) return scanPunctuator('==');
1905
+ return scanPunctuator('=');
1906
+
1907
+ case 62: // >
1908
+ if (features.bitwiseOperators)
1909
+ if (62 === next) return scanPunctuator('>>');
1910
+ if (61 === next) return scanPunctuator('>=');
1911
+ return scanPunctuator('>');
1912
+
1913
+ case 60: // <
1914
+ if (features.bitwiseOperators)
1915
+ if (60 === next) return scanPunctuator('<<');
1916
+ if (61 === next) return scanPunctuator('<=');
1917
+ return scanPunctuator('<');
1918
+
1919
+ case 126: // ~
1920
+ if (61 === next) return scanPunctuator('~=');
1921
+ if (!features.bitwiseOperators)
1922
+ break;
1923
+ return scanPunctuator('~');
1924
+
1925
+ case 58: // :
1926
+ if (features.labels)
1927
+ if (58 === next) return scanPunctuator('::');
1928
+ return scanPunctuator(':');
1929
+
1930
+ case 91: // [
1931
+ if (91 === next || 61 === next) return scanLongStringLiteral();
1932
+ return scanPunctuator('[');
1933
+
1934
+ case 47: // /
1935
+ if (features.integerDivision)
1936
+ if (47 === next) return scanPunctuator('//');
1937
+ return scanPunctuator('/');
1938
+
1939
+ case 38: case 124: // & |
1940
+ if (!features.bitwiseOperators)
1941
+ break;
1942
+ case 42: case 94: case 37: case 44: case 123: case 125:
1943
+ case 93: case 40: case 41: case 59: case 35: case 45:
1944
+ case 43: // * ^ % , { } ] ( ) ; # - +
1945
+ return scanPunctuator(input.charAt(index));
1946
+ }
1947
+
1948
+ return unexpected(input.charAt(index));
1949
+ }
1950
+
1951
+ function consumeEOL() {
1952
+ var charCode = input.charCodeAt(index)
1953
+ , peekCharCode = input.charCodeAt(index + 1);
1954
+
1955
+ if (isLineTerminator(charCode)) {
1956
+ if (10 === charCode && 13 === peekCharCode) ++index;
1957
+ if (13 === charCode && 10 === peekCharCode) ++index;
1958
+ ++line;
1959
+ lineStart = ++index;
1960
+
1961
+ return true;
1962
+ }
1963
+ return false;
1964
+ }
1965
+
1966
+ function skipWhiteSpace() {
1967
+ while (index < length) {
1968
+ var charCode = input.charCodeAt(index);
1969
+ if (isWhiteSpace(charCode)) {
1970
+ ++index;
1971
+ } else if (!consumeEOL()) {
1972
+ break;
1973
+ }
1974
+ }
1975
+ }
1976
+
1977
+ function scanIdentifierOrKeyword() {
1978
+ var value, type;
1979
+ while (isIdentifierPart(input.charCodeAt(++index)));
1980
+ value = encodingMode.fixup(input.slice(tokenStart, index));
1981
+ if (isKeyword(value)) {
1982
+ type = Keyword;
1983
+ } else if ('true' === value || 'false' === value) {
1984
+ type = BooleanLiteral;
1985
+ value = ('true' === value);
1986
+ } else if ('nil' === value) {
1987
+ type = NilLiteral;
1988
+ value = null;
1989
+ } else {
1990
+ type = Identifier;
1991
+ }
1992
+
1993
+ return {
1994
+ type: type
1995
+ , value: value
1996
+ , line: line
1997
+ , lineStart: lineStart
1998
+ , range: [tokenStart, index]
1999
+ };
2000
+ }
2001
+
2002
+ function scanPunctuator(value) {
2003
+ index += value.length;
2004
+ return {
2005
+ type: Punctuator
2006
+ , value: value
2007
+ , line: line
2008
+ , lineStart: lineStart
2009
+ , range: [tokenStart, index]
2010
+ };
2011
+ }
2012
+
2013
+ function scanVarargLiteral() {
2014
+ index += 3;
2015
+ return {
2016
+ type: VarargLiteral
2017
+ , value: '...'
2018
+ , line: line
2019
+ , lineStart: lineStart
2020
+ , range: [tokenStart, index]
2021
+ };
2022
+ }
2023
+
2024
+ function scanStringLiteral() {
2025
+ var delimiter = input.charCodeAt(index++)
2026
+ , beginLine = line
2027
+ , beginLineStart = lineStart
2028
+ , stringStart = index
2029
+ , string = encodingMode.discardStrings ? null : ''
2030
+ , charCode;
2031
+
2032
+ for (;;) {
2033
+ charCode = input.charCodeAt(index++);
2034
+ if (delimiter === charCode) break;
2035
+ if (index > length || isLineTerminator(charCode)) {
2036
+ string += input.slice(stringStart, index - 1);
2037
+ raise(null, errors.unfinishedString, input.slice(tokenStart, index - 1));
2038
+ }
2039
+ if (92 === charCode) { // backslash
2040
+ if (!encodingMode.discardStrings) {
2041
+ var beforeEscape = input.slice(stringStart, index - 1);
2042
+ string += encodingMode.fixup(beforeEscape);
2043
+ }
2044
+ var escapeValue = readEscapeSequence();
2045
+ if (!encodingMode.discardStrings)
2046
+ string += escapeValue;
2047
+ stringStart = index;
2048
+ }
2049
+ }
2050
+ if (!encodingMode.discardStrings) {
2051
+ string += encodingMode.encodeByte(null);
2052
+ string += encodingMode.fixup(input.slice(stringStart, index - 1));
2053
+ }
2054
+
2055
+ return {
2056
+ type: StringLiteral
2057
+ , value: string
2058
+ , line: beginLine
2059
+ , lineStart: beginLineStart
2060
+ , lastLine: line
2061
+ , lastLineStart: lineStart
2062
+ , range: [tokenStart, index]
2063
+ };
2064
+ }
2065
+
2066
+ function scanLongStringLiteral() {
2067
+ var beginLine = line
2068
+ , beginLineStart = lineStart
2069
+ , string = readLongString(false);
2070
+ if (false === string) raise(token, errors.expected, '[', tokenValue(token));
2071
+
2072
+ return {
2073
+ type: StringLiteral
2074
+ , value: encodingMode.discardStrings ? null : encodingMode.fixup(string)
2075
+ , line: beginLine
2076
+ , lineStart: beginLineStart
2077
+ , lastLine: line
2078
+ , lastLineStart: lineStart
2079
+ , range: [tokenStart, index]
2080
+ };
2081
+ }
2082
+
2083
+ function scanNumericLiteral() {
2084
+ var character = input.charAt(index)
2085
+ , next = input.charAt(index + 1);
2086
+
2087
+ var literal = ('0' === character && 'xX'.indexOf(next || null) >= 0) ?
2088
+ readHexLiteral() : readDecLiteral();
2089
+
2090
+ var foundImaginaryUnit = readImaginaryUnitSuffix()
2091
+ , foundInt64Suffix = readInt64Suffix();
2092
+
2093
+ if (foundInt64Suffix && (foundImaginaryUnit || literal.hasFractionPart)) {
2094
+ raise(null, errors.malformedNumber, input.slice(tokenStart, index));
2095
+ }
2096
+
2097
+ return {
2098
+ type: NumericLiteral
2099
+ , value: literal.value
2100
+ , line: line
2101
+ , lineStart: lineStart
2102
+ , range: [tokenStart, index]
2103
+ };
2104
+ }
2105
+
2106
+ function readImaginaryUnitSuffix() {
2107
+ if (!features.imaginaryNumbers) return;
2108
+ if ('iI'.indexOf(input.charAt(index) || null) >= 0) {
2109
+ ++index;
2110
+ return true;
2111
+ } else {
2112
+ return false;
2113
+ }
2114
+ }
2115
+
2116
+ function readInt64Suffix() {
2117
+ if (!features.integerSuffixes) return;
2118
+
2119
+ if ('uU'.indexOf(input.charAt(index) || null) >= 0) {
2120
+ ++index;
2121
+ if ('lL'.indexOf(input.charAt(index) || null) >= 0) {
2122
+ ++index;
2123
+ if ('lL'.indexOf(input.charAt(index) || null) >= 0) {
2124
+ ++index;
2125
+ return 'ULL';
2126
+ } else {
2127
+ raise(null, errors.malformedNumber, input.slice(tokenStart, index));
2128
+ }
2129
+ } else {
2130
+ raise(null, errors.malformedNumber, input.slice(tokenStart, index));
2131
+ }
2132
+ } else if ('lL'.indexOf(input.charAt(index) || null) >= 0) {
2133
+ ++index;
2134
+ if ('lL'.indexOf(input.charAt(index) || null) >= 0) {
2135
+ ++index;
2136
+ return 'LL';
2137
+ } else {
2138
+ raise(null, errors.malformedNumber, input.slice(tokenStart, index));
2139
+ }
2140
+ }
2141
+ }
2142
+
2143
+ function readHexLiteral() {
2144
+ var fraction = 0 // defaults to 0 as it gets summed
2145
+ , binaryExponent = 1 // defaults to 1 as it gets multiplied
2146
+ , binarySign = 1 // positive
2147
+ , digit, fractionStart, exponentStart, digitStart;
2148
+
2149
+ digitStart = index += 2; // Skip 0x part
2150
+ if (!isHexDigit(input.charCodeAt(index)))
2151
+ raise(null, errors.malformedNumber, input.slice(tokenStart, index));
2152
+
2153
+ while (isHexDigit(input.charCodeAt(index))) ++index;
2154
+ digit = parseInt(input.slice(digitStart, index), 16);
2155
+ var foundFraction = false;
2156
+ if ('.' === input.charAt(index)) {
2157
+ foundFraction = true;
2158
+ fractionStart = ++index;
2159
+
2160
+ while (isHexDigit(input.charCodeAt(index))) ++index;
2161
+ fraction = input.slice(fractionStart, index);
2162
+ fraction = (fractionStart === index) ? 0
2163
+ : parseInt(fraction, 16) / Math.pow(16, index - fractionStart);
2164
+ }
2165
+ var foundBinaryExponent = false;
2166
+ if ('pP'.indexOf(input.charAt(index) || null) >= 0) {
2167
+ foundBinaryExponent = true;
2168
+ ++index;
2169
+ if ('+-'.indexOf(input.charAt(index) || null) >= 0)
2170
+ binarySign = ('+' === input.charAt(index++)) ? 1 : -1;
2171
+
2172
+ exponentStart = index;
2173
+ if (!isDecDigit(input.charCodeAt(index)))
2174
+ raise(null, errors.malformedNumber, input.slice(tokenStart, index));
2175
+
2176
+ while (isDecDigit(input.charCodeAt(index))) ++index;
2177
+ binaryExponent = input.slice(exponentStart, index);
2178
+ binaryExponent = Math.pow(2, binaryExponent * binarySign);
2179
+ }
2180
+
2181
+ return {
2182
+ value: (digit + fraction) * binaryExponent,
2183
+ hasFractionPart: foundFraction || foundBinaryExponent
2184
+ };
2185
+ }
2186
+
2187
+ function readDecLiteral() {
2188
+ while (isDecDigit(input.charCodeAt(index))) ++index;
2189
+ var foundFraction = false;
2190
+ if ('.' === input.charAt(index)) {
2191
+ foundFraction = true;
2192
+ ++index;
2193
+ while (isDecDigit(input.charCodeAt(index))) ++index;
2194
+ }
2195
+ var foundExponent = false;
2196
+ if ('eE'.indexOf(input.charAt(index) || null) >= 0) {
2197
+ foundExponent = true;
2198
+ ++index;
2199
+ if ('+-'.indexOf(input.charAt(index) || null) >= 0) ++index;
2200
+ if (!isDecDigit(input.charCodeAt(index)))
2201
+ raise(null, errors.malformedNumber, input.slice(tokenStart, index));
2202
+
2203
+ while (isDecDigit(input.charCodeAt(index))) ++index;
2204
+ }
2205
+
2206
+ return {
2207
+ value: parseFloat(input.slice(tokenStart, index)),
2208
+ hasFractionPart: foundFraction || foundExponent
2209
+ };
2210
+ }
2211
+
2212
+ function readUnicodeEscapeSequence() {
2213
+ var sequenceStart = index++;
2214
+
2215
+ if (input.charAt(index++) !== '{')
2216
+ raise(null, errors.braceExpected, '{', '\\' + input.slice(sequenceStart, index));
2217
+ if (!isHexDigit(input.charCodeAt(index)))
2218
+ raise(null, errors.hexadecimalDigitExpected, '\\' + input.slice(sequenceStart, index));
2219
+
2220
+ while (input.charCodeAt(index) === 0x30) ++index;
2221
+ var escStart = index;
2222
+
2223
+ while (isHexDigit(input.charCodeAt(index))) {
2224
+ ++index;
2225
+ if (index - escStart > 6)
2226
+ raise(null, errors.tooLargeCodepoint, '\\' + input.slice(sequenceStart, index));
2227
+ }
2228
+
2229
+ var b = input.charAt(index++);
2230
+ if (b !== '}') {
2231
+ if ((b === '"') || (b === "'"))
2232
+ raise(null, errors.braceExpected, '}', '\\' + input.slice(sequenceStart, index--));
2233
+ else
2234
+ raise(null, errors.hexadecimalDigitExpected, '\\' + input.slice(sequenceStart, index));
2235
+ }
2236
+
2237
+ var codepoint = parseInt(input.slice(escStart, index - 1) || '0', 16);
2238
+ var frag = '\\' + input.slice(sequenceStart, index);
2239
+
2240
+ if (codepoint > 0x10ffff) {
2241
+ raise(null, errors.tooLargeCodepoint, frag);
2242
+ }
2243
+
2244
+ return encodingMode.encodeUTF8(codepoint, frag);
2245
+ }
2246
+ function readEscapeSequence() {
2247
+ var sequenceStart = index;
2248
+ switch (input.charAt(index)) {
2249
+ case 'a': ++index; return '\x07';
2250
+ case 'n': ++index; return '\n';
2251
+ case 'r': ++index; return '\r';
2252
+ case 't': ++index; return '\t';
2253
+ case 'v': ++index; return '\x0b';
2254
+ case 'b': ++index; return '\b';
2255
+ case 'f': ++index; return '\f';
2256
+ case '\r':
2257
+ case '\n':
2258
+ consumeEOL();
2259
+ return '\n';
2260
+
2261
+ case '0': case '1': case '2': case '3': case '4':
2262
+ case '5': case '6': case '7': case '8': case '9':
2263
+ while (isDecDigit(input.charCodeAt(index)) && index - sequenceStart < 3) ++index;
2264
+
2265
+ var frag = input.slice(sequenceStart, index);
2266
+ var ddd = parseInt(frag, 10);
2267
+ if (ddd > 255) {
2268
+ raise(null, errors.decimalEscapeTooLarge, '\\' + ddd);
2269
+ }
2270
+ return encodingMode.encodeByte(ddd, '\\' + frag);
2271
+
2272
+ case 'z':
2273
+ if (features.skipWhitespaceEscape) {
2274
+ ++index;
2275
+ skipWhiteSpace();
2276
+ return '';
2277
+ }
2278
+ break;
2279
+
2280
+ case 'x':
2281
+ if (features.hexEscapes) {
2282
+ if (isHexDigit(input.charCodeAt(index + 1)) &&
2283
+ isHexDigit(input.charCodeAt(index + 2))) {
2284
+ index += 3;
2285
+ return encodingMode.encodeByte(parseInt(input.slice(sequenceStart + 1, index), 16), '\\' + input.slice(sequenceStart, index));
2286
+ }
2287
+ raise(null, errors.hexadecimalDigitExpected, '\\' + input.slice(sequenceStart, index + 2));
2288
+ }
2289
+ break;
2290
+
2291
+ case 'u':
2292
+ if (features.unicodeEscapes)
2293
+ return readUnicodeEscapeSequence();
2294
+ break;
2295
+
2296
+ case '\\': case '"': case "'":
2297
+ return input.charAt(index++);
2298
+ }
2299
+
2300
+ if (features.strictEscapes)
2301
+ raise(null, errors.invalidEscape, '\\' + input.slice(sequenceStart, index + 1));
2302
+ return input.charAt(index++);
2303
+ }
2304
+
2305
+ function scanComment() {
2306
+ tokenStart = index;
2307
+ index += 2; // --
2308
+
2309
+ var character = input.charAt(index)
2310
+ , content = ''
2311
+ , isLong = false
2312
+ , commentStart = index
2313
+ , lineStartComment = lineStart
2314
+ , lineComment = line;
2315
+
2316
+ if ('[' === character) {
2317
+ content = readLongString(true);
2318
+ if (false === content) content = character;
2319
+ else isLong = true;
2320
+ }
2321
+ if (!isLong) {
2322
+ while (index < length) {
2323
+ if (isLineTerminator(input.charCodeAt(index))) break;
2324
+ ++index;
2325
+ }
2326
+ if (options.comments) content = input.slice(commentStart, index);
2327
+ }
2328
+
2329
+ if (options.comments) {
2330
+ var node = ast.comment(content, input.slice(tokenStart, index));
2331
+ if (options.locations) {
2332
+ node.loc = {
2333
+ start: { line: lineComment, column: tokenStart - lineStartComment }
2334
+ , end: { line: line, column: index - lineStart }
2335
+ };
2336
+ }
2337
+ if (options.ranges) {
2338
+ node.range = [tokenStart, index];
2339
+ }
2340
+ if (options.onCreateNode) options.onCreateNode(node);
2341
+ comments.push(node);
2342
+ }
2343
+ }
2344
+
2345
+ function readLongString(isComment) {
2346
+ var level = 0
2347
+ , content = ''
2348
+ , terminator = false
2349
+ , character, stringStart, firstLine = line;
2350
+
2351
+ ++index; // [
2352
+ while ('=' === input.charAt(index + level)) ++level;
2353
+ if ('[' !== input.charAt(index + level)) return false;
2354
+
2355
+ index += level + 1;
2356
+ if (isLineTerminator(input.charCodeAt(index))) consumeEOL();
2357
+
2358
+ stringStart = index;
2359
+ while (index < length) {
2360
+ while (isLineTerminator(input.charCodeAt(index))) consumeEOL();
2361
+
2362
+ character = input.charAt(index++);
2363
+ if (']' === character) {
2364
+ terminator = true;
2365
+ for (var i = 0; i < level; ++i) {
2366
+ if ('=' !== input.charAt(index + i)) terminator = false;
2367
+ }
2368
+ if (']' !== input.charAt(index + level)) terminator = false;
2369
+ }
2370
+ if (terminator) {
2371
+ content += input.slice(stringStart, index - 1);
2372
+ index += level + 1;
2373
+ return content;
2374
+ }
2375
+ }
2376
+
2377
+ raise(null, isComment ?
2378
+ errors.unfinishedLongComment :
2379
+ errors.unfinishedLongString,
2380
+ firstLine, '<eof>');
2381
+ }
2382
+
2383
+ function next() {
2384
+ previousToken = token;
2385
+ token = lookahead;
2386
+ lookahead = lex();
2387
+ }
2388
+
2389
+ function consume(value) {
2390
+ if (value === token.value) {
2391
+ next();
2392
+ return true;
2393
+ }
2394
+ return false;
2395
+ }
2396
+
2397
+ function expect(value) {
2398
+ if (value === token.value) next();
2399
+ else raise(token, errors.expected, value, tokenValue(token));
2400
+ }
2401
+
2402
+ function isWhiteSpace(charCode) {
2403
+ return 9 === charCode || 32 === charCode || 0xB === charCode || 0xC === charCode;
2404
+ }
2405
+
2406
+ function isLineTerminator(charCode) {
2407
+ return 10 === charCode || 13 === charCode;
2408
+ }
2409
+
2410
+ function isDecDigit(charCode) {
2411
+ return charCode >= 48 && charCode <= 57;
2412
+ }
2413
+
2414
+ function isHexDigit(charCode) {
2415
+ return (charCode >= 48 && charCode <= 57) || (charCode >= 97 && charCode <= 102) || (charCode >= 65 && charCode <= 70);
2416
+ }
2417
+
2418
+ function isIdentifierStart(charCode) {
2419
+ if ((charCode >= 65 && charCode <= 90) || (charCode >= 97 && charCode <= 122) || 95 === charCode)
2420
+ return true;
2421
+ if (features.extendedIdentifiers && charCode >= 128)
2422
+ return true;
2423
+ return false;
2424
+ }
2425
+
2426
+ function isIdentifierPart(charCode) {
2427
+ if ((charCode >= 65 && charCode <= 90) || (charCode >= 97 && charCode <= 122) || 95 === charCode || (charCode >= 48 && charCode <= 57))
2428
+ return true;
2429
+ if (features.extendedIdentifiers && charCode >= 128)
2430
+ return true;
2431
+ return false;
2432
+ }
2433
+
2434
+ function isKeyword(id) {
2435
+ switch (id.length) {
2436
+ case 2:
2437
+ return 'do' === id || 'if' === id || 'in' === id || 'or' === id;
2438
+ case 3:
2439
+ return 'and' === id || 'end' === id || 'for' === id || 'not' === id;
2440
+ case 4:
2441
+ if ('else' === id || 'then' === id)
2442
+ return true;
2443
+ if (features.labels && !features.contextualGoto)
2444
+ return ('goto' === id);
2445
+ return false;
2446
+ case 5:
2447
+ return 'break' === id || 'local' === id || 'until' === id || 'while' === id;
2448
+ case 6:
2449
+ return 'elseif' === id || 'repeat' === id || 'return' === id;
2450
+ case 8:
2451
+ return 'function' === id;
2452
+ }
2453
+ return false;
2454
+ }
2455
+
2456
+ function isUnary(token) {
2457
+ if (Punctuator === token.type) return '#-~'.indexOf(token.value) >= 0;
2458
+ if (Keyword === token.type) return 'not' === token.value;
2459
+ return false;
2460
+ }
2461
+
2462
+ function isBlockFollow(token) {
2463
+ if (EOF === token.type) return true;
2464
+ if (Keyword !== token.type) return false;
2465
+ switch (token.value) {
2466
+ case 'else': case 'elseif':
2467
+ case 'end': case 'until':
2468
+ return true;
2469
+ default:
2470
+ return false;
2471
+ }
2472
+ }
2473
+ var scopes
2474
+ , scopeDepth
2475
+ , globals;
2476
+ function createScope() {
2477
+ var scope = scopes[scopeDepth++].slice();
2478
+ scopes.push(scope);
2479
+ if (options.onCreateScope) options.onCreateScope();
2480
+ }
2481
+ function destroyScope() {
2482
+ var scope = scopes.pop();
2483
+ --scopeDepth;
2484
+ if (options.onDestroyScope) options.onDestroyScope();
2485
+ }
2486
+ function scopeIdentifierName(name) {
2487
+ if (options.onLocalDeclaration) options.onLocalDeclaration(name);
2488
+ if (-1 !== indexOf(scopes[scopeDepth], name)) return;
2489
+ scopes[scopeDepth].push(name);
2490
+ }
2491
+ function scopeIdentifier(node) {
2492
+ scopeIdentifierName(node.name);
2493
+ attachScope(node, true);
2494
+ }
2495
+ function attachScope(node, isLocal) {
2496
+ if (!isLocal && -1 === indexOfObject(globals, 'name', node.name))
2497
+ globals.push(node);
2498
+
2499
+ node.isLocal = isLocal;
2500
+ }
2501
+ function scopeHasName(name) {
2502
+ return (-1 !== indexOf(scopes[scopeDepth], name));
2503
+ }
2504
+
2505
+ var locations = []
2506
+ , trackLocations;
2507
+
2508
+ function createLocationMarker() {
2509
+ return new Marker(token);
2510
+ }
2511
+
2512
+ function Marker(token) {
2513
+ if (options.locations) {
2514
+ this.loc = {
2515
+ start: {
2516
+ line: token.line
2517
+ , column: token.range[0] - token.lineStart
2518
+ }
2519
+ , end: {
2520
+ line: 0
2521
+ , column: 0
2522
+ }
2523
+ };
2524
+ }
2525
+ if (options.ranges) this.range = [token.range[0], 0];
2526
+ }
2527
+ Marker.prototype.complete = function() {
2528
+ if (options.locations) {
2529
+ this.loc.end.line = previousToken.lastLine || previousToken.line;
2530
+ this.loc.end.column = previousToken.range[1] - (previousToken.lastLineStart || previousToken.lineStart);
2531
+ }
2532
+ if (options.ranges) {
2533
+ this.range[1] = previousToken.range[1];
2534
+ }
2535
+ };
2536
+
2537
+ Marker.prototype.bless = function (node) {
2538
+ if (this.loc) {
2539
+ var loc = this.loc;
2540
+ node.loc = {
2541
+ start: {
2542
+ line: loc.start.line,
2543
+ column: loc.start.column
2544
+ },
2545
+ end: {
2546
+ line: loc.end.line,
2547
+ column: loc.end.column
2548
+ }
2549
+ };
2550
+ }
2551
+ if (this.range) {
2552
+ node.range = [
2553
+ this.range[0],
2554
+ this.range[1]
2555
+ ];
2556
+ }
2557
+ };
2558
+ function markLocation() {
2559
+ if (trackLocations) locations.push(createLocationMarker());
2560
+ }
2561
+ function pushLocation(marker) {
2562
+ if (trackLocations) locations.push(marker);
2563
+ }
2564
+
2565
+ function FullFlowContext() {
2566
+ this.scopes = [];
2567
+ this.pendingGotos = [];
2568
+ }
2569
+
2570
+ FullFlowContext.prototype.isInLoop = function () {
2571
+ var i = this.scopes.length;
2572
+ while (i --> 0) {
2573
+ if (this.scopes[i].isLoop)
2574
+ return true;
2575
+ }
2576
+ return false;
2577
+ };
2578
+
2579
+ FullFlowContext.prototype.pushScope = function (isLoop) {
2580
+ var scope = {
2581
+ labels: {},
2582
+ locals: [],
2583
+ deferredGotos: [],
2584
+ isLoop: !!isLoop
2585
+ };
2586
+ this.scopes.push(scope);
2587
+ };
2588
+
2589
+ FullFlowContext.prototype.popScope = function () {
2590
+ for (var i = 0; i < this.pendingGotos.length; ++i) {
2591
+ var theGoto = this.pendingGotos[i];
2592
+ if (theGoto.maxDepth >= this.scopes.length)
2593
+ if (--theGoto.maxDepth <= 0)
2594
+ raise(theGoto.token, errors.labelNotVisible, theGoto.target);
2595
+ }
2596
+
2597
+ this.scopes.pop();
2598
+ };
2599
+
2600
+ FullFlowContext.prototype.addGoto = function (target, token) {
2601
+ var localCounts = [];
2602
+
2603
+ for (var i = 0; i < this.scopes.length; ++i) {
2604
+ var scope = this.scopes[i];
2605
+ localCounts.push(scope.locals.length);
2606
+ if (Object.prototype.hasOwnProperty.call(scope.labels, target))
2607
+ return;
2608
+ }
2609
+
2610
+ this.pendingGotos.push({
2611
+ maxDepth: this.scopes.length,
2612
+ target: target,
2613
+ token: token,
2614
+ localCounts: localCounts
2615
+ });
2616
+ };
2617
+
2618
+ FullFlowContext.prototype.addLabel = function (name, token) {
2619
+ var scope = this.currentScope();
2620
+
2621
+ if (Object.prototype.hasOwnProperty.call(scope.labels, name)) {
2622
+ raise(token, errors.labelAlreadyDefined, name, scope.labels[name].line);
2623
+ } else {
2624
+ var newGotos = [];
2625
+
2626
+ for (var i = 0; i < this.pendingGotos.length; ++i) {
2627
+ var theGoto = this.pendingGotos[i];
2628
+
2629
+ if (theGoto.maxDepth >= this.scopes.length && theGoto.target === name) {
2630
+ if (theGoto.localCounts[this.scopes.length - 1] < scope.locals.length) {
2631
+ scope.deferredGotos.push(theGoto);
2632
+ }
2633
+ continue;
2634
+ }
2635
+
2636
+ newGotos.push(theGoto);
2637
+ }
2638
+
2639
+ this.pendingGotos = newGotos;
2640
+ }
2641
+
2642
+ scope.labels[name] = {
2643
+ localCount: scope.locals.length,
2644
+ line: token.line
2645
+ };
2646
+ };
2647
+
2648
+ FullFlowContext.prototype.addLocal = function (name, token) {
2649
+ this.currentScope().locals.push({
2650
+ name: name,
2651
+ token: token
2652
+ });
2653
+ };
2654
+
2655
+ FullFlowContext.prototype.currentScope = function () {
2656
+ return this.scopes[this.scopes.length - 1];
2657
+ };
2658
+
2659
+ FullFlowContext.prototype.raiseDeferredErrors = function () {
2660
+ var scope = this.currentScope();
2661
+ var bads = scope.deferredGotos;
2662
+ for (var i = 0; i < bads.length; ++i) {
2663
+ var theGoto = bads[i];
2664
+ raise(theGoto.token, errors.gotoJumpInLocalScope, theGoto.target, scope.locals[theGoto.localCounts[this.scopes.length - 1]].name);
2665
+ }
2666
+ };
2667
+
2668
+ function LoopFlowContext() {
2669
+ this.level = 0;
2670
+ this.loopLevels = [];
2671
+ }
2672
+
2673
+ LoopFlowContext.prototype.isInLoop = function () {
2674
+ return !!this.loopLevels.length;
2675
+ };
2676
+
2677
+ LoopFlowContext.prototype.pushScope = function (isLoop) {
2678
+ ++this.level;
2679
+ if (isLoop)
2680
+ this.loopLevels.push(this.level);
2681
+ };
2682
+
2683
+ LoopFlowContext.prototype.popScope = function () {
2684
+ var levels = this.loopLevels;
2685
+ var levlen = levels.length;
2686
+ if (levlen) {
2687
+ if (levels[levlen - 1] === this.level)
2688
+ levels.pop();
2689
+ }
2690
+ --this.level;
2691
+ };
2692
+
2693
+ LoopFlowContext.prototype.addGoto =
2694
+ LoopFlowContext.prototype.addLabel =
2695
+ function () { throw new Error('This should never happen'); };
2696
+
2697
+ LoopFlowContext.prototype.addLocal =
2698
+ LoopFlowContext.prototype.raiseDeferredErrors =
2699
+ function () {};
2700
+
2701
+ function makeFlowContext() {
2702
+ return features.labels ? new FullFlowContext() : new LoopFlowContext();
2703
+ }
2704
+
2705
+ function parseChunk() {
2706
+ next();
2707
+ markLocation();
2708
+ if (options.scope) createScope();
2709
+ var flowContext = makeFlowContext();
2710
+ flowContext.allowVararg = true;
2711
+ flowContext.pushScope();
2712
+ var body = parseBlock(flowContext);
2713
+ flowContext.popScope();
2714
+ if (options.scope) destroyScope();
2715
+ if (EOF !== token.type) unexpected(token);
2716
+ if (trackLocations && !body.length) previousToken = token;
2717
+ return finishNode(ast.chunk(body));
2718
+ }
2719
+
2720
+ function parseBlock(flowContext) {
2721
+ var block = []
2722
+ , statement;
2723
+
2724
+ while (!isBlockFollow(token)) {
2725
+ if ('return' === token.value || (!features.relaxedBreak && 'break' === token.value)) {
2726
+ block.push(parseStatement(flowContext));
2727
+ break;
2728
+ }
2729
+ statement = parseStatement(flowContext);
2730
+ consume(';');
2731
+ if (statement) block.push(statement);
2732
+ }
2733
+ return block;
2734
+ }
2735
+
2736
+ function parseStatement(flowContext) {
2737
+ markLocation();
2738
+
2739
+ if (Punctuator === token.type) {
2740
+ if (consume('::')) return parseLabelStatement(flowContext);
2741
+ }
2742
+ if (features.emptyStatement) {
2743
+ if (consume(';')) {
2744
+ if (trackLocations) locations.pop();
2745
+ return;
2746
+ }
2747
+ }
2748
+
2749
+ flowContext.raiseDeferredErrors();
2750
+
2751
+ if (Keyword === token.type) {
2752
+ switch (token.value) {
2753
+ case 'local': next(); return parseLocalStatement(flowContext);
2754
+ case 'if': next(); return parseIfStatement(flowContext);
2755
+ case 'return': next(); return parseReturnStatement(flowContext);
2756
+ case 'function': next();
2757
+ var name = parseFunctionName();
2758
+ return parseFunctionDeclaration(name);
2759
+ case 'while': next(); return parseWhileStatement(flowContext);
2760
+ case 'for': next(); return parseForStatement(flowContext);
2761
+ case 'repeat': next(); return parseRepeatStatement(flowContext);
2762
+ case 'break': next();
2763
+ if (!flowContext.isInLoop())
2764
+ raise(token, errors.noLoopToBreak, token.value);
2765
+ return parseBreakStatement();
2766
+ case 'do': next(); return parseDoStatement(flowContext);
2767
+ case 'goto': next(); return parseGotoStatement(flowContext);
2768
+ }
2769
+ }
2770
+
2771
+ if (features.contextualGoto &&
2772
+ token.type === Identifier && token.value === 'goto' &&
2773
+ lookahead.type === Identifier && lookahead.value !== 'goto') {
2774
+ next(); return parseGotoStatement(flowContext);
2775
+ }
2776
+ if (trackLocations) locations.pop();
2777
+
2778
+ return parseAssignmentOrCallStatement(flowContext);
2779
+ }
2780
+
2781
+ function parseLabelStatement(flowContext) {
2782
+ var nameToken = token
2783
+ , label = parseIdentifier();
2784
+
2785
+ if (options.scope) {
2786
+ scopeIdentifierName('::' + nameToken.value + '::');
2787
+ attachScope(label, true);
2788
+ }
2789
+
2790
+ expect('::');
2791
+
2792
+ flowContext.addLabel(nameToken.value, nameToken);
2793
+ return finishNode(ast.labelStatement(label));
2794
+ }
2795
+
2796
+ function parseBreakStatement() {
2797
+ return finishNode(ast.breakStatement());
2798
+ }
2799
+
2800
+ function parseGotoStatement(flowContext) {
2801
+ var name = token.value
2802
+ , gotoToken = previousToken
2803
+ , label = parseIdentifier();
2804
+
2805
+ flowContext.addGoto(name, gotoToken);
2806
+ return finishNode(ast.gotoStatement(label));
2807
+ }
2808
+
2809
+ function parseDoStatement(flowContext) {
2810
+ if (options.scope) createScope();
2811
+ flowContext.pushScope();
2812
+ var body = parseBlock(flowContext);
2813
+ flowContext.popScope();
2814
+ if (options.scope) destroyScope();
2815
+ expect('end');
2816
+ return finishNode(ast.doStatement(body));
2817
+ }
2818
+
2819
+ function parseWhileStatement(flowContext) {
2820
+ var condition = parseExpectedExpression(flowContext);
2821
+ expect('do');
2822
+ if (options.scope) createScope();
2823
+ flowContext.pushScope(true);
2824
+ var body = parseBlock(flowContext);
2825
+ flowContext.popScope();
2826
+ if (options.scope) destroyScope();
2827
+ expect('end');
2828
+ return finishNode(ast.whileStatement(condition, body));
2829
+ }
2830
+
2831
+ function parseRepeatStatement(flowContext) {
2832
+ if (options.scope) createScope();
2833
+ flowContext.pushScope(true);
2834
+ var body = parseBlock(flowContext);
2835
+ expect('until');
2836
+ flowContext.raiseDeferredErrors();
2837
+ var condition = parseExpectedExpression(flowContext);
2838
+ flowContext.popScope();
2839
+ if (options.scope) destroyScope();
2840
+ return finishNode(ast.repeatStatement(condition, body));
2841
+ }
2842
+
2843
+ function parseReturnStatement(flowContext) {
2844
+ var expressions = [];
2845
+
2846
+ if ('end' !== token.value) {
2847
+ var expression = parseExpression(flowContext);
2848
+ if (null != expression) expressions.push(expression);
2849
+ while (consume(',')) {
2850
+ expression = parseExpectedExpression(flowContext);
2851
+ expressions.push(expression);
2852
+ }
2853
+ consume(';'); // grammar tells us ; is optional here.
2854
+ }
2855
+ return finishNode(ast.returnStatement(expressions));
2856
+ }
2857
+
2858
+ function parseIfStatement(flowContext) {
2859
+ var clauses = []
2860
+ , condition
2861
+ , body
2862
+ , marker;
2863
+ if (trackLocations) {
2864
+ marker = locations[locations.length - 1];
2865
+ locations.push(marker);
2866
+ }
2867
+ condition = parseExpectedExpression(flowContext);
2868
+ expect('then');
2869
+ if (options.scope) createScope();
2870
+ flowContext.pushScope();
2871
+ body = parseBlock(flowContext);
2872
+ flowContext.popScope();
2873
+ if (options.scope) destroyScope();
2874
+ clauses.push(finishNode(ast.ifClause(condition, body)));
2875
+
2876
+ if (trackLocations) marker = createLocationMarker();
2877
+ while (consume('elseif')) {
2878
+ pushLocation(marker);
2879
+ condition = parseExpectedExpression(flowContext);
2880
+ expect('then');
2881
+ if (options.scope) createScope();
2882
+ flowContext.pushScope();
2883
+ body = parseBlock(flowContext);
2884
+ flowContext.popScope();
2885
+ if (options.scope) destroyScope();
2886
+ clauses.push(finishNode(ast.elseifClause(condition, body)));
2887
+ if (trackLocations) marker = createLocationMarker();
2888
+ }
2889
+
2890
+ if (consume('else')) {
2891
+ if (trackLocations) {
2892
+ marker = new Marker(previousToken);
2893
+ locations.push(marker);
2894
+ }
2895
+ if (options.scope) createScope();
2896
+ flowContext.pushScope();
2897
+ body = parseBlock(flowContext);
2898
+ flowContext.popScope();
2899
+ if (options.scope) destroyScope();
2900
+ clauses.push(finishNode(ast.elseClause(body)));
2901
+ }
2902
+
2903
+ expect('end');
2904
+ return finishNode(ast.ifStatement(clauses));
2905
+ }
2906
+
2907
+ function parseForStatement(flowContext) {
2908
+ var variable = parseIdentifier()
2909
+ , body;
2910
+
2911
+ if (options.scope) {
2912
+ createScope();
2913
+ scopeIdentifier(variable);
2914
+ }
2915
+ if (consume('=')) {
2916
+ var start = parseExpectedExpression(flowContext);
2917
+ expect(',');
2918
+ var end = parseExpectedExpression(flowContext);
2919
+ var step = consume(',') ? parseExpectedExpression(flowContext) : null;
2920
+
2921
+ expect('do');
2922
+ flowContext.pushScope(true);
2923
+ body = parseBlock(flowContext);
2924
+ flowContext.popScope();
2925
+ expect('end');
2926
+ if (options.scope) destroyScope();
2927
+
2928
+ return finishNode(ast.forNumericStatement(variable, start, end, step, body));
2929
+ }
2930
+ else {
2931
+ var variables = [variable];
2932
+ while (consume(',')) {
2933
+ variable = parseIdentifier();
2934
+ if (options.scope) scopeIdentifier(variable);
2935
+ variables.push(variable);
2936
+ }
2937
+ expect('in');
2938
+ var iterators = [];
2939
+ do {
2940
+ var expression = parseExpectedExpression(flowContext);
2941
+ iterators.push(expression);
2942
+ } while (consume(','));
2943
+
2944
+ expect('do');
2945
+ flowContext.pushScope(true);
2946
+ body = parseBlock(flowContext);
2947
+ flowContext.popScope();
2948
+ expect('end');
2949
+ if (options.scope) destroyScope();
2950
+
2951
+ return finishNode(ast.forGenericStatement(variables, iterators, body));
2952
+ }
2953
+ }
2954
+
2955
+ function parseLocalStatement(flowContext) {
2956
+ var name
2957
+ , declToken = previousToken;
2958
+
2959
+ if (Identifier === token.type) {
2960
+ var variables = []
2961
+ , init = [];
2962
+
2963
+ do {
2964
+ name = parseIdentifier();
2965
+
2966
+ variables.push(name);
2967
+ flowContext.addLocal(name.name, declToken);
2968
+ } while (consume(','));
2969
+
2970
+ if (consume('=')) {
2971
+ do {
2972
+ var expression = parseExpectedExpression(flowContext);
2973
+ init.push(expression);
2974
+ } while (consume(','));
2975
+ }
2976
+ if (options.scope) {
2977
+ for (var i = 0, l = variables.length; i < l; ++i) {
2978
+ scopeIdentifier(variables[i]);
2979
+ }
2980
+ }
2981
+
2982
+ return finishNode(ast.localStatement(variables, init));
2983
+ }
2984
+ if (consume('function')) {
2985
+ name = parseIdentifier();
2986
+ flowContext.addLocal(name.name, declToken);
2987
+
2988
+ if (options.scope) {
2989
+ scopeIdentifier(name);
2990
+ createScope();
2991
+ }
2992
+ return parseFunctionDeclaration(name, true);
2993
+ } else {
2994
+ raiseUnexpectedToken('<name>', token);
2995
+ }
2996
+ }
2997
+
2998
+ function parseAssignmentOrCallStatement(flowContext) {
2999
+ var previous = token
3000
+ , marker, startMarker;
3001
+ var lvalue, base, name;
3002
+
3003
+ var targets = [];
3004
+
3005
+ if (trackLocations) startMarker = createLocationMarker();
3006
+
3007
+ do {
3008
+ if (trackLocations) marker = createLocationMarker();
3009
+
3010
+ if (Identifier === token.type) {
3011
+ name = token.value;
3012
+ base = parseIdentifier();
3013
+ if (options.scope) attachScope(base, scopeHasName(name));
3014
+ lvalue = true;
3015
+ } else if ('(' === token.value) {
3016
+ next();
3017
+ base = parseExpectedExpression(flowContext);
3018
+ expect(')');
3019
+ lvalue = false;
3020
+ } else {
3021
+ return unexpected(token);
3022
+ }
3023
+
3024
+ both: for (;;) {
3025
+ var newBase;
3026
+
3027
+ switch (StringLiteral === token.type ? '"' : token.value) {
3028
+ case '.':
3029
+ case '[':
3030
+ lvalue = true;
3031
+ break;
3032
+ case ':':
3033
+ case '(':
3034
+ case '{':
3035
+ case '"':
3036
+ lvalue = null;
3037
+ break;
3038
+ default:
3039
+ break both;
3040
+ }
3041
+
3042
+ base = parsePrefixExpressionPart(base, marker, flowContext);
3043
+ }
3044
+
3045
+ targets.push(base);
3046
+
3047
+ if (',' !== token.value)
3048
+ break;
3049
+
3050
+ if (!lvalue) {
3051
+ return unexpected(token);
3052
+ }
3053
+
3054
+ next();
3055
+ } while (true);
3056
+
3057
+ if (targets.length === 1 && lvalue === null) {
3058
+ pushLocation(marker);
3059
+ return finishNode(ast.callStatement(targets[0]));
3060
+ } else if (!lvalue) {
3061
+ return unexpected(token);
3062
+ }
3063
+
3064
+ expect('=');
3065
+
3066
+ var values = [];
3067
+
3068
+ do {
3069
+ values.push(parseExpectedExpression(flowContext));
3070
+ } while (consume(','));
3071
+
3072
+ pushLocation(startMarker);
3073
+ return finishNode(ast.assignmentStatement(targets, values));
3074
+ }
3075
+
3076
+ function parseIdentifier() {
3077
+ markLocation();
3078
+ var identifier = token.value;
3079
+ if (Identifier !== token.type) raiseUnexpectedToken('<name>', token);
3080
+ next();
3081
+ return finishNode(ast.identifier(identifier));
3082
+ }
3083
+
3084
+ function parseFunctionDeclaration(name, isLocal) {
3085
+ var flowContext = makeFlowContext();
3086
+ flowContext.pushScope();
3087
+
3088
+ var parameters = [];
3089
+ expect('(');
3090
+ if (!consume(')')) {
3091
+ while (true) {
3092
+ if (Identifier === token.type) {
3093
+ var parameter = parseIdentifier();
3094
+ if (options.scope) scopeIdentifier(parameter);
3095
+
3096
+ parameters.push(parameter);
3097
+
3098
+ if (consume(',')) continue;
3099
+ }
3100
+ else if (VarargLiteral === token.type) {
3101
+ flowContext.allowVararg = true;
3102
+ parameters.push(parsePrimaryExpression(flowContext));
3103
+ } else {
3104
+ raiseUnexpectedToken('<name> or \'...\'', token);
3105
+ }
3106
+ expect(')');
3107
+ break;
3108
+ }
3109
+ }
3110
+
3111
+ var body = parseBlock(flowContext);
3112
+ flowContext.popScope();
3113
+ expect('end');
3114
+ if (options.scope) destroyScope();
3115
+
3116
+ isLocal = isLocal || false;
3117
+ return finishNode(ast.functionStatement(name, parameters, isLocal, body));
3118
+ }
3119
+
3120
+ function parseFunctionName() {
3121
+ var base, name, marker;
3122
+
3123
+ if (trackLocations) marker = createLocationMarker();
3124
+ base = parseIdentifier();
3125
+
3126
+ if (options.scope) {
3127
+ attachScope(base, scopeHasName(base.name));
3128
+ createScope();
3129
+ }
3130
+
3131
+ while (consume('.')) {
3132
+ pushLocation(marker);
3133
+ name = parseIdentifier();
3134
+ base = finishNode(ast.memberExpression(base, '.', name));
3135
+ }
3136
+
3137
+ if (consume(':')) {
3138
+ pushLocation(marker);
3139
+ name = parseIdentifier();
3140
+ base = finishNode(ast.memberExpression(base, ':', name));
3141
+ if (options.scope) scopeIdentifierName('self');
3142
+ }
3143
+
3144
+ return base;
3145
+ }
3146
+
3147
+ function parseTableConstructor(flowContext) {
3148
+ var fields = []
3149
+ , key, value;
3150
+
3151
+ while (true) {
3152
+ markLocation();
3153
+ if (Punctuator === token.type && consume('[')) {
3154
+ key = parseExpectedExpression(flowContext);
3155
+ expect(']');
3156
+ expect('=');
3157
+ value = parseExpectedExpression(flowContext);
3158
+ fields.push(finishNode(ast.tableKey(key, value)));
3159
+ } else if (Identifier === token.type) {
3160
+ if ('=' === lookahead.value) {
3161
+ key = parseIdentifier();
3162
+ next();
3163
+ value = parseExpectedExpression(flowContext);
3164
+ fields.push(finishNode(ast.tableKeyString(key, value)));
3165
+ } else {
3166
+ value = parseExpectedExpression(flowContext);
3167
+ fields.push(finishNode(ast.tableValue(value)));
3168
+ }
3169
+ } else {
3170
+ if (null == (value = parseExpression(flowContext))) {
3171
+ locations.pop();
3172
+ break;
3173
+ }
3174
+ fields.push(finishNode(ast.tableValue(value)));
3175
+ }
3176
+ if (',;'.indexOf(token.value) >= 0) {
3177
+ next();
3178
+ continue;
3179
+ }
3180
+ break;
3181
+ }
3182
+ expect('}');
3183
+ return finishNode(ast.tableConstructorExpression(fields));
3184
+ }
3185
+
3186
+ function parseExpression(flowContext) {
3187
+ var expression = parseSubExpression(0, flowContext);
3188
+ return expression;
3189
+ }
3190
+
3191
+ function parseExpectedExpression(flowContext) {
3192
+ var expression = parseExpression(flowContext);
3193
+ if (null == expression) raiseUnexpectedToken('<expression>', token);
3194
+ else return expression;
3195
+ }
3196
+
3197
+ function binaryPrecedence(operator) {
3198
+ var charCode = operator.charCodeAt(0)
3199
+ , length = operator.length;
3200
+
3201
+ if (1 === length) {
3202
+ switch (charCode) {
3203
+ case 94: return 12; // ^
3204
+ case 42: case 47: case 37: return 10; // * / %
3205
+ case 43: case 45: return 9; // + -
3206
+ case 38: return 6; // &
3207
+ case 126: return 5; // ~
3208
+ case 124: return 4; // |
3209
+ case 60: case 62: return 3; // < >
3210
+ }
3211
+ } else if (2 === length) {
3212
+ switch (charCode) {
3213
+ case 47: return 10; // //
3214
+ case 46: return 8; // ..
3215
+ case 60: case 62:
3216
+ if('<<' === operator || '>>' === operator) return 7; // << >>
3217
+ return 3; // <= >=
3218
+ case 61: case 126: return 3; // == ~=
3219
+ case 111: return 1; // or
3220
+ }
3221
+ } else if (97 === charCode && 'and' === operator) return 2;
3222
+ return 0;
3223
+ }
3224
+
3225
+ function parseSubExpression(minPrecedence, flowContext) {
3226
+ var operator = token.value
3227
+ , expression, marker;
3228
+
3229
+ if (trackLocations) marker = createLocationMarker();
3230
+ if (isUnary(token)) {
3231
+ markLocation();
3232
+ next();
3233
+ var argument = parseSubExpression(10, flowContext);
3234
+ if (argument == null) raiseUnexpectedToken('<expression>', token);
3235
+ expression = finishNode(ast.unaryExpression(operator, argument));
3236
+ }
3237
+ if (null == expression) {
3238
+ expression = parsePrimaryExpression(flowContext);
3239
+ if (null == expression) {
3240
+ expression = parsePrefixExpression(flowContext);
3241
+ }
3242
+ }
3243
+ if (null == expression) return null;
3244
+
3245
+ var precedence;
3246
+ while (true) {
3247
+ operator = token.value;
3248
+
3249
+ precedence = (Punctuator === token.type || Keyword === token.type) ?
3250
+ binaryPrecedence(operator) : 0;
3251
+
3252
+ if (precedence === 0 || precedence <= minPrecedence) break;
3253
+ if ('^' === operator || '..' === operator) --precedence;
3254
+ next();
3255
+ var right = parseSubExpression(precedence, flowContext);
3256
+ if (null == right) raiseUnexpectedToken('<expression>', token);
3257
+ if (trackLocations) locations.push(marker);
3258
+ expression = finishNode(ast.binaryExpression(operator, expression, right));
3259
+
3260
+ }
3261
+ return expression;
3262
+ }
3263
+
3264
+ function parsePrefixExpressionPart(base, marker, flowContext) {
3265
+ var expression, identifier;
3266
+
3267
+ if (Punctuator === token.type) {
3268
+ switch (token.value) {
3269
+ case '[':
3270
+ pushLocation(marker);
3271
+ next();
3272
+ expression = parseExpectedExpression(flowContext);
3273
+ expect(']');
3274
+ return finishNode(ast.indexExpression(base, expression));
3275
+ case '.':
3276
+ pushLocation(marker);
3277
+ next();
3278
+ identifier = parseIdentifier();
3279
+ return finishNode(ast.memberExpression(base, '.', identifier));
3280
+ case ':':
3281
+ pushLocation(marker);
3282
+ next();
3283
+ identifier = parseIdentifier();
3284
+ base = finishNode(ast.memberExpression(base, ':', identifier));
3285
+ pushLocation(marker);
3286
+ return parseCallExpression(base, flowContext);
3287
+ case '(': case '{': // args
3288
+ pushLocation(marker);
3289
+ return parseCallExpression(base, flowContext);
3290
+ }
3291
+ } else if (StringLiteral === token.type) {
3292
+ pushLocation(marker);
3293
+ return parseCallExpression(base, flowContext);
3294
+ }
3295
+
3296
+ return null;
3297
+ }
3298
+
3299
+ function parsePrefixExpression(flowContext) {
3300
+ var base, name, marker;
3301
+
3302
+ if (trackLocations) marker = createLocationMarker();
3303
+ if (Identifier === token.type) {
3304
+ name = token.value;
3305
+ base = parseIdentifier();
3306
+ if (options.scope) attachScope(base, scopeHasName(name));
3307
+ } else if (consume('(')) {
3308
+ base = parseExpectedExpression(flowContext);
3309
+ expect(')');
3310
+ } else {
3311
+ return null;
3312
+ }
3313
+ for (;;) {
3314
+ var newBase = parsePrefixExpressionPart(base, marker, flowContext);
3315
+ if (newBase === null)
3316
+ break;
3317
+ base = newBase;
3318
+ }
3319
+
3320
+ return base;
3321
+ }
3322
+
3323
+ function parseCallExpression(base, flowContext) {
3324
+ if (Punctuator === token.type) {
3325
+ switch (token.value) {
3326
+ case '(':
3327
+ if (!features.emptyStatement) {
3328
+ if (token.line !== previousToken.line)
3329
+ raise(null, errors.ambiguousSyntax, token.value);
3330
+ }
3331
+ next();
3332
+ var expressions = [];
3333
+ var expression = parseExpression(flowContext);
3334
+ if (null != expression) expressions.push(expression);
3335
+ while (consume(',')) {
3336
+ expression = parseExpectedExpression(flowContext);
3337
+ expressions.push(expression);
3338
+ }
3339
+
3340
+ expect(')');
3341
+ return finishNode(ast.callExpression(base, expressions));
3342
+
3343
+ case '{':
3344
+ markLocation();
3345
+ next();
3346
+ var table = parseTableConstructor(flowContext);
3347
+ return finishNode(ast.tableCallExpression(base, table));
3348
+ }
3349
+ } else if (StringLiteral === token.type) {
3350
+ return finishNode(ast.stringCallExpression(base, parsePrimaryExpression(flowContext)));
3351
+ }
3352
+
3353
+ raiseUnexpectedToken('function arguments', token);
3354
+ }
3355
+
3356
+ function parsePrimaryExpression(flowContext) {
3357
+ var literals = StringLiteral | NumericLiteral | BooleanLiteral | NilLiteral | VarargLiteral
3358
+ , value = token.value
3359
+ , type = token.type
3360
+ , marker;
3361
+
3362
+ if (trackLocations) marker = createLocationMarker();
3363
+
3364
+ if (type === VarargLiteral && !flowContext.allowVararg) {
3365
+ raise(token, errors.cannotUseVararg, token.value);
3366
+ }
3367
+
3368
+ if (type & literals) {
3369
+ pushLocation(marker);
3370
+ var raw = input.slice(token.range[0], token.range[1]);
3371
+ next();
3372
+ return finishNode(ast.literal(type, value, raw));
3373
+ } else if (Keyword === type && 'function' === value) {
3374
+ pushLocation(marker);
3375
+ next();
3376
+ if (options.scope) createScope();
3377
+ return parseFunctionDeclaration(null);
3378
+ } else if (consume('{')) {
3379
+ pushLocation(marker);
3380
+ return parseTableConstructor(flowContext);
3381
+ }
3382
+ }
3383
+
3384
+ exports.parse = parse;
3385
+
3386
+ var versionFeatures = {
3387
+ '5.1': {
3388
+ },
3389
+ '5.2': {
3390
+ labels: true,
3391
+ emptyStatement: true,
3392
+ hexEscapes: true,
3393
+ skipWhitespaceEscape: true,
3394
+ strictEscapes: true,
3395
+ relaxedBreak: true
3396
+ },
3397
+ '5.3': {
3398
+ labels: true,
3399
+ emptyStatement: true,
3400
+ hexEscapes: true,
3401
+ skipWhitespaceEscape: true,
3402
+ strictEscapes: true,
3403
+ unicodeEscapes: true,
3404
+ bitwiseOperators: true,
3405
+ integerDivision: true,
3406
+ relaxedBreak: true
3407
+ },
3408
+ 'LuaJIT': {
3409
+ labels: true,
3410
+ contextualGoto: true,
3411
+ hexEscapes: true,
3412
+ skipWhitespaceEscape: true,
3413
+ strictEscapes: true,
3414
+ unicodeEscapes: true,
3415
+ imaginaryNumbers: true,
3416
+ integerSuffixes: true
3417
+ }
3418
+ };
3419
+
3420
+ function parse(_input, _options) {
3421
+ if ('undefined' === typeof _options && 'object' === typeof _input) {
3422
+ _options = _input;
3423
+ _input = undefined;
3424
+ }
3425
+ if (!_options) _options = {};
3426
+
3427
+ input = _input || '';
3428
+ options = assign({}, defaultOptions, _options);
3429
+ index = 0;
3430
+ line = 1;
3431
+ lineStart = 0;
3432
+ length = input.length;
3433
+ scopes = [[]];
3434
+ scopeDepth = 0;
3435
+ globals = [];
3436
+ locations = [];
3437
+
3438
+ if (!Object.prototype.hasOwnProperty.call(versionFeatures, options.luaVersion)) {
3439
+ throw new Error(sprintf("Lua version '%1' not supported", options.luaVersion));
3440
+ }
3441
+
3442
+ features = assign({}, versionFeatures[options.luaVersion]);
3443
+ if (options.extendedIdentifiers !== void 0)
3444
+ features.extendedIdentifiers = !!options.extendedIdentifiers;
3445
+
3446
+ if (!Object.prototype.hasOwnProperty.call(encodingModes, options.encodingMode)) {
3447
+ throw new Error(sprintf("Encoding mode '%1' not supported", options.encodingMode));
3448
+ }
3449
+
3450
+ encodingMode = encodingModes[options.encodingMode];
3451
+
3452
+ if (options.comments) comments = [];
3453
+ if (!options.wait) return end();
3454
+ return exports;
3455
+ }
3456
+ exports.write = write;
3457
+
3458
+ function write(_input) {
3459
+ input += String(_input);
3460
+ length = input.length;
3461
+ return exports;
3462
+ }
3463
+ exports.end = end;
3464
+
3465
+ function end(_input) {
3466
+ if ('undefined' !== typeof _input) write(_input);
3467
+ if (input && input.substr(0, 2) === '#!') input = input.replace(/^.*/, function (line) {
3468
+ return line.replace(/./g, ' ');
3469
+ });
3470
+
3471
+ length = input.length;
3472
+ trackLocations = options.locations || options.ranges;
3473
+ lookahead = lex();
3474
+
3475
+ var chunk = parseChunk();
3476
+ if (options.comments) chunk.comments = comments;
3477
+ if (options.scope) chunk.globals = globals;
3478
+ if (locations.length > 0)
3479
+ throw new Error('Location tracking failed. This is most likely a bug in luaparse');
3480
+
3481
+ return chunk;
3482
+ }
3483
+
3484
+ }));
3485
+
3486
+ });
3487
+
3488
+ ace.define("ace/mode/lua_worker",[], function(require, exports, module) {
3489
+ "use strict";
3490
+
3491
+ var oop = require("../lib/oop");
3492
+ var Mirror = require("../worker/mirror").Mirror;
3493
+ var luaparse = require("../mode/lua/luaparse");
3494
+
3495
+ var Worker = exports.Worker = function(sender) {
3496
+ Mirror.call(this, sender);
3497
+ this.setTimeout(500);
3498
+ };
3499
+
3500
+ oop.inherits(Worker, Mirror);
3501
+
3502
+ (function() {
3503
+
3504
+ this.onUpdate = function() {
3505
+ var value = this.doc.getValue();
3506
+ var errors = [];
3507
+ try {
3508
+ luaparse.parse(value);
3509
+ } catch(e) {
3510
+ if (e instanceof luaparse.SyntaxError) {
3511
+ errors.push({
3512
+ row: e.line - 1,
3513
+ column: e.column,
3514
+ text: e.message,
3515
+ type: "error"
3516
+ });
3517
+ }
3518
+ }
3519
+ this.sender.emit("annotate", errors);
3520
+ };
3521
+
3522
+ }).call(Worker.prototype);
3523
+
3524
+ });