ace-oqc 1.4.13
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.
- package/package.json +7 -0
- package/src-noconflict/ace.js +21402 -0
- package/src-noconflict/ext-beautify.js +331 -0
- package/src-noconflict/ext-elastic_tabstops_lite.js +277 -0
- package/src-noconflict/ext-emmet.js +1331 -0
- package/src-noconflict/ext-error_marker.js +9 -0
- package/src-noconflict/ext-keybinding_menu.js +193 -0
- package/src-noconflict/ext-language_tools.js +2166 -0
- package/src-noconflict/ext-linking.js +64 -0
- package/src-noconflict/ext-modelist.js +248 -0
- package/src-noconflict/ext-options.js +799 -0
- package/src-noconflict/ext-prompt.js +2806 -0
- package/src-noconflict/ext-rtl.js +122 -0
- package/src-noconflict/ext-searchbox.js +514 -0
- package/src-noconflict/ext-settings_menu.js +820 -0
- package/src-noconflict/ext-spellcheck.js +73 -0
- package/src-noconflict/ext-split.js +207 -0
- package/src-noconflict/ext-static_highlight.js +229 -0
- package/src-noconflict/ext-statusbar.js +56 -0
- package/src-noconflict/ext-textarea.js +430 -0
- package/src-noconflict/ext-themelist.js +67 -0
- package/src-noconflict/ext-whitespace.js +213 -0
- package/src-noconflict/keybinding-emacs.js +1169 -0
- package/src-noconflict/keybinding-sublime.js +422 -0
- package/src-noconflict/keybinding-vim.js +6198 -0
- package/src-noconflict/mode-abap.js +221 -0
- package/src-noconflict/mode-abc.js +271 -0
- package/src-noconflict/mode-actionscript.js +275 -0
- package/src-noconflict/mode-ada.js +137 -0
- package/src-noconflict/mode-apache_conf.js +363 -0
- package/src-noconflict/mode-apex.js +457 -0
- package/src-noconflict/mode-applescript.js +278 -0
- package/src-noconflict/mode-aql.js +102 -0
- package/src-noconflict/mode-asciidoc.js +349 -0
- package/src-noconflict/mode-asl.js +422 -0
- package/src-noconflict/mode-assembly_x86.js +193 -0
- package/src-noconflict/mode-autohotkey.js +244 -0
- package/src-noconflict/mode-batchfile.js +230 -0
- package/src-noconflict/mode-c9search.js +293 -0
- package/src-noconflict/mode-c_cpp.js +503 -0
- package/src-noconflict/mode-cirru.js +210 -0
- package/src-noconflict/mode-clojure.js +315 -0
- package/src-noconflict/mode-cobol.js +101 -0
- package/src-noconflict/mode-coffee.js +400 -0
- package/src-noconflict/mode-coldfusion.js +2596 -0
- package/src-noconflict/mode-crystal.js +642 -0
- package/src-noconflict/mode-csharp.js +502 -0
- package/src-noconflict/mode-csound_document.js +4105 -0
- package/src-noconflict/mode-csound_orchestra.js +3035 -0
- package/src-noconflict/mode-csound_score.js +462 -0
- package/src-noconflict/mode-csp.js +59 -0
- package/src-noconflict/mode-css.js +720 -0
- package/src-noconflict/mode-curly.js +2564 -0
- package/src-noconflict/mode-d.js +520 -0
- package/src-noconflict/mode-dart.js +715 -0
- package/src-noconflict/mode-diff.js +147 -0
- package/src-noconflict/mode-django.js +2595 -0
- package/src-noconflict/mode-dockerfile.js +500 -0
- package/src-noconflict/mode-dot.js +417 -0
- package/src-noconflict/mode-drools.js +498 -0
- package/src-noconflict/mode-edifact.js +166 -0
- package/src-noconflict/mode-eiffel.js +135 -0
- package/src-noconflict/mode-ejs.js +3533 -0
- package/src-noconflict/mode-elixir.js +501 -0
- package/src-noconflict/mode-elm.js +306 -0
- package/src-noconflict/mode-erlang.js +1010 -0
- package/src-noconflict/mode-forth.js +297 -0
- package/src-noconflict/mode-fortran.js +430 -0
- package/src-noconflict/mode-fsharp.js +316 -0
- package/src-noconflict/mode-fsl.js +259 -0
- package/src-noconflict/mode-ftl.js +1193 -0
- package/src-noconflict/mode-gcode.js +93 -0
- package/src-noconflict/mode-gherkin.js +168 -0
- package/src-noconflict/mode-gitignore.js +59 -0
- package/src-noconflict/mode-glsl.js +580 -0
- package/src-noconflict/mode-gobstones.js +1090 -0
- package/src-noconflict/mode-golang.js +413 -0
- package/src-noconflict/mode-graphqlschema.js +214 -0
- package/src-noconflict/mode-groovy.js +989 -0
- package/src-noconflict/mode-haml.js +1873 -0
- package/src-noconflict/mode-handlebars.js +2622 -0
- package/src-noconflict/mode-haskell.js +380 -0
- package/src-noconflict/mode-haskell_cabal.js +141 -0
- package/src-noconflict/mode-haxe.js +386 -0
- package/src-noconflict/mode-hjson.js +353 -0
- package/src-noconflict/mode-html.js +2509 -0
- package/src-noconflict/mode-html_elixir.js +3088 -0
- package/src-noconflict/mode-html_ruby.js +3550 -0
- package/src-noconflict/mode-ini.js +162 -0
- package/src-noconflict/mode-io.js +248 -0
- package/src-noconflict/mode-jack.js +346 -0
- package/src-noconflict/mode-jade.js +2025 -0
- package/src-noconflict/mode-java.js +1038 -0
- package/src-noconflict/mode-javascript.js +798 -0
- package/src-noconflict/mode-json.js +329 -0
- package/src-noconflict/mode-jsoniq.js +2632 -0
- package/src-noconflict/mode-jsp.js +1433 -0
- package/src-noconflict/mode-jssm.js +325 -0
- package/src-noconflict/mode-jsx.js +411 -0
- package/src-noconflict/mode-julia.js +303 -0
- package/src-noconflict/mode-kotlin.js +797 -0
- package/src-noconflict/mode-latex.js +296 -0
- package/src-noconflict/mode-less.js +839 -0
- package/src-noconflict/mode-liquid.js +2742 -0
- package/src-noconflict/mode-lisp.js +112 -0
- package/src-noconflict/mode-livescript.js +279 -0
- package/src-noconflict/mode-logiql.js +317 -0
- package/src-noconflict/mode-logtalk.js +352 -0
- package/src-noconflict/mode-lsl.js +343 -0
- package/src-noconflict/mode-lua.js +452 -0
- package/src-noconflict/mode-luapage.js +3028 -0
- package/src-noconflict/mode-lucene.js +154 -0
- package/src-noconflict/mode-makefile.js +412 -0
- package/src-noconflict/mode-markdown.js +3194 -0
- package/src-noconflict/mode-mask.js +1803 -0
- package/src-noconflict/mode-matlab.js +263 -0
- package/src-noconflict/mode-maze.js +292 -0
- package/src-noconflict/mode-mel.js +263 -0
- package/src-noconflict/mode-mixal.js +122 -0
- package/src-noconflict/mode-mushcode.js +681 -0
- package/src-noconflict/mode-mysql.js +167 -0
- package/src-noconflict/mode-nginx.js +298 -0
- package/src-noconflict/mode-nim.js +363 -0
- package/src-noconflict/mode-nix.js +647 -0
- package/src-noconflict/mode-nsis.js +312 -0
- package/src-noconflict/mode-objectivec.js +740 -0
- package/src-noconflict/mode-ocaml.js +421 -0
- package/src-noconflict/mode-pascal.js +223 -0
- package/src-noconflict/mode-perl.js +381 -0
- package/src-noconflict/mode-pgsql.js +1743 -0
- package/src-noconflict/mode-php.js +13110 -0
- package/src-noconflict/mode-php_laravel_blade.js +13311 -0
- package/src-noconflict/mode-pig.js +310 -0
- package/src-noconflict/mode-plain_text.js +32 -0
- package/src-noconflict/mode-powershell.js +418 -0
- package/src-noconflict/mode-praat.js +478 -0
- package/src-noconflict/mode-prolog.js +371 -0
- package/src-noconflict/mode-properties.js +80 -0
- package/src-noconflict/mode-protobuf.js +593 -0
- package/src-noconflict/mode-puppet.js +368 -0
- package/src-noconflict/mode-python.js +508 -0
- package/src-noconflict/mode-r.js +312 -0
- package/src-noconflict/mode-razor.js +2875 -0
- package/src-noconflict/mode-rdoc.js +243 -0
- package/src-noconflict/mode-red.js +450 -0
- package/src-noconflict/mode-redshift.js +360 -0
- package/src-noconflict/mode-rhtml.js +2808 -0
- package/src-noconflict/mode-rst.js +257 -0
- package/src-noconflict/mode-ruby.js +1003 -0
- package/src-noconflict/mode-rust.js +282 -0
- package/src-noconflict/mode-sass.js +529 -0
- package/src-noconflict/mode-scad.js +414 -0
- package/src-noconflict/mode-scala.js +984 -0
- package/src-noconflict/mode-scheme.js +232 -0
- package/src-noconflict/mode-scss.js +873 -0
- package/src-noconflict/mode-sh.js +449 -0
- package/src-noconflict/mode-sjs.js +1015 -0
- package/src-noconflict/mode-slim.js +5240 -0
- package/src-noconflict/mode-smarty.js +2635 -0
- package/src-noconflict/mode-snippets.js +207 -0
- package/src-noconflict/mode-soy_template.js +2848 -0
- package/src-noconflict/mode-space.js +167 -0
- package/src-noconflict/mode-sparql.js +320 -0
- package/src-noconflict/mode-sql.js +271 -0
- package/src-noconflict/mode-sqlserver.js +445 -0
- package/src-noconflict/mode-stylus.js +472 -0
- package/src-noconflict/mode-svg.js +1582 -0
- package/src-noconflict/mode-swift.js +395 -0
- package/src-noconflict/mode-tcl.js +387 -0
- package/src-noconflict/mode-terraform.js +400 -0
- package/src-noconflict/mode-tex.js +160 -0
- package/src-noconflict/mode-text.js +9 -0
- package/src-noconflict/mode-textile.js +150 -0
- package/src-noconflict/mode-toml.js +153 -0
- package/src-noconflict/mode-tsx.js +888 -0
- package/src-noconflict/mode-turtle.js +296 -0
- package/src-noconflict/mode-twig.js +2693 -0
- package/src-noconflict/mode-typescript.js +869 -0
- package/src-noconflict/mode-vala.js +677 -0
- package/src-noconflict/mode-vbscript.js +635 -0
- package/src-noconflict/mode-velocity.js +2792 -0
- package/src-noconflict/mode-verilog.js +118 -0
- package/src-noconflict/mode-vhdl.js +116 -0
- package/src-noconflict/mode-visualforce.js +2640 -0
- package/src-noconflict/mode-wollok.js +914 -0
- package/src-noconflict/mode-xml.js +676 -0
- package/src-noconflict/mode-xquery.js +2644 -0
- package/src-noconflict/mode-yaml.js +330 -0
- package/src-noconflict/mode-zeek.js +539 -0
- package/src-noconflict/qurator-mode.js +120 -0
- package/src-noconflict/qurator-worker.js +91 -0
- package/src-noconflict/snippets/abap.js +9 -0
- package/src-noconflict/snippets/abc.js +45 -0
- package/src-noconflict/snippets/actionscript.js +171 -0
- package/src-noconflict/snippets/ada.js +9 -0
- package/src-noconflict/snippets/apache_conf.js +9 -0
- package/src-noconflict/snippets/apex.js +9 -0
- package/src-noconflict/snippets/applescript.js +9 -0
- package/src-noconflict/snippets/aql.js +9 -0
- package/src-noconflict/snippets/asciidoc.js +9 -0
- package/src-noconflict/snippets/asl.js +9 -0
- package/src-noconflict/snippets/assembly_x86.js +9 -0
- package/src-noconflict/snippets/autohotkey.js +9 -0
- package/src-noconflict/snippets/batchfile.js +9 -0
- package/src-noconflict/snippets/c9search.js +9 -0
- package/src-noconflict/snippets/c_cpp.js +145 -0
- package/src-noconflict/snippets/cirru.js +9 -0
- package/src-noconflict/snippets/clojure.js +104 -0
- package/src-noconflict/snippets/cobol.js +9 -0
- package/src-noconflict/snippets/coffee.js +109 -0
- package/src-noconflict/snippets/coldfusion.js +9 -0
- package/src-noconflict/snippets/crystal.js +9 -0
- package/src-noconflict/snippets/csharp.js +9 -0
- package/src-noconflict/snippets/csound_document.js +24 -0
- package/src-noconflict/snippets/csound_orchestra.js +61 -0
- package/src-noconflict/snippets/csound_score.js +9 -0
- package/src-noconflict/snippets/csp.js +9 -0
- package/src-noconflict/snippets/css.js +981 -0
- package/src-noconflict/snippets/curly.js +9 -0
- package/src-noconflict/snippets/d.js +9 -0
- package/src-noconflict/snippets/dart.js +97 -0
- package/src-noconflict/snippets/diff.js +25 -0
- package/src-noconflict/snippets/django.js +122 -0
- package/src-noconflict/snippets/dockerfile.js +9 -0
- package/src-noconflict/snippets/dot.js +9 -0
- package/src-noconflict/snippets/drools.js +33 -0
- package/src-noconflict/snippets/edifact.js +254 -0
- package/src-noconflict/snippets/eiffel.js +9 -0
- package/src-noconflict/snippets/ejs.js +9 -0
- package/src-noconflict/snippets/elixir.js +9 -0
- package/src-noconflict/snippets/elm.js +9 -0
- package/src-noconflict/snippets/erlang.js +174 -0
- package/src-noconflict/snippets/forth.js +9 -0
- package/src-noconflict/snippets/fortran.js +9 -0
- package/src-noconflict/snippets/fsharp.js +9 -0
- package/src-noconflict/snippets/fsl.js +14 -0
- package/src-noconflict/snippets/ftl.js +9 -0
- package/src-noconflict/snippets/gcode.js +9 -0
- package/src-noconflict/snippets/gherkin.js +9 -0
- package/src-noconflict/snippets/gitignore.js +9 -0
- package/src-noconflict/snippets/glsl.js +9 -0
- package/src-noconflict/snippets/gobstones.js +1718 -0
- package/src-noconflict/snippets/golang.js +9 -0
- package/src-noconflict/snippets/graphqlschema.js +46 -0
- package/src-noconflict/snippets/groovy.js +9 -0
- package/src-noconflict/snippets/haml.js +34 -0
- package/src-noconflict/snippets/handlebars.js +9 -0
- package/src-noconflict/snippets/haskell.js +96 -0
- package/src-noconflict/snippets/haskell_cabal.js +9 -0
- package/src-noconflict/snippets/haxe.js +9 -0
- package/src-noconflict/snippets/hjson.js +9 -0
- package/src-noconflict/snippets/html.js +867 -0
- package/src-noconflict/snippets/html_elixir.js +9 -0
- package/src-noconflict/snippets/html_ruby.js +9 -0
- package/src-noconflict/snippets/ini.js +9 -0
- package/src-noconflict/snippets/io.js +76 -0
- package/src-noconflict/snippets/jack.js +9 -0
- package/src-noconflict/snippets/jade.js +9 -0
- package/src-noconflict/snippets/java.js +254 -0
- package/src-noconflict/snippets/javascript.js +209 -0
- package/src-noconflict/snippets/json.js +9 -0
- package/src-noconflict/snippets/jsoniq.js +75 -0
- package/src-noconflict/snippets/jsp.js +113 -0
- package/src-noconflict/snippets/jssm.js +9 -0
- package/src-noconflict/snippets/jsx.js +9 -0
- package/src-noconflict/snippets/julia.js +9 -0
- package/src-noconflict/snippets/kotlin.js +9 -0
- package/src-noconflict/snippets/latex.js +9 -0
- package/src-noconflict/snippets/less.js +9 -0
- package/src-noconflict/snippets/liquid.js +895 -0
- package/src-noconflict/snippets/lisp.js +9 -0
- package/src-noconflict/snippets/livescript.js +9 -0
- package/src-noconflict/snippets/logiql.js +9 -0
- package/src-noconflict/snippets/logtalk.js +9 -0
- package/src-noconflict/snippets/lsl.js +1246 -0
- package/src-noconflict/snippets/lua.js +35 -0
- package/src-noconflict/snippets/luapage.js +9 -0
- package/src-noconflict/snippets/lucene.js +9 -0
- package/src-noconflict/snippets/makefile.js +18 -0
- package/src-noconflict/snippets/markdown.js +102 -0
- package/src-noconflict/snippets/mask.js +9 -0
- package/src-noconflict/snippets/matlab.js +9 -0
- package/src-noconflict/snippets/maze.js +23 -0
- package/src-noconflict/snippets/mel.js +9 -0
- package/src-noconflict/snippets/mixal.js +9 -0
- package/src-noconflict/snippets/mushcode.js +9 -0
- package/src-noconflict/snippets/mysql.js +9 -0
- package/src-noconflict/snippets/nginx.js +9 -0
- package/src-noconflict/snippets/nim.js +9 -0
- package/src-noconflict/snippets/nix.js +9 -0
- package/src-noconflict/snippets/nsis.js +9 -0
- package/src-noconflict/snippets/objectivec.js +9 -0
- package/src-noconflict/snippets/ocaml.js +9 -0
- package/src-noconflict/snippets/pascal.js +9 -0
- package/src-noconflict/snippets/perl.js +361 -0
- package/src-noconflict/snippets/pgsql.js +9 -0
- package/src-noconflict/snippets/php.js +397 -0
- package/src-noconflict/snippets/php_laravel_blade.js +9 -0
- package/src-noconflict/snippets/pig.js +9 -0
- package/src-noconflict/snippets/plain_text.js +9 -0
- package/src-noconflict/snippets/powershell.js +9 -0
- package/src-noconflict/snippets/praat.js +9 -0
- package/src-noconflict/snippets/prolog.js +9 -0
- package/src-noconflict/snippets/properties.js +9 -0
- package/src-noconflict/snippets/protobuf.js +9 -0
- package/src-noconflict/snippets/puppet.js +9 -0
- package/src-noconflict/snippets/python.js +172 -0
- package/src-noconflict/snippets/r.js +135 -0
- package/src-noconflict/snippets/razor.js +17 -0
- package/src-noconflict/snippets/rdoc.js +9 -0
- package/src-noconflict/snippets/red.js +9 -0
- package/src-noconflict/snippets/redshift.js +9 -0
- package/src-noconflict/snippets/rhtml.js +9 -0
- package/src-noconflict/snippets/rst.js +36 -0
- package/src-noconflict/snippets/ruby.js +942 -0
- package/src-noconflict/snippets/rust.js +9 -0
- package/src-noconflict/snippets/sass.js +9 -0
- package/src-noconflict/snippets/scad.js +9 -0
- package/src-noconflict/snippets/scala.js +9 -0
- package/src-noconflict/snippets/scheme.js +9 -0
- package/src-noconflict/snippets/scss.js +9 -0
- package/src-noconflict/snippets/sh.js +97 -0
- package/src-noconflict/snippets/sjs.js +9 -0
- package/src-noconflict/snippets/slim.js +9 -0
- package/src-noconflict/snippets/smarty.js +9 -0
- package/src-noconflict/snippets/snippets.js +23 -0
- package/src-noconflict/snippets/soy_template.js +9 -0
- package/src-noconflict/snippets/space.js +9 -0
- package/src-noconflict/snippets/sparql.js +9 -0
- package/src-noconflict/snippets/sql.js +40 -0
- package/src-noconflict/snippets/sqlserver.js +83 -0
- package/src-noconflict/snippets/stylus.js +9 -0
- package/src-noconflict/snippets/svg.js +9 -0
- package/src-noconflict/snippets/swift.js +9 -0
- package/src-noconflict/snippets/tcl.js +106 -0
- package/src-noconflict/snippets/terraform.js +9 -0
- package/src-noconflict/snippets/tex.js +204 -0
- package/src-noconflict/snippets/text.js +9 -0
- package/src-noconflict/snippets/textile.js +44 -0
- package/src-noconflict/snippets/toml.js +9 -0
- package/src-noconflict/snippets/tsx.js +9 -0
- package/src-noconflict/snippets/turtle.js +9 -0
- package/src-noconflict/snippets/twig.js +9 -0
- package/src-noconflict/snippets/typescript.js +9 -0
- package/src-noconflict/snippets/vala.js +200 -0
- package/src-noconflict/snippets/vbscript.js +9 -0
- package/src-noconflict/snippets/velocity.js +43 -0
- package/src-noconflict/snippets/verilog.js +9 -0
- package/src-noconflict/snippets/vhdl.js +9 -0
- package/src-noconflict/snippets/visualforce.js +9 -0
- package/src-noconflict/snippets/wollok.js +98 -0
- package/src-noconflict/snippets/xml.js +9 -0
- package/src-noconflict/snippets/xquery.js +75 -0
- package/src-noconflict/snippets/yaml.js +9 -0
- package/src-noconflict/snippets/zeek.js +9 -0
- package/src-noconflict/theme-ambiance.js +185 -0
- package/src-noconflict/theme-chaos.js +163 -0
- package/src-noconflict/theme-chrome.js +135 -0
- package/src-noconflict/theme-clouds.js +102 -0
- package/src-noconflict/theme-clouds_midnight.js +103 -0
- package/src-noconflict/theme-cobalt.js +120 -0
- package/src-noconflict/theme-crimson_editor.js +125 -0
- package/src-noconflict/theme-dawn.js +115 -0
- package/src-noconflict/theme-dracula.js +135 -0
- package/src-noconflict/theme-dreamweaver.js +148 -0
- package/src-noconflict/theme-eclipse.js +105 -0
- package/src-noconflict/theme-github.js +110 -0
- package/src-noconflict/theme-gob.js +119 -0
- package/src-noconflict/theme-gruvbox.js +89 -0
- package/src-noconflict/theme-idle_fingers.js +103 -0
- package/src-noconflict/theme-iplastic.js +128 -0
- package/src-noconflict/theme-katzenmilch.js +128 -0
- package/src-noconflict/theme-kr_theme.js +111 -0
- package/src-noconflict/theme-kuroir.js +68 -0
- package/src-noconflict/theme-merbivore.js +102 -0
- package/src-noconflict/theme-merbivore_soft.js +103 -0
- package/src-noconflict/theme-mono_industrial.js +114 -0
- package/src-noconflict/theme-monokai.js +112 -0
- package/src-noconflict/theme-pastel_on_dark.js +115 -0
- package/src-noconflict/theme-solarized_dark.js +95 -0
- package/src-noconflict/theme-solarized_light.js +98 -0
- package/src-noconflict/theme-sqlserver.js +145 -0
- package/src-noconflict/theme-terminal.js +121 -0
- package/src-noconflict/theme-textmate.js +137 -0
- package/src-noconflict/theme-tomorrow.js +115 -0
- package/src-noconflict/theme-tomorrow_night.js +115 -0
- package/src-noconflict/theme-tomorrow_night_blue.js +113 -0
- package/src-noconflict/theme-tomorrow_night_bright.js +128 -0
- package/src-noconflict/theme-tomorrow_night_eighties.js +115 -0
- package/src-noconflict/theme-twilight.js +116 -0
- package/src-noconflict/theme-vibrant_ink.js +101 -0
- package/src-noconflict/theme-xcode.js +95 -0
- package/src-noconflict/worker-coffee.js +1470 -0
- package/src-noconflict/worker-css.js +9000 -0
- package/src-noconflict/worker-html.js +10922 -0
- package/src-noconflict/worker-javascript.js +15001 -0
- package/src-noconflict/worker-json.js +1715 -0
- package/src-noconflict/worker-lua.js +3608 -0
- package/src-noconflict/worker-php.js +3687 -0
- package/src-noconflict/worker-xml.js +3208 -0
- package/src-noconflict/worker-xquery.js +57668 -0
|
@@ -0,0 +1,676 @@
|
|
|
1
|
+
ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var oop = require("../lib/oop");
|
|
5
|
+
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
|
6
|
+
|
|
7
|
+
var XmlHighlightRules = function(normalize) {
|
|
8
|
+
var tagRegex = "[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*";
|
|
9
|
+
|
|
10
|
+
this.$rules = {
|
|
11
|
+
start : [
|
|
12
|
+
{token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"},
|
|
13
|
+
{
|
|
14
|
+
token : ["punctuation.instruction.xml", "keyword.instruction.xml"],
|
|
15
|
+
regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction"
|
|
16
|
+
},
|
|
17
|
+
{token : "comment.start.xml", regex : "<\\!--", next : "comment"},
|
|
18
|
+
{
|
|
19
|
+
token : ["xml-pe.doctype.xml", "xml-pe.doctype.xml"],
|
|
20
|
+
regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype", caseInsensitive: true
|
|
21
|
+
},
|
|
22
|
+
{include : "tag"},
|
|
23
|
+
{token : "text.end-tag-open.xml", regex: "</"},
|
|
24
|
+
{token : "text.tag-open.xml", regex: "<"},
|
|
25
|
+
{include : "reference"},
|
|
26
|
+
{defaultToken : "text.xml"}
|
|
27
|
+
],
|
|
28
|
+
|
|
29
|
+
processing_instruction : [{
|
|
30
|
+
token : "entity.other.attribute-name.decl-attribute-name.xml",
|
|
31
|
+
regex : tagRegex
|
|
32
|
+
}, {
|
|
33
|
+
token : "keyword.operator.decl-attribute-equals.xml",
|
|
34
|
+
regex : "="
|
|
35
|
+
}, {
|
|
36
|
+
include: "whitespace"
|
|
37
|
+
}, {
|
|
38
|
+
include: "string"
|
|
39
|
+
}, {
|
|
40
|
+
token : "punctuation.xml-decl.xml",
|
|
41
|
+
regex : "\\?>",
|
|
42
|
+
next : "start"
|
|
43
|
+
}],
|
|
44
|
+
|
|
45
|
+
doctype : [
|
|
46
|
+
{include : "whitespace"},
|
|
47
|
+
{include : "string"},
|
|
48
|
+
{token : "xml-pe.doctype.xml", regex : ">", next : "start"},
|
|
49
|
+
{token : "xml-pe.xml", regex : "[-_a-zA-Z0-9:]+"},
|
|
50
|
+
{token : "punctuation.int-subset", regex : "\\[", push : "int_subset"}
|
|
51
|
+
],
|
|
52
|
+
|
|
53
|
+
int_subset : [{
|
|
54
|
+
token : "text.xml",
|
|
55
|
+
regex : "\\s+"
|
|
56
|
+
}, {
|
|
57
|
+
token: "punctuation.int-subset.xml",
|
|
58
|
+
regex: "]",
|
|
59
|
+
next: "pop"
|
|
60
|
+
}, {
|
|
61
|
+
token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"],
|
|
62
|
+
regex : "(<\\!)(" + tagRegex + ")",
|
|
63
|
+
push : [{
|
|
64
|
+
token : "text",
|
|
65
|
+
regex : "\\s+"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
token : "punctuation.markup-decl.xml",
|
|
69
|
+
regex : ">",
|
|
70
|
+
next : "pop"
|
|
71
|
+
},
|
|
72
|
+
{include : "string"}]
|
|
73
|
+
}],
|
|
74
|
+
|
|
75
|
+
cdata : [
|
|
76
|
+
{token : "string.cdata.xml", regex : "\\]\\]>", next : "start"},
|
|
77
|
+
{token : "text.xml", regex : "\\s+"},
|
|
78
|
+
{token : "text.xml", regex : "(?:[^\\]]|\\](?!\\]>))+"}
|
|
79
|
+
],
|
|
80
|
+
|
|
81
|
+
comment : [
|
|
82
|
+
{token : "comment.end.xml", regex : "-->", next : "start"},
|
|
83
|
+
{defaultToken : "comment.xml"}
|
|
84
|
+
],
|
|
85
|
+
|
|
86
|
+
reference : [{
|
|
87
|
+
token : "constant.language.escape.reference.xml",
|
|
88
|
+
regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
|
|
89
|
+
}],
|
|
90
|
+
|
|
91
|
+
attr_reference : [{
|
|
92
|
+
token : "constant.language.escape.reference.attribute-value.xml",
|
|
93
|
+
regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
|
|
94
|
+
}],
|
|
95
|
+
|
|
96
|
+
tag : [{
|
|
97
|
+
token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"],
|
|
98
|
+
regex : "(?:(<)|(</))((?:" + tagRegex + ":)?" + tagRegex + ")",
|
|
99
|
+
next: [
|
|
100
|
+
{include : "attributes"},
|
|
101
|
+
{token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : "start"}
|
|
102
|
+
]
|
|
103
|
+
}],
|
|
104
|
+
|
|
105
|
+
tag_whitespace : [
|
|
106
|
+
{token : "text.tag-whitespace.xml", regex : "\\s+"}
|
|
107
|
+
],
|
|
108
|
+
whitespace : [
|
|
109
|
+
{token : "text.whitespace.xml", regex : "\\s+"}
|
|
110
|
+
],
|
|
111
|
+
string: [{
|
|
112
|
+
token : "string.xml",
|
|
113
|
+
regex : "'",
|
|
114
|
+
push : [
|
|
115
|
+
{token : "string.xml", regex: "'", next: "pop"},
|
|
116
|
+
{defaultToken : "string.xml"}
|
|
117
|
+
]
|
|
118
|
+
}, {
|
|
119
|
+
token : "string.xml",
|
|
120
|
+
regex : '"',
|
|
121
|
+
push : [
|
|
122
|
+
{token : "string.xml", regex: '"', next: "pop"},
|
|
123
|
+
{defaultToken : "string.xml"}
|
|
124
|
+
]
|
|
125
|
+
}],
|
|
126
|
+
|
|
127
|
+
attributes: [{
|
|
128
|
+
token : "entity.other.attribute-name.xml",
|
|
129
|
+
regex : tagRegex
|
|
130
|
+
}, {
|
|
131
|
+
token : "keyword.operator.attribute-equals.xml",
|
|
132
|
+
regex : "="
|
|
133
|
+
}, {
|
|
134
|
+
include: "tag_whitespace"
|
|
135
|
+
}, {
|
|
136
|
+
include: "attribute_value"
|
|
137
|
+
}],
|
|
138
|
+
|
|
139
|
+
attribute_value: [{
|
|
140
|
+
token : "string.attribute-value.xml",
|
|
141
|
+
regex : "'",
|
|
142
|
+
push : [
|
|
143
|
+
{token : "string.attribute-value.xml", regex: "'", next: "pop"},
|
|
144
|
+
{include : "attr_reference"},
|
|
145
|
+
{defaultToken : "string.attribute-value.xml"}
|
|
146
|
+
]
|
|
147
|
+
}, {
|
|
148
|
+
token : "string.attribute-value.xml",
|
|
149
|
+
regex : '"',
|
|
150
|
+
push : [
|
|
151
|
+
{token : "string.attribute-value.xml", regex: '"', next: "pop"},
|
|
152
|
+
{include : "attr_reference"},
|
|
153
|
+
{defaultToken : "string.attribute-value.xml"}
|
|
154
|
+
]
|
|
155
|
+
}]
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
if (this.constructor === XmlHighlightRules)
|
|
159
|
+
this.normalizeRules();
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
(function() {
|
|
164
|
+
|
|
165
|
+
this.embedTagRules = function(HighlightRules, prefix, tag){
|
|
166
|
+
this.$rules.tag.unshift({
|
|
167
|
+
token : ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
|
|
168
|
+
regex : "(<)(" + tag + "(?=\\s|>|$))",
|
|
169
|
+
next: [
|
|
170
|
+
{include : "attributes"},
|
|
171
|
+
{token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : prefix + "start"}
|
|
172
|
+
]
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
this.$rules[tag + "-end"] = [
|
|
176
|
+
{include : "attributes"},
|
|
177
|
+
{token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next: "start",
|
|
178
|
+
onMatch : function(value, currentState, stack) {
|
|
179
|
+
stack.splice(0);
|
|
180
|
+
return this.token;
|
|
181
|
+
}}
|
|
182
|
+
];
|
|
183
|
+
|
|
184
|
+
this.embedRules(HighlightRules, prefix, [{
|
|
185
|
+
token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
|
|
186
|
+
regex : "(</)(" + tag + "(?=\\s|>|$))",
|
|
187
|
+
next: tag + "-end"
|
|
188
|
+
}, {
|
|
189
|
+
token: "string.cdata.xml",
|
|
190
|
+
regex : "<\\!\\[CDATA\\["
|
|
191
|
+
}, {
|
|
192
|
+
token: "string.cdata.xml",
|
|
193
|
+
regex : "\\]\\]>"
|
|
194
|
+
}]);
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
}).call(TextHighlightRules.prototype);
|
|
198
|
+
|
|
199
|
+
oop.inherits(XmlHighlightRules, TextHighlightRules);
|
|
200
|
+
|
|
201
|
+
exports.XmlHighlightRules = XmlHighlightRules;
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) {
|
|
205
|
+
"use strict";
|
|
206
|
+
|
|
207
|
+
var oop = require("../../lib/oop");
|
|
208
|
+
var Behaviour = require("../behaviour").Behaviour;
|
|
209
|
+
var TokenIterator = require("../../token_iterator").TokenIterator;
|
|
210
|
+
var lang = require("../../lib/lang");
|
|
211
|
+
|
|
212
|
+
function is(token, type) {
|
|
213
|
+
return token && token.type.lastIndexOf(type + ".xml") > -1;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
var XmlBehaviour = function () {
|
|
217
|
+
|
|
218
|
+
this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
|
|
219
|
+
if (text == '"' || text == "'") {
|
|
220
|
+
var quote = text;
|
|
221
|
+
var selected = session.doc.getTextRange(editor.getSelectionRange());
|
|
222
|
+
if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
|
|
223
|
+
return {
|
|
224
|
+
text: quote + selected + quote,
|
|
225
|
+
selection: false
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
var cursor = editor.getCursorPosition();
|
|
230
|
+
var line = session.doc.getLine(cursor.row);
|
|
231
|
+
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
|
232
|
+
var iterator = new TokenIterator(session, cursor.row, cursor.column);
|
|
233
|
+
var token = iterator.getCurrentToken();
|
|
234
|
+
|
|
235
|
+
if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
|
|
236
|
+
return {
|
|
237
|
+
text: "",
|
|
238
|
+
selection: [1, 1]
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
if (!token)
|
|
243
|
+
token = iterator.stepBackward();
|
|
244
|
+
|
|
245
|
+
if (!token)
|
|
246
|
+
return;
|
|
247
|
+
|
|
248
|
+
while (is(token, "tag-whitespace") || is(token, "whitespace")) {
|
|
249
|
+
token = iterator.stepBackward();
|
|
250
|
+
}
|
|
251
|
+
var rightSpace = !rightChar || rightChar.match(/\s/);
|
|
252
|
+
if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
|
|
253
|
+
return {
|
|
254
|
+
text: quote + quote,
|
|
255
|
+
selection: [1, 1]
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
this.add("string_dquotes", "deletion", function(state, action, editor, session, range) {
|
|
262
|
+
var selected = session.doc.getTextRange(range);
|
|
263
|
+
if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
|
|
264
|
+
var line = session.doc.getLine(range.start.row);
|
|
265
|
+
var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
|
|
266
|
+
if (rightChar == selected) {
|
|
267
|
+
range.end.column++;
|
|
268
|
+
return range;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
|
|
274
|
+
if (text == '>') {
|
|
275
|
+
var position = editor.getSelectionRange().start;
|
|
276
|
+
var iterator = new TokenIterator(session, position.row, position.column);
|
|
277
|
+
var token = iterator.getCurrentToken() || iterator.stepBackward();
|
|
278
|
+
if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
|
|
279
|
+
return;
|
|
280
|
+
if (is(token, "reference.attribute-value"))
|
|
281
|
+
return;
|
|
282
|
+
if (is(token, "attribute-value")) {
|
|
283
|
+
var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
|
|
284
|
+
if (position.column < tokenEndColumn)
|
|
285
|
+
return;
|
|
286
|
+
if (position.column == tokenEndColumn) {
|
|
287
|
+
var nextToken = iterator.stepForward();
|
|
288
|
+
if (nextToken && is(nextToken, "attribute-value"))
|
|
289
|
+
return;
|
|
290
|
+
iterator.stepBackward();
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
|
|
295
|
+
return;
|
|
296
|
+
while (!is(token, "tag-name")) {
|
|
297
|
+
token = iterator.stepBackward();
|
|
298
|
+
if (token.value == "<") {
|
|
299
|
+
token = iterator.stepForward();
|
|
300
|
+
break;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
var tokenRow = iterator.getCurrentTokenRow();
|
|
305
|
+
var tokenColumn = iterator.getCurrentTokenColumn();
|
|
306
|
+
if (is(iterator.stepBackward(), "end-tag-open"))
|
|
307
|
+
return;
|
|
308
|
+
|
|
309
|
+
var element = token.value;
|
|
310
|
+
if (tokenRow == position.row)
|
|
311
|
+
element = element.substring(0, position.column - tokenColumn);
|
|
312
|
+
|
|
313
|
+
if (this.voidElements.hasOwnProperty(element.toLowerCase()))
|
|
314
|
+
return;
|
|
315
|
+
|
|
316
|
+
return {
|
|
317
|
+
text: ">" + "</" + element + ">",
|
|
318
|
+
selection: [1, 1]
|
|
319
|
+
};
|
|
320
|
+
}
|
|
321
|
+
});
|
|
322
|
+
|
|
323
|
+
this.add("autoindent", "insertion", function (state, action, editor, session, text) {
|
|
324
|
+
if (text == "\n") {
|
|
325
|
+
var cursor = editor.getCursorPosition();
|
|
326
|
+
var line = session.getLine(cursor.row);
|
|
327
|
+
var iterator = new TokenIterator(session, cursor.row, cursor.column);
|
|
328
|
+
var token = iterator.getCurrentToken();
|
|
329
|
+
|
|
330
|
+
if (token && token.type.indexOf("tag-close") !== -1) {
|
|
331
|
+
if (token.value == "/>")
|
|
332
|
+
return;
|
|
333
|
+
while (token && token.type.indexOf("tag-name") === -1) {
|
|
334
|
+
token = iterator.stepBackward();
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
if (!token) {
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
var tag = token.value;
|
|
342
|
+
var row = iterator.getCurrentTokenRow();
|
|
343
|
+
token = iterator.stepBackward();
|
|
344
|
+
if (!token || token.type.indexOf("end-tag") !== -1) {
|
|
345
|
+
return;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
if (this.voidElements && !this.voidElements[tag]) {
|
|
349
|
+
var nextToken = session.getTokenAt(cursor.row, cursor.column+1);
|
|
350
|
+
var line = session.getLine(row);
|
|
351
|
+
var nextIndent = this.$getIndent(line);
|
|
352
|
+
var indent = nextIndent + session.getTabString();
|
|
353
|
+
|
|
354
|
+
if (nextToken && nextToken.value === "</") {
|
|
355
|
+
return {
|
|
356
|
+
text: "\n" + indent + "\n" + nextIndent,
|
|
357
|
+
selection: [1, indent.length, 1, indent.length]
|
|
358
|
+
};
|
|
359
|
+
} else {
|
|
360
|
+
return {
|
|
361
|
+
text: "\n" + indent
|
|
362
|
+
};
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
});
|
|
368
|
+
|
|
369
|
+
};
|
|
370
|
+
|
|
371
|
+
oop.inherits(XmlBehaviour, Behaviour);
|
|
372
|
+
|
|
373
|
+
exports.XmlBehaviour = XmlBehaviour;
|
|
374
|
+
});
|
|
375
|
+
|
|
376
|
+
ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/range","ace/mode/folding/fold_mode","ace/token_iterator"], function(require, exports, module) {
|
|
377
|
+
"use strict";
|
|
378
|
+
|
|
379
|
+
var oop = require("../../lib/oop");
|
|
380
|
+
var lang = require("../../lib/lang");
|
|
381
|
+
var Range = require("../../range").Range;
|
|
382
|
+
var BaseFoldMode = require("./fold_mode").FoldMode;
|
|
383
|
+
var TokenIterator = require("../../token_iterator").TokenIterator;
|
|
384
|
+
|
|
385
|
+
var FoldMode = exports.FoldMode = function(voidElements, optionalEndTags) {
|
|
386
|
+
BaseFoldMode.call(this);
|
|
387
|
+
this.voidElements = voidElements || {};
|
|
388
|
+
this.optionalEndTags = oop.mixin({}, this.voidElements);
|
|
389
|
+
if (optionalEndTags)
|
|
390
|
+
oop.mixin(this.optionalEndTags, optionalEndTags);
|
|
391
|
+
|
|
392
|
+
};
|
|
393
|
+
oop.inherits(FoldMode, BaseFoldMode);
|
|
394
|
+
|
|
395
|
+
var Tag = function() {
|
|
396
|
+
this.tagName = "";
|
|
397
|
+
this.closing = false;
|
|
398
|
+
this.selfClosing = false;
|
|
399
|
+
this.start = {row: 0, column: 0};
|
|
400
|
+
this.end = {row: 0, column: 0};
|
|
401
|
+
};
|
|
402
|
+
|
|
403
|
+
function is(token, type) {
|
|
404
|
+
return token.type.lastIndexOf(type + ".xml") > -1;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
(function() {
|
|
408
|
+
|
|
409
|
+
this.getFoldWidget = function(session, foldStyle, row) {
|
|
410
|
+
var tag = this._getFirstTagInLine(session, row);
|
|
411
|
+
|
|
412
|
+
if (!tag)
|
|
413
|
+
return this.getCommentFoldWidget(session, row);
|
|
414
|
+
|
|
415
|
+
if (tag.closing || (!tag.tagName && tag.selfClosing))
|
|
416
|
+
return foldStyle == "markbeginend" ? "end" : "";
|
|
417
|
+
|
|
418
|
+
if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
|
|
419
|
+
return "";
|
|
420
|
+
|
|
421
|
+
if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
|
|
422
|
+
return "";
|
|
423
|
+
|
|
424
|
+
return "start";
|
|
425
|
+
};
|
|
426
|
+
|
|
427
|
+
this.getCommentFoldWidget = function(session, row) {
|
|
428
|
+
if (/comment/.test(session.getState(row)) && /<!-/.test(session.getLine(row)))
|
|
429
|
+
return "start";
|
|
430
|
+
return "";
|
|
431
|
+
};
|
|
432
|
+
this._getFirstTagInLine = function(session, row) {
|
|
433
|
+
var tokens = session.getTokens(row);
|
|
434
|
+
var tag = new Tag();
|
|
435
|
+
|
|
436
|
+
for (var i = 0; i < tokens.length; i++) {
|
|
437
|
+
var token = tokens[i];
|
|
438
|
+
if (is(token, "tag-open")) {
|
|
439
|
+
tag.end.column = tag.start.column + token.value.length;
|
|
440
|
+
tag.closing = is(token, "end-tag-open");
|
|
441
|
+
token = tokens[++i];
|
|
442
|
+
if (!token)
|
|
443
|
+
return null;
|
|
444
|
+
tag.tagName = token.value;
|
|
445
|
+
tag.end.column += token.value.length;
|
|
446
|
+
for (i++; i < tokens.length; i++) {
|
|
447
|
+
token = tokens[i];
|
|
448
|
+
tag.end.column += token.value.length;
|
|
449
|
+
if (is(token, "tag-close")) {
|
|
450
|
+
tag.selfClosing = token.value == '/>';
|
|
451
|
+
break;
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
return tag;
|
|
455
|
+
} else if (is(token, "tag-close")) {
|
|
456
|
+
tag.selfClosing = token.value == '/>';
|
|
457
|
+
return tag;
|
|
458
|
+
}
|
|
459
|
+
tag.start.column += token.value.length;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
return null;
|
|
463
|
+
};
|
|
464
|
+
|
|
465
|
+
this._findEndTagInLine = function(session, row, tagName, startColumn) {
|
|
466
|
+
var tokens = session.getTokens(row);
|
|
467
|
+
var column = 0;
|
|
468
|
+
for (var i = 0; i < tokens.length; i++) {
|
|
469
|
+
var token = tokens[i];
|
|
470
|
+
column += token.value.length;
|
|
471
|
+
if (column < startColumn)
|
|
472
|
+
continue;
|
|
473
|
+
if (is(token, "end-tag-open")) {
|
|
474
|
+
token = tokens[i + 1];
|
|
475
|
+
if (token && token.value == tagName)
|
|
476
|
+
return true;
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
return false;
|
|
480
|
+
};
|
|
481
|
+
this._readTagForward = function(iterator) {
|
|
482
|
+
var token = iterator.getCurrentToken();
|
|
483
|
+
if (!token)
|
|
484
|
+
return null;
|
|
485
|
+
|
|
486
|
+
var tag = new Tag();
|
|
487
|
+
do {
|
|
488
|
+
if (is(token, "tag-open")) {
|
|
489
|
+
tag.closing = is(token, "end-tag-open");
|
|
490
|
+
tag.start.row = iterator.getCurrentTokenRow();
|
|
491
|
+
tag.start.column = iterator.getCurrentTokenColumn();
|
|
492
|
+
} else if (is(token, "tag-name")) {
|
|
493
|
+
tag.tagName = token.value;
|
|
494
|
+
} else if (is(token, "tag-close")) {
|
|
495
|
+
tag.selfClosing = token.value == "/>";
|
|
496
|
+
tag.end.row = iterator.getCurrentTokenRow();
|
|
497
|
+
tag.end.column = iterator.getCurrentTokenColumn() + token.value.length;
|
|
498
|
+
iterator.stepForward();
|
|
499
|
+
return tag;
|
|
500
|
+
}
|
|
501
|
+
} while(token = iterator.stepForward());
|
|
502
|
+
|
|
503
|
+
return null;
|
|
504
|
+
};
|
|
505
|
+
|
|
506
|
+
this._readTagBackward = function(iterator) {
|
|
507
|
+
var token = iterator.getCurrentToken();
|
|
508
|
+
if (!token)
|
|
509
|
+
return null;
|
|
510
|
+
|
|
511
|
+
var tag = new Tag();
|
|
512
|
+
do {
|
|
513
|
+
if (is(token, "tag-open")) {
|
|
514
|
+
tag.closing = is(token, "end-tag-open");
|
|
515
|
+
tag.start.row = iterator.getCurrentTokenRow();
|
|
516
|
+
tag.start.column = iterator.getCurrentTokenColumn();
|
|
517
|
+
iterator.stepBackward();
|
|
518
|
+
return tag;
|
|
519
|
+
} else if (is(token, "tag-name")) {
|
|
520
|
+
tag.tagName = token.value;
|
|
521
|
+
} else if (is(token, "tag-close")) {
|
|
522
|
+
tag.selfClosing = token.value == "/>";
|
|
523
|
+
tag.end.row = iterator.getCurrentTokenRow();
|
|
524
|
+
tag.end.column = iterator.getCurrentTokenColumn() + token.value.length;
|
|
525
|
+
}
|
|
526
|
+
} while(token = iterator.stepBackward());
|
|
527
|
+
|
|
528
|
+
return null;
|
|
529
|
+
};
|
|
530
|
+
|
|
531
|
+
this._pop = function(stack, tag) {
|
|
532
|
+
while (stack.length) {
|
|
533
|
+
|
|
534
|
+
var top = stack[stack.length-1];
|
|
535
|
+
if (!tag || top.tagName == tag.tagName) {
|
|
536
|
+
return stack.pop();
|
|
537
|
+
}
|
|
538
|
+
else if (this.optionalEndTags.hasOwnProperty(top.tagName)) {
|
|
539
|
+
stack.pop();
|
|
540
|
+
continue;
|
|
541
|
+
} else {
|
|
542
|
+
return null;
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
};
|
|
546
|
+
|
|
547
|
+
this.getFoldWidgetRange = function(session, foldStyle, row) {
|
|
548
|
+
var firstTag = this._getFirstTagInLine(session, row);
|
|
549
|
+
|
|
550
|
+
if (!firstTag) {
|
|
551
|
+
return this.getCommentFoldWidget(session, row)
|
|
552
|
+
&& session.getCommentFoldRange(row, session.getLine(row).length);
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
var isBackward = firstTag.closing || firstTag.selfClosing;
|
|
556
|
+
var stack = [];
|
|
557
|
+
var tag;
|
|
558
|
+
|
|
559
|
+
if (!isBackward) {
|
|
560
|
+
var iterator = new TokenIterator(session, row, firstTag.start.column);
|
|
561
|
+
var start = {
|
|
562
|
+
row: row,
|
|
563
|
+
column: firstTag.start.column + firstTag.tagName.length + 2
|
|
564
|
+
};
|
|
565
|
+
if (firstTag.start.row == firstTag.end.row)
|
|
566
|
+
start.column = firstTag.end.column;
|
|
567
|
+
while (tag = this._readTagForward(iterator)) {
|
|
568
|
+
if (tag.selfClosing) {
|
|
569
|
+
if (!stack.length) {
|
|
570
|
+
tag.start.column += tag.tagName.length + 2;
|
|
571
|
+
tag.end.column -= 2;
|
|
572
|
+
return Range.fromPoints(tag.start, tag.end);
|
|
573
|
+
} else
|
|
574
|
+
continue;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
if (tag.closing) {
|
|
578
|
+
this._pop(stack, tag);
|
|
579
|
+
if (stack.length == 0)
|
|
580
|
+
return Range.fromPoints(start, tag.start);
|
|
581
|
+
}
|
|
582
|
+
else {
|
|
583
|
+
stack.push(tag);
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
else {
|
|
588
|
+
var iterator = new TokenIterator(session, row, firstTag.end.column);
|
|
589
|
+
var end = {
|
|
590
|
+
row: row,
|
|
591
|
+
column: firstTag.start.column
|
|
592
|
+
};
|
|
593
|
+
|
|
594
|
+
while (tag = this._readTagBackward(iterator)) {
|
|
595
|
+
if (tag.selfClosing) {
|
|
596
|
+
if (!stack.length) {
|
|
597
|
+
tag.start.column += tag.tagName.length + 2;
|
|
598
|
+
tag.end.column -= 2;
|
|
599
|
+
return Range.fromPoints(tag.start, tag.end);
|
|
600
|
+
} else
|
|
601
|
+
continue;
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
if (!tag.closing) {
|
|
605
|
+
this._pop(stack, tag);
|
|
606
|
+
if (stack.length == 0) {
|
|
607
|
+
tag.start.column += tag.tagName.length + 2;
|
|
608
|
+
if (tag.start.row == tag.end.row && tag.start.column < tag.end.column)
|
|
609
|
+
tag.start.column = tag.end.column;
|
|
610
|
+
return Range.fromPoints(tag.start, end);
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
else {
|
|
614
|
+
stack.push(tag);
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
};
|
|
620
|
+
|
|
621
|
+
}).call(FoldMode.prototype);
|
|
622
|
+
|
|
623
|
+
});
|
|
624
|
+
|
|
625
|
+
ace.define("ace/mode/xml",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/xml_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/xml","ace/worker/worker_client"], function(require, exports, module) {
|
|
626
|
+
"use strict";
|
|
627
|
+
|
|
628
|
+
var oop = require("../lib/oop");
|
|
629
|
+
var lang = require("../lib/lang");
|
|
630
|
+
var TextMode = require("./text").Mode;
|
|
631
|
+
var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
|
|
632
|
+
var XmlBehaviour = require("./behaviour/xml").XmlBehaviour;
|
|
633
|
+
var XmlFoldMode = require("./folding/xml").FoldMode;
|
|
634
|
+
var WorkerClient = require("../worker/worker_client").WorkerClient;
|
|
635
|
+
|
|
636
|
+
var Mode = function() {
|
|
637
|
+
this.HighlightRules = XmlHighlightRules;
|
|
638
|
+
this.$behaviour = new XmlBehaviour();
|
|
639
|
+
this.foldingRules = new XmlFoldMode();
|
|
640
|
+
};
|
|
641
|
+
|
|
642
|
+
oop.inherits(Mode, TextMode);
|
|
643
|
+
|
|
644
|
+
(function() {
|
|
645
|
+
|
|
646
|
+
this.voidElements = lang.arrayToMap([]);
|
|
647
|
+
|
|
648
|
+
this.blockComment = {start: "<!--", end: "-->"};
|
|
649
|
+
|
|
650
|
+
this.createWorker = function(session) {
|
|
651
|
+
var worker = new WorkerClient(["ace"], "ace/mode/xml_worker", "Worker");
|
|
652
|
+
worker.attachToDocument(session.getDocument());
|
|
653
|
+
|
|
654
|
+
worker.on("error", function(e) {
|
|
655
|
+
session.setAnnotations(e.data);
|
|
656
|
+
});
|
|
657
|
+
|
|
658
|
+
worker.on("terminate", function() {
|
|
659
|
+
session.clearAnnotations();
|
|
660
|
+
});
|
|
661
|
+
|
|
662
|
+
return worker;
|
|
663
|
+
};
|
|
664
|
+
|
|
665
|
+
this.$id = "ace/mode/xml";
|
|
666
|
+
}).call(Mode.prototype);
|
|
667
|
+
|
|
668
|
+
exports.Mode = Mode;
|
|
669
|
+
}); (function() {
|
|
670
|
+
ace.require(["ace/mode/xml"], function(m) {
|
|
671
|
+
if (typeof module == "object" && typeof exports == "object" && module) {
|
|
672
|
+
module.exports = m;
|
|
673
|
+
}
|
|
674
|
+
});
|
|
675
|
+
})();
|
|
676
|
+
|