ace-rails-ap 2.0.1 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -4
- data/lib/ace/rails/version.rb +1 -1
- data/vendor/assets/javascripts/ace/ace.js +14194 -13349
- data/vendor/assets/javascripts/ace/ext-beautify.js +335 -0
- data/vendor/assets/javascripts/ace/ext-chromevox.js +6 -1
- data/vendor/assets/javascripts/ace/ext-elastic_tabstops_lite.js +8 -33
- data/vendor/assets/javascripts/ace/ext-emmet.js +487 -424
- data/vendor/assets/javascripts/ace/ext-error_marker.js +6 -0
- data/vendor/assets/javascripts/ace/ext-keybinding_menu.js +45 -72
- data/vendor/assets/javascripts/ace/ext-language_tools.js +734 -578
- data/vendor/assets/javascripts/ace/ext-linking.js +53 -0
- data/vendor/assets/javascripts/ace/ext-modelist.js +25 -10
- data/vendor/assets/javascripts/ace/ext-old_ie.js +93 -120
- data/vendor/assets/javascripts/ace/ext-searchbox.js +8 -41
- data/vendor/assets/javascripts/ace/ext-settings_menu.js +229 -234
- data/vendor/assets/javascripts/ace/ext-spellcheck.js +7 -3
- data/vendor/assets/javascripts/ace/ext-split.js +13 -37
- data/vendor/assets/javascripts/ace/ext-static_highlight.js +16 -39
- data/vendor/assets/javascripts/ace/ext-statusbar.js +8 -2
- data/vendor/assets/javascripts/ace/ext-textarea.js +254 -99
- data/vendor/assets/javascripts/ace/ext-themelist.js +13 -40
- data/vendor/assets/javascripts/ace/ext-whitespace.js +17 -41
- data/vendor/assets/javascripts/ace/keybinding-emacs.js +803 -788
- data/vendor/assets/javascripts/ace/keybinding-vim.js +1559 -1560
- data/vendor/assets/javascripts/ace/mode-abap.js +52 -83
- data/vendor/assets/javascripts/ace/mode-actionscript.js +27 -63
- data/vendor/assets/javascripts/ace/mode-ada.js +27 -58
- data/vendor/assets/javascripts/ace/mode-apache_conf.js +310 -0
- data/vendor/assets/javascripts/ace/mode-applescript.js +226 -0
- data/vendor/assets/javascripts/ace/mode-asciidoc.js +39 -70
- data/vendor/assets/javascripts/ace/mode-assembly_x86.js +26 -58
- data/vendor/assets/javascripts/ace/mode-autohotkey.js +27 -63
- data/vendor/assets/javascripts/ace/mode-batchfile.js +27 -63
- data/vendor/assets/javascripts/ace/mode-c9search.js +92 -112
- data/vendor/assets/javascripts/ace/mode-c_cpp.js +224 -223
- data/vendor/assets/javascripts/ace/mode-cirru.js +202 -0
- data/vendor/assets/javascripts/ace/mode-clojure.js +98 -92
- data/vendor/assets/javascripts/ace/mode-cobol.js +27 -58
- data/vendor/assets/javascripts/ace/mode-coffee.js +90 -122
- data/vendor/assets/javascripts/ace/mode-coldfusion.js +1908 -1464
- data/vendor/assets/javascripts/ace/mode-csharp.js +291 -264
- data/vendor/assets/javascripts/ace/mode-css.js +266 -267
- data/vendor/assets/javascripts/ace/mode-curly.js +796 -815
- data/vendor/assets/javascripts/ace/mode-d.js +64 -95
- data/vendor/assets/javascripts/ace/mode-dart.js +254 -256
- data/vendor/assets/javascripts/ace/mode-diff.js +27 -58
- data/vendor/assets/javascripts/ace/mode-django.js +856 -866
- data/vendor/assets/javascripts/ace/mode-dockerfile.js +759 -0
- data/vendor/assets/javascripts/ace/mode-dot.js +106 -106
- data/vendor/assets/javascripts/ace/mode-eiffel.js +135 -0
- data/vendor/assets/javascripts/ace/mode-ejs.js +931 -938
- data/vendor/assets/javascripts/ace/mode-erlang.js +27 -58
- data/vendor/assets/javascripts/ace/mode-forth.js +27 -63
- data/vendor/assets/javascripts/ace/mode-ftl.js +457 -508
- data/vendor/assets/javascripts/ace/mode-gcode.js +85 -0
- data/vendor/assets/javascripts/ace/mode-gherkin.js +129 -0
- data/vendor/assets/javascripts/ace/mode-gitignore.js +50 -0
- data/vendor/assets/javascripts/ace/mode-glsl.js +252 -248
- data/vendor/assets/javascripts/ace/mode-golang.js +206 -179
- data/vendor/assets/javascripts/ace/mode-groovy.js +310 -242
- data/vendor/assets/javascripts/ace/mode-haml.js +156 -190
- data/vendor/assets/javascripts/ace/mode-handlebars.js +815 -784
- data/vendor/assets/javascripts/ace/mode-haskell.js +27 -63
- data/vendor/assets/javascripts/ace/mode-haxe.js +206 -176
- data/vendor/assets/javascripts/ace/mode-html.js +779 -792
- data/vendor/assets/javascripts/ace/mode-html_ruby.js +916 -923
- data/vendor/assets/javascripts/ace/mode-ini.js +27 -58
- data/vendor/assets/javascripts/ace/mode-io.js +201 -0
- data/vendor/assets/javascripts/ace/mode-jack.js +169 -170
- data/vendor/assets/javascripts/ace/mode-jade.js +722 -774
- data/vendor/assets/javascripts/ace/mode-java.js +310 -245
- data/vendor/assets/javascripts/ace/mode-javascript.js +285 -247
- data/vendor/assets/javascripts/ace/mode-json.js +183 -184
- data/vendor/assets/javascripts/ace/mode-jsoniq.js +3211 -1274
- data/vendor/assets/javascripts/ace/mode-jsp.js +481 -504
- data/vendor/assets/javascripts/ace/mode-jsx.js +206 -176
- data/vendor/assets/javascripts/ace/mode-julia.js +33 -69
- data/vendor/assets/javascripts/ace/mode-latex.js +74 -41
- data/vendor/assets/javascripts/ace/mode-less.js +250 -251
- data/vendor/assets/javascripts/ace/mode-liquid.js +424 -475
- data/vendor/assets/javascripts/ace/mode-lisp.js +24 -57
- data/vendor/assets/javascripts/ace/mode-livescript.js +42 -41
- data/vendor/assets/javascripts/ace/mode-logiql.js +229 -230
- data/vendor/assets/javascripts/ace/mode-lsl.js +200 -441
- data/vendor/assets/javascripts/ace/mode-lua.js +136 -167
- data/vendor/assets/javascripts/ace/mode-luapage.js +904 -884
- data/vendor/assets/javascripts/ace/mode-lucene.js +22 -17
- data/vendor/assets/javascripts/ace/mode-makefile.js +162 -137
- data/vendor/assets/javascripts/ace/mode-markdown.js +846 -854
- data/vendor/assets/javascripts/ace/mode-matlab.js +98 -72
- data/vendor/assets/javascripts/ace/mode-mel.js +569 -0
- data/vendor/assets/javascripts/ace/mode-mushcode.js +84 -115
- data/vendor/assets/javascripts/ace/mode-mysql.js +49 -80
- data/vendor/assets/javascripts/ace/mode-nix.js +252 -256
- data/vendor/assets/javascripts/ace/mode-objectivec.js +242 -274
- data/vendor/assets/javascripts/ace/mode-ocaml.js +71 -102
- data/vendor/assets/javascripts/ace/mode-pascal.js +32 -68
- data/vendor/assets/javascripts/ace/mode-perl.js +67 -98
- data/vendor/assets/javascripts/ace/mode-pgsql.js +990 -982
- data/vendor/assets/javascripts/ace/mode-php.js +1878 -1900
- data/vendor/assets/javascripts/ace/mode-plain_text.js +3 -34
- data/vendor/assets/javascripts/ace/mode-powershell.js +181 -151
- data/vendor/assets/javascripts/ace/mode-praat.js +418 -0
- data/vendor/assets/javascripts/ace/mode-prolog.js +27 -63
- data/vendor/assets/javascripts/ace/mode-properties.js +20 -48
- data/vendor/assets/javascripts/ace/mode-protobuf.js +252 -259
- data/vendor/assets/javascripts/ace/mode-python.js +84 -115
- data/vendor/assets/javascripts/ace/mode-r.js +105 -140
- data/vendor/assets/javascripts/ace/mode-rdoc.js +84 -89
- data/vendor/assets/javascripts/ace/mode-rhtml.js +892 -908
- data/vendor/assets/javascripts/ace/mode-ruby.js +434 -98
- data/vendor/assets/javascripts/ace/mode-rust.js +27 -63
- data/vendor/assets/javascripts/ace/mode-sass.js +75 -106
- data/vendor/assets/javascripts/ace/mode-scad.js +219 -220
- data/vendor/assets/javascripts/ace/mode-scala.js +311 -243
- data/vendor/assets/javascripts/ace/mode-scheme.js +24 -60
- data/vendor/assets/javascripts/ace/mode-scss.js +250 -251
- data/vendor/assets/javascripts/ace/mode-sh.js +506 -118
- data/vendor/assets/javascripts/ace/mode-sjs.js +314 -280
- data/vendor/assets/javascripts/ace/mode-smarty.js +2474 -0
- data/vendor/assets/javascripts/ace/mode-snippets.js +89 -89
- data/vendor/assets/javascripts/ace/mode-soy_template.js +792 -811
- data/vendor/assets/javascripts/ace/mode-space.js +22 -23
- data/vendor/assets/javascripts/ace/mode-sql.js +31 -58
- data/vendor/assets/javascripts/ace/mode-stylus.js +161 -197
- data/vendor/assets/javascripts/ace/mode-svg.js +906 -836
- data/vendor/assets/javascripts/ace/mode-tcl.js +61 -92
- data/vendor/assets/javascripts/ace/mode-tex.js +36 -73
- data/vendor/assets/javascripts/ace/mode-text.js +1 -0
- data/vendor/assets/javascripts/ace/mode-textile.js +41 -72
- data/vendor/assets/javascripts/ace/mode-toml.js +26 -62
- data/vendor/assets/javascripts/ace/mode-twig.js +1196 -892
- data/vendor/assets/javascripts/ace/mode-typescript.js +313 -277
- data/vendor/assets/javascripts/ace/mode-vala.js +982 -0
- data/vendor/assets/javascripts/ace/mode-vbscript.js +25 -62
- data/vendor/assets/javascripts/ace/mode-velocity.js +2251 -1242
- data/vendor/assets/javascripts/ace/mode-verilog.js +27 -59
- data/vendor/assets/javascripts/ace/mode-vhdl.js +26 -55
- data/vendor/assets/javascripts/ace/mode-xml.js +319 -644
- data/vendor/assets/javascripts/ace/mode-xquery.js +2503 -588
- data/vendor/assets/javascripts/ace/mode-yaml.js +56 -90
- data/vendor/assets/javascripts/ace/snippets/abap.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/actionscript.js +159 -0
- data/vendor/assets/javascripts/ace/snippets/ada.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/apache_conf.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/applescript.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/asciidoc.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/assembly_x86.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/autohotkey.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/batchfile.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/c9search.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/c_cpp.js +138 -0
- data/vendor/assets/javascripts/ace/snippets/cirru.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/clojure.js +97 -0
- data/vendor/assets/javascripts/ace/snippets/cobol.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/coffee.js +102 -0
- data/vendor/assets/javascripts/ace/snippets/coldfusion.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/csharp.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/css.js +974 -0
- data/vendor/assets/javascripts/ace/snippets/curly.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/d.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/dart.js +90 -0
- data/vendor/assets/javascripts/ace/snippets/diff.js +18 -0
- data/vendor/assets/javascripts/ace/snippets/django.js +115 -0
- data/vendor/assets/javascripts/ace/snippets/dockerfile.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/dot.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/eiffel.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/ejs.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/erlang.js +167 -0
- data/vendor/assets/javascripts/ace/snippets/forth.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/ftl.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/gcode.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/gherkin.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/gitignore.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/glsl.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/golang.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/groovy.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/haml.js +27 -0
- data/vendor/assets/javascripts/ace/snippets/handlebars.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/haskell.js +89 -0
- data/vendor/assets/javascripts/ace/snippets/haxe.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/html.js +835 -0
- data/vendor/assets/javascripts/ace/snippets/html_ruby.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/ini.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/io.js +69 -0
- data/vendor/assets/javascripts/ace/snippets/jack.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/jade.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/java.js +241 -0
- data/vendor/assets/javascripts/ace/snippets/javascript.js +189 -0
- data/vendor/assets/javascripts/ace/snippets/json.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/jsoniq.js +68 -0
- data/vendor/assets/javascripts/ace/snippets/jsp.js +106 -0
- data/vendor/assets/javascripts/ace/snippets/jsx.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/julia.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/latex.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/less.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/liquid.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/lisp.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/livescript.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/logiql.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/lsl.js +1073 -0
- data/vendor/assets/javascripts/ace/snippets/lua.js +28 -0
- data/vendor/assets/javascripts/ace/snippets/luapage.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/lucene.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/makefile.js +11 -0
- data/vendor/assets/javascripts/ace/snippets/markdown.js +95 -0
- data/vendor/assets/javascripts/ace/snippets/matlab.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/mel.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/mushcode.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/mysql.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/nix.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/objectivec.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/ocaml.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/pascal.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/perl.js +354 -0
- data/vendor/assets/javascripts/ace/snippets/pgsql.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/php.js +283 -0
- data/vendor/assets/javascripts/ace/snippets/plain_text.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/powershell.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/praat.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/prolog.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/properties.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/protobuf.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/python.js +165 -0
- data/vendor/assets/javascripts/ace/snippets/r.js +128 -0
- data/vendor/assets/javascripts/ace/snippets/rdoc.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/rhtml.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/ruby.js +935 -0
- data/vendor/assets/javascripts/ace/snippets/rust.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/sass.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/scad.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/scala.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/scheme.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/scss.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/sh.js +90 -0
- data/vendor/assets/javascripts/ace/snippets/sjs.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/smarty.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/snippets.js +16 -0
- data/vendor/assets/javascripts/ace/snippets/soy_template.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/space.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/sql.js +33 -0
- data/vendor/assets/javascripts/ace/snippets/stylus.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/svg.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/tcl.js +99 -0
- data/vendor/assets/javascripts/ace/snippets/tex.js +197 -0
- data/vendor/assets/javascripts/ace/snippets/text.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/textile.js +37 -0
- data/vendor/assets/javascripts/ace/snippets/toml.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/twig.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/typescript.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/vala.js +193 -0
- data/vendor/assets/javascripts/ace/snippets/vbscript.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/velocity.js +36 -0
- data/vendor/assets/javascripts/ace/snippets/verilog.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/vhdl.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/xml.js +7 -0
- data/vendor/assets/javascripts/ace/snippets/xquery.js +68 -0
- data/vendor/assets/javascripts/ace/snippets/yaml.js +7 -0
- data/vendor/assets/javascripts/ace/theme-ambiance.js +4 -24
- data/vendor/assets/javascripts/ace/theme-chaos.js +2 -25
- data/vendor/assets/javascripts/ace/theme-chrome.js +2 -31
- data/vendor/assets/javascripts/ace/theme-clouds.js +1 -31
- data/vendor/assets/javascripts/ace/theme-clouds_midnight.js +1 -31
- data/vendor/assets/javascripts/ace/theme-cobalt.js +1 -31
- data/vendor/assets/javascripts/ace/theme-crimson_editor.js +1 -31
- data/vendor/assets/javascripts/ace/theme-dawn.js +1 -31
- data/vendor/assets/javascripts/ace/theme-dreamweaver.js +5 -31
- data/vendor/assets/javascripts/ace/theme-eclipse.js +7 -33
- data/vendor/assets/javascripts/ace/theme-github.js +2 -35
- data/vendor/assets/javascripts/ace/theme-idle_fingers.js +1 -31
- data/vendor/assets/javascripts/ace/theme-katzenmilch.js +119 -0
- data/vendor/assets/javascripts/ace/theme-kr.js +1 -31
- data/vendor/assets/javascripts/ace/theme-kr_theme.js +57 -141
- data/vendor/assets/javascripts/ace/theme-kuroir.js +59 -0
- data/vendor/assets/javascripts/ace/theme-merbivore.js +1 -31
- data/vendor/assets/javascripts/ace/theme-merbivore_soft.js +1 -31
- data/vendor/assets/javascripts/ace/theme-mono_industrial.js +1 -31
- data/vendor/assets/javascripts/ace/theme-monokai.js +1 -31
- data/vendor/assets/javascripts/ace/theme-pastel_on_dark.js +1 -31
- data/vendor/assets/javascripts/ace/theme-solarized_dark.js +1 -31
- data/vendor/assets/javascripts/ace/theme-solarized_light.js +1 -31
- data/vendor/assets/javascripts/ace/theme-terminal.js +1 -31
- data/vendor/assets/javascripts/ace/theme-textmate.js +3 -32
- data/vendor/assets/javascripts/ace/theme-tomorrow.js +1 -31
- data/vendor/assets/javascripts/ace/theme-tomorrow_night.js +1 -31
- data/vendor/assets/javascripts/ace/theme-tomorrow_night_blue.js +1 -31
- data/vendor/assets/javascripts/ace/theme-tomorrow_night_bright.js +1 -31
- data/vendor/assets/javascripts/ace/theme-tomorrow_night_eighties.js +1 -31
- data/vendor/assets/javascripts/ace/theme-twilight.js +1 -31
- data/vendor/assets/javascripts/ace/theme-vibrant_ink.js +1 -31
- data/vendor/assets/javascripts/ace/theme-xcode.js +2 -33
- data/vendor/assets/javascripts/ace/worker-coffee.js +5026 -5008
- data/vendor/assets/javascripts/ace/worker-css.js +5489 -5134
- data/vendor/assets/javascripts/ace/worker-html.js +11517 -0
- data/vendor/assets/javascripts/ace/worker-javascript.js +9810 -9501
- data/vendor/assets/javascripts/ace/worker-json.js +1583 -1564
- data/vendor/assets/javascripts/ace/worker-lua.js +2631 -2612
- data/vendor/assets/javascripts/ace/worker-php.js +2385 -2341
- data/vendor/assets/javascripts/ace/worker-xquery.js +31643 -3993
- metadata +147 -11
@@ -1,20 +1,5 @@
|
|
1
|
-
define(
|
2
|
-
|
3
|
-
|
4
|
-
var oop = require("../lib/oop");
|
5
|
-
var TextMode = require("./text").Mode;
|
6
|
-
var Tokenizer = require("../tokenizer").Tokenizer;
|
7
|
-
var LuceneHighlightRules = require("./lucene_highlight_rules").LuceneHighlightRules;
|
8
|
-
|
9
|
-
var Mode = function() {
|
10
|
-
this.$tokenizer = new Tokenizer(new LuceneHighlightRules().getRules());
|
11
|
-
};
|
12
|
-
|
13
|
-
oop.inherits(Mode, TextMode);
|
14
|
-
|
15
|
-
exports.Mode = Mode;
|
16
|
-
});define('ace/mode/lucene_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
|
17
|
-
|
1
|
+
define("ace/mode/lucene_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) {
|
2
|
+
"use strict";
|
18
3
|
|
19
4
|
var oop = require("../lib/oop");
|
20
5
|
var lang = require("../lib/lang");
|
@@ -62,3 +47,23 @@ oop.inherits(LuceneHighlightRules, TextHighlightRules);
|
|
62
47
|
|
63
48
|
exports.LuceneHighlightRules = LuceneHighlightRules;
|
64
49
|
});
|
50
|
+
|
51
|
+
define("ace/mode/lucene",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/lucene_highlight_rules"], function(require, exports, module) {
|
52
|
+
'use strict';
|
53
|
+
|
54
|
+
var oop = require("../lib/oop");
|
55
|
+
var TextMode = require("./text").Mode;
|
56
|
+
var LuceneHighlightRules = require("./lucene_highlight_rules").LuceneHighlightRules;
|
57
|
+
|
58
|
+
var Mode = function() {
|
59
|
+
this.HighlightRules = LuceneHighlightRules;
|
60
|
+
};
|
61
|
+
|
62
|
+
oop.inherits(Mode, TextMode);
|
63
|
+
|
64
|
+
(function() {
|
65
|
+
this.$id = "ace/mode/lucene";
|
66
|
+
}).call(Mode.prototype);
|
67
|
+
|
68
|
+
exports.Mode = Mode;
|
69
|
+
});
|
@@ -1,137 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
*
|
4
|
-
* Copyright (c) 2012, Ajax.org B.V.
|
5
|
-
* All rights reserved.
|
6
|
-
*
|
7
|
-
* Redistribution and use in source and binary forms, with or without
|
8
|
-
* modification, are permitted provided that the following conditions are met:
|
9
|
-
* * Redistributions of source code must retain the above copyright
|
10
|
-
* notice, this list of conditions and the following disclaimer.
|
11
|
-
* * Redistributions in binary form must reproduce the above copyright
|
12
|
-
* notice, this list of conditions and the following disclaimer in the
|
13
|
-
* documentation and/or other materials provided with the distribution.
|
14
|
-
* * Neither the name of Ajax.org B.V. nor the
|
15
|
-
* names of its contributors may be used to endorse or promote products
|
16
|
-
* derived from this software without specific prior written permission.
|
17
|
-
*
|
18
|
-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
19
|
-
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
20
|
-
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
21
|
-
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
|
22
|
-
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
23
|
-
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
24
|
-
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
25
|
-
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
26
|
-
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
27
|
-
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
28
|
-
*
|
29
|
-
*
|
30
|
-
* Contributor(s):
|
31
|
-
*
|
32
|
-
*
|
33
|
-
*
|
34
|
-
* ***** END LICENSE BLOCK ***** */
|
35
|
-
|
36
|
-
define('ace/mode/makefile', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/makefile_highlight_rules', 'ace/mode/folding/coffee'], function(require, exports, module) {
|
37
|
-
|
38
|
-
|
39
|
-
var oop = require("../lib/oop");
|
40
|
-
var TextMode = require("./text").Mode;
|
41
|
-
var Tokenizer = require("../tokenizer").Tokenizer;
|
42
|
-
var MakefileHighlightRules = require("./makefile_highlight_rules").MakefileHighlightRules;
|
43
|
-
var FoldMode = require("./folding/coffee").FoldMode;
|
44
|
-
|
45
|
-
var Mode = function() {
|
46
|
-
this.HighlightRules = MakefileHighlightRules;
|
47
|
-
this.foldingRules = new FoldMode();
|
48
|
-
};
|
49
|
-
oop.inherits(Mode, TextMode);
|
50
|
-
|
51
|
-
(function() {
|
52
|
-
|
53
|
-
this.lineCommentStart = "#";
|
54
|
-
this.$indentWithTabs = true;
|
55
|
-
|
56
|
-
this.$id = "ace/mode/makefile";
|
57
|
-
}).call(Mode.prototype);
|
58
|
-
|
59
|
-
exports.Mode = Mode;
|
60
|
-
});define('ace/mode/makefile_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules', 'ace/mode/sh_highlight_rules'], function(require, exports, module) {
|
61
|
-
|
62
|
-
|
63
|
-
var oop = require("../lib/oop");
|
64
|
-
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
65
|
-
|
66
|
-
var ShHighlightFile = require("./sh_highlight_rules");
|
67
|
-
|
68
|
-
var MakefileHighlightRules = function() {
|
69
|
-
|
70
|
-
var keywordMapper = this.createKeywordMapper({
|
71
|
-
"keyword": ShHighlightFile.reservedKeywords,
|
72
|
-
"support.function.builtin": ShHighlightFile.languageConstructs,
|
73
|
-
"invalid.deprecated": "debugger"
|
74
|
-
}, "string");
|
75
|
-
|
76
|
-
this.$rules =
|
77
|
-
{
|
78
|
-
"start": [
|
79
|
-
{
|
80
|
-
token: "string.interpolated.backtick.makefile",
|
81
|
-
regex: "`",
|
82
|
-
next: "shell-start"
|
83
|
-
},
|
84
|
-
{
|
85
|
-
token: "punctuation.definition.comment.makefile",
|
86
|
-
regex: /#(?=.)/,
|
87
|
-
next: "comment"
|
88
|
-
},
|
89
|
-
{
|
90
|
-
token: [ "keyword.control.makefile"],
|
91
|
-
regex: "^(?:\\s*\\b)(\\-??include|ifeq|ifneq|ifdef|ifndef|else|endif|vpath|export|unexport|define|endef|override)(?:\\b)"
|
92
|
-
},
|
93
|
-
{// ^([^\t ]+(\s[^\t ]+)*:(?!\=))\s*.*
|
94
|
-
token: ["entity.name.function.makefile", "text"],
|
95
|
-
regex: "^([^\\t ]+(?:\\s[^\\t ]+)*:)(\\s*.*)"
|
96
|
-
}
|
97
|
-
],
|
98
|
-
"comment": [
|
99
|
-
{
|
100
|
-
token : "punctuation.definition.comment.makefile",
|
101
|
-
regex : /.+\\/
|
102
|
-
},
|
103
|
-
{
|
104
|
-
token : "punctuation.definition.comment.makefile",
|
105
|
-
regex : ".+",
|
106
|
-
next : "start"
|
107
|
-
}
|
108
|
-
],
|
109
|
-
"shell-start": [
|
110
|
-
{
|
111
|
-
token: keywordMapper,
|
112
|
-
regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
|
113
|
-
},
|
114
|
-
{
|
115
|
-
token: "string",
|
116
|
-
regex : "\\w+"
|
117
|
-
},
|
118
|
-
{
|
119
|
-
token : "string.interpolated.backtick.makefile",
|
120
|
-
regex : "`",
|
121
|
-
next : "start"
|
122
|
-
}
|
123
|
-
]
|
124
|
-
}
|
125
|
-
|
126
|
-
};
|
127
|
-
|
128
|
-
oop.inherits(MakefileHighlightRules, TextHighlightRules);
|
129
|
-
|
130
|
-
exports.MakefileHighlightRules = MakefileHighlightRules;
|
131
|
-
});
|
132
|
-
|
133
|
-
define('ace/mode/sh_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
|
134
|
-
|
1
|
+
define("ace/mode/sh_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
|
2
|
+
"use strict";
|
135
3
|
|
136
4
|
var oop = require("../lib/oop");
|
137
5
|
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
@@ -170,7 +38,7 @@ var ShHighlightRules = function() {
|
|
170
38
|
var floatNumber = "(?:" + exponentFloat + "|" + pointFloat + ")";
|
171
39
|
var fileDescriptor = "(?:&" + intPart + ")";
|
172
40
|
|
173
|
-
var variableName = "[a-zA-
|
41
|
+
var variableName = "[a-zA-Z_][a-zA-Z0-9_]*";
|
174
42
|
var variable = "(?:(?:\\$" + variableName + ")|(?:" + variableName + "=))";
|
175
43
|
|
176
44
|
var builtinVariable = "(?:\\$(?:SHLVL|\\$|\\!|\\?))";
|
@@ -200,6 +68,65 @@ var ShHighlightRules = function() {
|
|
200
68
|
}, {
|
201
69
|
defaultToken: "string"
|
202
70
|
}]
|
71
|
+
}, {
|
72
|
+
regex : "<<<",
|
73
|
+
token : "keyword.operator"
|
74
|
+
}, {
|
75
|
+
stateName: "heredoc",
|
76
|
+
regex : "(<<)(\\s*)(['\"`]?)([\\w\\-]+)(['\"`]?)",
|
77
|
+
onMatch : function(value, currentState, stack) {
|
78
|
+
var next = value[2] == '-' ? "indentedHeredoc" : "heredoc";
|
79
|
+
var tokens = value.split(this.splitRegex);
|
80
|
+
stack.push(next, tokens[4]);
|
81
|
+
return [
|
82
|
+
{type:"constant", value: tokens[1]},
|
83
|
+
{type:"text", value: tokens[2]},
|
84
|
+
{type:"string", value: tokens[3]},
|
85
|
+
{type:"support.class", value: tokens[4]},
|
86
|
+
{type:"string", value: tokens[5]}
|
87
|
+
];
|
88
|
+
},
|
89
|
+
rules: {
|
90
|
+
heredoc: [{
|
91
|
+
onMatch: function(value, currentState, stack) {
|
92
|
+
if (value === stack[1]) {
|
93
|
+
stack.shift();
|
94
|
+
stack.shift();
|
95
|
+
this.next = stack[0] || "start";
|
96
|
+
return "support.class";
|
97
|
+
}
|
98
|
+
this.next = "";
|
99
|
+
return "string";
|
100
|
+
},
|
101
|
+
regex: ".*$",
|
102
|
+
next: "start"
|
103
|
+
}],
|
104
|
+
indentedHeredoc: [{
|
105
|
+
token: "string",
|
106
|
+
regex: "^\t+"
|
107
|
+
}, {
|
108
|
+
onMatch: function(value, currentState, stack) {
|
109
|
+
if (value === stack[1]) {
|
110
|
+
stack.shift();
|
111
|
+
stack.shift();
|
112
|
+
this.next = stack[0] || "start";
|
113
|
+
return "support.class";
|
114
|
+
}
|
115
|
+
this.next = "";
|
116
|
+
return "string";
|
117
|
+
},
|
118
|
+
regex: ".*$",
|
119
|
+
next: "start"
|
120
|
+
}]
|
121
|
+
}
|
122
|
+
}, {
|
123
|
+
regex : "$",
|
124
|
+
token : "empty",
|
125
|
+
next : function(currentState, stack) {
|
126
|
+
if (stack[0] === "heredoc" || stack[0] === "indentedHeredoc")
|
127
|
+
return stack[0];
|
128
|
+
return currentState;
|
129
|
+
}
|
203
130
|
}, {
|
204
131
|
token : "variable.language",
|
205
132
|
regex : builtinVariable
|
@@ -223,7 +150,7 @@ var ShHighlightRules = function() {
|
|
223
150
|
regex : integer + "\\b"
|
224
151
|
}, {
|
225
152
|
token : keywordMapper,
|
226
|
-
regex : "[a-zA-Z_
|
153
|
+
regex : "[a-zA-Z_][a-zA-Z0-9_]*\\b"
|
227
154
|
}, {
|
228
155
|
token : "keyword.operator",
|
229
156
|
regex : "\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|~|<|>|<=|=>|=|!="
|
@@ -244,8 +171,81 @@ oop.inherits(ShHighlightRules, TextHighlightRules);
|
|
244
171
|
exports.ShHighlightRules = ShHighlightRules;
|
245
172
|
});
|
246
173
|
|
247
|
-
define(
|
174
|
+
define("ace/mode/makefile_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules","ace/mode/sh_highlight_rules"], function(require, exports, module) {
|
175
|
+
"use strict";
|
248
176
|
|
177
|
+
var oop = require("../lib/oop");
|
178
|
+
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
179
|
+
|
180
|
+
var ShHighlightFile = require("./sh_highlight_rules");
|
181
|
+
|
182
|
+
var MakefileHighlightRules = function() {
|
183
|
+
|
184
|
+
var keywordMapper = this.createKeywordMapper({
|
185
|
+
"keyword": ShHighlightFile.reservedKeywords,
|
186
|
+
"support.function.builtin": ShHighlightFile.languageConstructs,
|
187
|
+
"invalid.deprecated": "debugger"
|
188
|
+
}, "string");
|
189
|
+
|
190
|
+
this.$rules =
|
191
|
+
{
|
192
|
+
"start": [
|
193
|
+
{
|
194
|
+
token: "string.interpolated.backtick.makefile",
|
195
|
+
regex: "`",
|
196
|
+
next: "shell-start"
|
197
|
+
},
|
198
|
+
{
|
199
|
+
token: "punctuation.definition.comment.makefile",
|
200
|
+
regex: /#(?=.)/,
|
201
|
+
next: "comment"
|
202
|
+
},
|
203
|
+
{
|
204
|
+
token: [ "keyword.control.makefile"],
|
205
|
+
regex: "^(?:\\s*\\b)(\\-??include|ifeq|ifneq|ifdef|ifndef|else|endif|vpath|export|unexport|define|endef|override)(?:\\b)"
|
206
|
+
},
|
207
|
+
{// ^([^\t ]+(\s[^\t ]+)*:(?!\=))\s*.*
|
208
|
+
token: ["entity.name.function.makefile", "text"],
|
209
|
+
regex: "^([^\\t ]+(?:\\s[^\\t ]+)*:)(\\s*.*)"
|
210
|
+
}
|
211
|
+
],
|
212
|
+
"comment": [
|
213
|
+
{
|
214
|
+
token : "punctuation.definition.comment.makefile",
|
215
|
+
regex : /.+\\/
|
216
|
+
},
|
217
|
+
{
|
218
|
+
token : "punctuation.definition.comment.makefile",
|
219
|
+
regex : ".+",
|
220
|
+
next : "start"
|
221
|
+
}
|
222
|
+
],
|
223
|
+
"shell-start": [
|
224
|
+
{
|
225
|
+
token: keywordMapper,
|
226
|
+
regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
|
227
|
+
},
|
228
|
+
{
|
229
|
+
token: "string",
|
230
|
+
regex : "\\w+"
|
231
|
+
},
|
232
|
+
{
|
233
|
+
token : "string.interpolated.backtick.makefile",
|
234
|
+
regex : "`",
|
235
|
+
next : "start"
|
236
|
+
}
|
237
|
+
]
|
238
|
+
}
|
239
|
+
|
240
|
+
};
|
241
|
+
|
242
|
+
oop.inherits(MakefileHighlightRules, TextHighlightRules);
|
243
|
+
|
244
|
+
exports.MakefileHighlightRules = MakefileHighlightRules;
|
245
|
+
});
|
246
|
+
|
247
|
+
define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module) {
|
248
|
+
"use strict";
|
249
249
|
|
250
250
|
var oop = require("../../lib/oop");
|
251
251
|
var BaseFoldMode = require("./fold_mode").FoldMode;
|
@@ -330,3 +330,28 @@ oop.inherits(FoldMode, BaseFoldMode);
|
|
330
330
|
}).call(FoldMode.prototype);
|
331
331
|
|
332
332
|
});
|
333
|
+
|
334
|
+
define("ace/mode/makefile",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/makefile_highlight_rules","ace/mode/folding/coffee"], function(require, exports, module) {
|
335
|
+
"use strict";
|
336
|
+
|
337
|
+
var oop = require("../lib/oop");
|
338
|
+
var TextMode = require("./text").Mode;
|
339
|
+
var MakefileHighlightRules = require("./makefile_highlight_rules").MakefileHighlightRules;
|
340
|
+
var FoldMode = require("./folding/coffee").FoldMode;
|
341
|
+
|
342
|
+
var Mode = function() {
|
343
|
+
this.HighlightRules = MakefileHighlightRules;
|
344
|
+
this.foldingRules = new FoldMode();
|
345
|
+
};
|
346
|
+
oop.inherits(Mode, TextMode);
|
347
|
+
|
348
|
+
(function() {
|
349
|
+
|
350
|
+
this.lineCommentStart = "#";
|
351
|
+
this.$indentWithTabs = true;
|
352
|
+
|
353
|
+
this.$id = "ace/mode/makefile";
|
354
|
+
}).call(Mode.prototype);
|
355
|
+
|
356
|
+
exports.Mode = Mode;
|
357
|
+
});
|
@@ -1,177 +1,55 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
*
|
4
|
-
* Copyright (c) 2010, Ajax.org B.V.
|
5
|
-
* All rights reserved.
|
6
|
-
*
|
7
|
-
* Redistribution and use in source and binary forms, with or without
|
8
|
-
* modification, are permitted provided that the following conditions are met:
|
9
|
-
* * Redistributions of source code must retain the above copyright
|
10
|
-
* notice, this list of conditions and the following disclaimer.
|
11
|
-
* * Redistributions in binary form must reproduce the above copyright
|
12
|
-
* notice, this list of conditions and the following disclaimer in the
|
13
|
-
* documentation and/or other materials provided with the distribution.
|
14
|
-
* * Neither the name of Ajax.org B.V. nor the
|
15
|
-
* names of its contributors may be used to endorse or promote products
|
16
|
-
* derived from this software without specific prior written permission.
|
17
|
-
*
|
18
|
-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
19
|
-
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
20
|
-
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
21
|
-
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
|
22
|
-
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
23
|
-
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
24
|
-
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
25
|
-
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
26
|
-
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
27
|
-
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
28
|
-
*
|
29
|
-
* ***** END LICENSE BLOCK ***** */
|
30
|
-
|
31
|
-
define('ace/mode/markdown', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/mode/javascript', 'ace/mode/xml', 'ace/mode/html', 'ace/tokenizer', 'ace/mode/markdown_highlight_rules', 'ace/mode/folding/markdown'], function(require, exports, module) {
|
32
|
-
|
1
|
+
define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
|
2
|
+
"use strict";
|
33
3
|
|
34
4
|
var oop = require("../lib/oop");
|
35
|
-
var
|
36
|
-
var JavaScriptMode = require("./javascript").Mode;
|
37
|
-
var XmlMode = require("./xml").Mode;
|
38
|
-
var HtmlMode = require("./html").Mode;
|
39
|
-
var Tokenizer = require("../tokenizer").Tokenizer;
|
40
|
-
var MarkdownHighlightRules = require("./markdown_highlight_rules").MarkdownHighlightRules;
|
41
|
-
var MarkdownFoldMode = require("./folding/markdown").FoldMode;
|
5
|
+
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
42
6
|
|
43
|
-
var
|
44
|
-
this.HighlightRules = MarkdownHighlightRules;
|
45
|
-
|
46
|
-
this.createModeDelegates({
|
47
|
-
"js-": JavaScriptMode,
|
48
|
-
"xml-": XmlMode,
|
49
|
-
"html-": HtmlMode
|
50
|
-
});
|
51
|
-
|
52
|
-
this.foldingRules = new MarkdownFoldMode();
|
53
|
-
};
|
54
|
-
oop.inherits(Mode, TextMode);
|
7
|
+
var DocCommentHighlightRules = function() {
|
55
8
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
if (!marker)
|
67
|
-
marker = parseInt(match[3], 10) + 1 + ".";
|
68
|
-
return match[1] + marker + match[4];
|
69
|
-
} else {
|
70
|
-
return this.$getIndent(line);
|
71
|
-
}
|
9
|
+
this.$rules = {
|
10
|
+
"start" : [ {
|
11
|
+
token : "comment.doc.tag",
|
12
|
+
regex : "@[\\w\\d_]+" // TODO: fix email addresses
|
13
|
+
}, {
|
14
|
+
token : "comment.doc.tag",
|
15
|
+
regex : "\\bTODO\\b"
|
16
|
+
}, {
|
17
|
+
defaultToken : "comment.doc"
|
18
|
+
}]
|
72
19
|
};
|
73
|
-
this.$id = "ace/mode/markdown";
|
74
|
-
}).call(Mode.prototype);
|
75
|
-
|
76
|
-
exports.Mode = Mode;
|
77
|
-
});
|
78
|
-
|
79
|
-
define('ace/mode/javascript', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/javascript_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/worker/worker_client', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) {
|
80
|
-
|
81
|
-
|
82
|
-
var oop = require("../lib/oop");
|
83
|
-
var TextMode = require("./text").Mode;
|
84
|
-
var Tokenizer = require("../tokenizer").Tokenizer;
|
85
|
-
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
|
86
|
-
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
|
87
|
-
var Range = require("../range").Range;
|
88
|
-
var WorkerClient = require("../worker/worker_client").WorkerClient;
|
89
|
-
var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
|
90
|
-
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
91
|
-
|
92
|
-
var Mode = function() {
|
93
|
-
this.HighlightRules = JavaScriptHighlightRules;
|
94
|
-
|
95
|
-
this.$outdent = new MatchingBraceOutdent();
|
96
|
-
this.$behaviour = new CstyleBehaviour();
|
97
|
-
this.foldingRules = new CStyleFoldMode();
|
98
20
|
};
|
99
|
-
oop.inherits(Mode, TextMode);
|
100
|
-
|
101
|
-
(function() {
|
102
|
-
|
103
|
-
this.lineCommentStart = "//";
|
104
|
-
this.blockComment = {start: "/*", end: "*/"};
|
105
|
-
|
106
|
-
this.getNextLineIndent = function(state, line, tab) {
|
107
|
-
var indent = this.$getIndent(line);
|
108
|
-
|
109
|
-
var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
|
110
|
-
var tokens = tokenizedLine.tokens;
|
111
|
-
var endState = tokenizedLine.state;
|
112
|
-
|
113
|
-
if (tokens.length && tokens[tokens.length-1].type == "comment") {
|
114
|
-
return indent;
|
115
|
-
}
|
116
|
-
|
117
|
-
if (state == "start" || state == "no_regex") {
|
118
|
-
var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);
|
119
|
-
if (match) {
|
120
|
-
indent += tab;
|
121
|
-
}
|
122
|
-
} else if (state == "doc-start") {
|
123
|
-
if (endState == "start" || endState == "no_regex") {
|
124
|
-
return "";
|
125
|
-
}
|
126
|
-
var match = line.match(/^\s*(\/?)\*/);
|
127
|
-
if (match) {
|
128
|
-
if (match[1]) {
|
129
|
-
indent += " ";
|
130
|
-
}
|
131
|
-
indent += "* ";
|
132
|
-
}
|
133
|
-
}
|
134
21
|
|
135
|
-
|
136
|
-
};
|
22
|
+
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
|
137
23
|
|
138
|
-
|
139
|
-
|
24
|
+
DocCommentHighlightRules.getStartRule = function(start) {
|
25
|
+
return {
|
26
|
+
token : "comment.doc", // doc comment
|
27
|
+
regex : "\\/\\*(?=\\*)",
|
28
|
+
next : start
|
140
29
|
};
|
30
|
+
};
|
141
31
|
|
142
|
-
|
143
|
-
|
32
|
+
DocCommentHighlightRules.getEndRule = function (start) {
|
33
|
+
return {
|
34
|
+
token : "comment.doc", // closing comment
|
35
|
+
regex : "\\*\\/",
|
36
|
+
next : start
|
144
37
|
};
|
38
|
+
};
|
145
39
|
|
146
|
-
this.createWorker = function(session) {
|
147
|
-
var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker");
|
148
|
-
worker.attachToDocument(session.getDocument());
|
149
|
-
|
150
|
-
worker.on("jslint", function(results) {
|
151
|
-
session.setAnnotations(results.data);
|
152
|
-
});
|
153
|
-
|
154
|
-
worker.on("terminate", function() {
|
155
|
-
session.clearAnnotations();
|
156
|
-
});
|
157
|
-
|
158
|
-
return worker;
|
159
|
-
};
|
160
40
|
|
161
|
-
|
162
|
-
}).call(Mode.prototype);
|
41
|
+
exports.DocCommentHighlightRules = DocCommentHighlightRules;
|
163
42
|
|
164
|
-
exports.Mode = Mode;
|
165
43
|
});
|
166
44
|
|
167
|
-
define(
|
168
|
-
|
45
|
+
define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) {
|
46
|
+
"use strict";
|
169
47
|
|
170
48
|
var oop = require("../lib/oop");
|
171
49
|
var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
|
172
50
|
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
173
51
|
|
174
|
-
var JavaScriptHighlightRules = function() {
|
52
|
+
var JavaScriptHighlightRules = function(options) {
|
175
53
|
var keywordMapper = this.createKeywordMapper({
|
176
54
|
"variable.language":
|
177
55
|
"Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors
|
@@ -296,19 +174,22 @@ var JavaScriptHighlightRules = function() {
|
|
296
174
|
}, {
|
297
175
|
token : ["punctuation.operator", "support.constant"],
|
298
176
|
regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
|
177
|
+
}, {
|
178
|
+
token : ["support.constant"],
|
179
|
+
regex : /that\b/
|
299
180
|
}, {
|
300
181
|
token : ["storage.type", "punctuation.operator", "support.function.firebug"],
|
301
|
-
regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
|
182
|
+
regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/
|
302
183
|
}, {
|
303
184
|
token : keywordMapper,
|
304
185
|
regex : identifierRe
|
305
186
|
}, {
|
306
187
|
token : "keyword.operator",
|
307
|
-
regex :
|
188
|
+
regex : /--|\+\+|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|[!$%&*+\-~\/^]=?/,
|
308
189
|
next : "start"
|
309
190
|
}, {
|
310
191
|
token : "punctuation.operator",
|
311
|
-
regex :
|
192
|
+
regex : /[?:,;.]/,
|
312
193
|
next : "start"
|
313
194
|
}, {
|
314
195
|
token : "paren.lparen",
|
@@ -317,10 +198,6 @@ var JavaScriptHighlightRules = function() {
|
|
317
198
|
}, {
|
318
199
|
token : "paren.rparen",
|
319
200
|
regex : /[\])}]/
|
320
|
-
}, {
|
321
|
-
token : "keyword.operator",
|
322
|
-
regex : /\/=?/,
|
323
|
-
next : "start"
|
324
201
|
}, {
|
325
202
|
token: "comment",
|
326
203
|
regex: /^#!.*$/
|
@@ -381,7 +258,7 @@ var JavaScriptHighlightRules = function() {
|
|
381
258
|
],
|
382
259
|
"regex_character_class": [
|
383
260
|
{
|
384
|
-
token: "regexp.keyword.operator",
|
261
|
+
token: "regexp.charclass.keyword.operator",
|
385
262
|
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
|
386
263
|
}, {
|
387
264
|
token: "constant.language.escape",
|
@@ -463,9 +340,49 @@ var JavaScriptHighlightRules = function() {
|
|
463
340
|
}
|
464
341
|
]
|
465
342
|
};
|
466
|
-
|
343
|
+
|
344
|
+
|
345
|
+
if (!options || !options.noES6) {
|
346
|
+
this.$rules.no_regex.unshift({
|
347
|
+
regex: "[{}]", onMatch: function(val, state, stack) {
|
348
|
+
this.next = val == "{" ? this.nextState : "";
|
349
|
+
if (val == "{" && stack.length) {
|
350
|
+
stack.unshift("start", state);
|
351
|
+
return "paren";
|
352
|
+
}
|
353
|
+
if (val == "}" && stack.length) {
|
354
|
+
stack.shift();
|
355
|
+
this.next = stack.shift();
|
356
|
+
if (this.next.indexOf("string") != -1)
|
357
|
+
return "paren.quasi.end";
|
358
|
+
}
|
359
|
+
return val == "{" ? "paren.lparen" : "paren.rparen";
|
360
|
+
},
|
361
|
+
nextState: "start"
|
362
|
+
}, {
|
363
|
+
token : "string.quasi.start",
|
364
|
+
regex : /`/,
|
365
|
+
push : [{
|
366
|
+
token : "constant.language.escape",
|
367
|
+
regex : escapedRe
|
368
|
+
}, {
|
369
|
+
token : "paren.quasi.start",
|
370
|
+
regex : /\${/,
|
371
|
+
push : "start"
|
372
|
+
}, {
|
373
|
+
token : "string.quasi.end",
|
374
|
+
regex : /`/,
|
375
|
+
next : "pop"
|
376
|
+
}, {
|
377
|
+
defaultToken: "string.quasi"
|
378
|
+
}]
|
379
|
+
});
|
380
|
+
}
|
381
|
+
|
467
382
|
this.embedRules(DocCommentHighlightRules, "doc-",
|
468
383
|
[ DocCommentHighlightRules.getEndRule("no_regex") ]);
|
384
|
+
|
385
|
+
this.normalizeRules();
|
469
386
|
};
|
470
387
|
|
471
388
|
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
|
@@ -473,52 +390,8 @@ oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
|
|
473
390
|
exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
|
474
391
|
});
|
475
392
|
|
476
|
-
define(
|
477
|
-
|
478
|
-
|
479
|
-
var oop = require("../lib/oop");
|
480
|
-
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
481
|
-
|
482
|
-
var DocCommentHighlightRules = function() {
|
483
|
-
|
484
|
-
this.$rules = {
|
485
|
-
"start" : [ {
|
486
|
-
token : "comment.doc.tag",
|
487
|
-
regex : "@[\\w\\d_]+" // TODO: fix email addresses
|
488
|
-
}, {
|
489
|
-
token : "comment.doc.tag",
|
490
|
-
regex : "\\bTODO\\b"
|
491
|
-
}, {
|
492
|
-
defaultToken : "comment.doc"
|
493
|
-
}]
|
494
|
-
};
|
495
|
-
};
|
496
|
-
|
497
|
-
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
|
498
|
-
|
499
|
-
DocCommentHighlightRules.getStartRule = function(start) {
|
500
|
-
return {
|
501
|
-
token : "comment.doc", // doc comment
|
502
|
-
regex : "\\/\\*(?=\\*)",
|
503
|
-
next : start
|
504
|
-
};
|
505
|
-
};
|
506
|
-
|
507
|
-
DocCommentHighlightRules.getEndRule = function (start) {
|
508
|
-
return {
|
509
|
-
token : "comment.doc", // closing comment
|
510
|
-
regex : "\\*\\/",
|
511
|
-
next : start
|
512
|
-
};
|
513
|
-
};
|
514
|
-
|
515
|
-
|
516
|
-
exports.DocCommentHighlightRules = DocCommentHighlightRules;
|
517
|
-
|
518
|
-
});
|
519
|
-
|
520
|
-
define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
|
521
|
-
|
393
|
+
define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) {
|
394
|
+
"use strict";
|
522
395
|
|
523
396
|
var Range = require("../range").Range;
|
524
397
|
|
@@ -557,8 +430,8 @@ var MatchingBraceOutdent = function() {};
|
|
557
430
|
exports.MatchingBraceOutdent = MatchingBraceOutdent;
|
558
431
|
});
|
559
432
|
|
560
|
-
define(
|
561
|
-
|
433
|
+
define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) {
|
434
|
+
"use strict";
|
562
435
|
|
563
436
|
var oop = require("../../lib/oop");
|
564
437
|
var Behaviour = require("../behaviour").Behaviour;
|
@@ -570,83 +443,34 @@ var SAFE_INSERT_IN_TOKENS =
|
|
570
443
|
var SAFE_INSERT_BEFORE_TOKENS =
|
571
444
|
["text", "paren.rparen", "punctuation.operator", "comment"];
|
572
445
|
|
573
|
-
|
574
|
-
var
|
575
|
-
var
|
576
|
-
var
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
iterator.stepForward();
|
593
|
-
return iterator.getCurrentTokenRow() !== cursor.row ||
|
594
|
-
this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS);
|
595
|
-
};
|
596
|
-
|
597
|
-
CstyleBehaviour.$matchTokenType = function(token, types) {
|
598
|
-
return types.indexOf(token.type || token) > -1;
|
599
|
-
};
|
600
|
-
|
601
|
-
CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) {
|
602
|
-
var cursor = editor.getCursorPosition();
|
603
|
-
var line = session.doc.getLine(cursor.row);
|
604
|
-
if (!this.isAutoInsertedClosing(cursor, line, autoInsertedLineEnd[0]))
|
605
|
-
autoInsertedBrackets = 0;
|
606
|
-
autoInsertedRow = cursor.row;
|
607
|
-
autoInsertedLineEnd = bracket + line.substr(cursor.column);
|
608
|
-
autoInsertedBrackets++;
|
609
|
-
};
|
610
|
-
|
611
|
-
CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) {
|
612
|
-
var cursor = editor.getCursorPosition();
|
613
|
-
var line = session.doc.getLine(cursor.row);
|
614
|
-
if (!this.isMaybeInsertedClosing(cursor, line))
|
615
|
-
maybeInsertedBrackets = 0;
|
616
|
-
maybeInsertedRow = cursor.row;
|
617
|
-
maybeInsertedLineStart = line.substr(0, cursor.column) + bracket;
|
618
|
-
maybeInsertedLineEnd = line.substr(cursor.column);
|
619
|
-
maybeInsertedBrackets++;
|
620
|
-
};
|
621
|
-
|
622
|
-
CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) {
|
623
|
-
return autoInsertedBrackets > 0 &&
|
624
|
-
cursor.row === autoInsertedRow &&
|
625
|
-
bracket === autoInsertedLineEnd[0] &&
|
626
|
-
line.substr(cursor.column) === autoInsertedLineEnd;
|
627
|
-
};
|
628
|
-
|
629
|
-
CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) {
|
630
|
-
return maybeInsertedBrackets > 0 &&
|
631
|
-
cursor.row === maybeInsertedRow &&
|
632
|
-
line.substr(cursor.column) === maybeInsertedLineEnd &&
|
633
|
-
line.substr(0, cursor.column) == maybeInsertedLineStart;
|
634
|
-
};
|
635
|
-
|
636
|
-
CstyleBehaviour.popAutoInsertedClosing = function() {
|
637
|
-
autoInsertedLineEnd = autoInsertedLineEnd.substr(1);
|
638
|
-
autoInsertedBrackets--;
|
639
|
-
};
|
640
|
-
|
641
|
-
CstyleBehaviour.clearMaybeInsertedClosing = function() {
|
642
|
-
maybeInsertedBrackets = 0;
|
643
|
-
maybeInsertedRow = -1;
|
446
|
+
var context;
|
447
|
+
var contextCache = {}
|
448
|
+
var initContext = function(editor) {
|
449
|
+
var id = -1;
|
450
|
+
if (editor.multiSelect) {
|
451
|
+
id = editor.selection.id;
|
452
|
+
if (contextCache.rangeCount != editor.multiSelect.rangeCount)
|
453
|
+
contextCache = {rangeCount: editor.multiSelect.rangeCount};
|
454
|
+
}
|
455
|
+
if (contextCache[id])
|
456
|
+
return context = contextCache[id];
|
457
|
+
context = contextCache[id] = {
|
458
|
+
autoInsertedBrackets: 0,
|
459
|
+
autoInsertedRow: -1,
|
460
|
+
autoInsertedLineEnd: "",
|
461
|
+
maybeInsertedBrackets: 0,
|
462
|
+
maybeInsertedRow: -1,
|
463
|
+
maybeInsertedLineStart: "",
|
464
|
+
maybeInsertedLineEnd: ""
|
644
465
|
};
|
466
|
+
};
|
645
467
|
|
646
|
-
|
468
|
+
var CstyleBehaviour = function() {
|
469
|
+
this.add("braces", "insertion", function(state, action, editor, session, text) {
|
647
470
|
var cursor = editor.getCursorPosition();
|
648
471
|
var line = session.doc.getLine(cursor.row);
|
649
472
|
if (text == '{') {
|
473
|
+
initContext(editor);
|
650
474
|
var selection = editor.getSelectionRange();
|
651
475
|
var selected = session.doc.getTextRange(selection);
|
652
476
|
if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) {
|
@@ -670,6 +494,7 @@ var CstyleBehaviour = function () {
|
|
670
494
|
}
|
671
495
|
}
|
672
496
|
} else if (text == '}') {
|
497
|
+
initContext(editor);
|
673
498
|
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
674
499
|
if (rightChar == '}') {
|
675
500
|
var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
|
@@ -682,9 +507,10 @@ var CstyleBehaviour = function () {
|
|
682
507
|
}
|
683
508
|
}
|
684
509
|
} else if (text == "\n" || text == "\r\n") {
|
510
|
+
initContext(editor);
|
685
511
|
var closing = "";
|
686
512
|
if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) {
|
687
|
-
closing = lang.stringRepeat("}", maybeInsertedBrackets);
|
513
|
+
closing = lang.stringRepeat("}", context.maybeInsertedBrackets);
|
688
514
|
CstyleBehaviour.clearMaybeInsertedClosing();
|
689
515
|
}
|
690
516
|
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
@@ -696,6 +522,7 @@ var CstyleBehaviour = function () {
|
|
696
522
|
} else if (closing) {
|
697
523
|
var next_indent = this.$getIndent(line);
|
698
524
|
} else {
|
525
|
+
CstyleBehaviour.clearMaybeInsertedClosing();
|
699
526
|
return;
|
700
527
|
}
|
701
528
|
var indent = next_indent + session.getTabString();
|
@@ -709,22 +536,24 @@ var CstyleBehaviour = function () {
|
|
709
536
|
}
|
710
537
|
});
|
711
538
|
|
712
|
-
this.add("braces", "deletion", function
|
539
|
+
this.add("braces", "deletion", function(state, action, editor, session, range) {
|
713
540
|
var selected = session.doc.getTextRange(range);
|
714
541
|
if (!range.isMultiLine() && selected == '{') {
|
542
|
+
initContext(editor);
|
715
543
|
var line = session.doc.getLine(range.start.row);
|
716
544
|
var rightChar = line.substring(range.end.column, range.end.column + 1);
|
717
545
|
if (rightChar == '}') {
|
718
546
|
range.end.column++;
|
719
547
|
return range;
|
720
548
|
} else {
|
721
|
-
maybeInsertedBrackets--;
|
549
|
+
context.maybeInsertedBrackets--;
|
722
550
|
}
|
723
551
|
}
|
724
552
|
});
|
725
553
|
|
726
|
-
this.add("parens", "insertion", function
|
554
|
+
this.add("parens", "insertion", function(state, action, editor, session, text) {
|
727
555
|
if (text == '(') {
|
556
|
+
initContext(editor);
|
728
557
|
var selection = editor.getSelectionRange();
|
729
558
|
var selected = session.doc.getTextRange(selection);
|
730
559
|
if (selected !== "" && editor.getWrapBehavioursEnabled()) {
|
@@ -740,6 +569,7 @@ var CstyleBehaviour = function () {
|
|
740
569
|
};
|
741
570
|
}
|
742
571
|
} else if (text == ')') {
|
572
|
+
initContext(editor);
|
743
573
|
var cursor = editor.getCursorPosition();
|
744
574
|
var line = session.doc.getLine(cursor.row);
|
745
575
|
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
@@ -756,9 +586,10 @@ var CstyleBehaviour = function () {
|
|
756
586
|
}
|
757
587
|
});
|
758
588
|
|
759
|
-
this.add("parens", "deletion", function
|
589
|
+
this.add("parens", "deletion", function(state, action, editor, session, range) {
|
760
590
|
var selected = session.doc.getTextRange(range);
|
761
591
|
if (!range.isMultiLine() && selected == '(') {
|
592
|
+
initContext(editor);
|
762
593
|
var line = session.doc.getLine(range.start.row);
|
763
594
|
var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
|
764
595
|
if (rightChar == ')') {
|
@@ -768,8 +599,9 @@ var CstyleBehaviour = function () {
|
|
768
599
|
}
|
769
600
|
});
|
770
601
|
|
771
|
-
this.add("brackets", "insertion", function
|
602
|
+
this.add("brackets", "insertion", function(state, action, editor, session, text) {
|
772
603
|
if (text == '[') {
|
604
|
+
initContext(editor);
|
773
605
|
var selection = editor.getSelectionRange();
|
774
606
|
var selected = session.doc.getTextRange(selection);
|
775
607
|
if (selected !== "" && editor.getWrapBehavioursEnabled()) {
|
@@ -785,6 +617,7 @@ var CstyleBehaviour = function () {
|
|
785
617
|
};
|
786
618
|
}
|
787
619
|
} else if (text == ']') {
|
620
|
+
initContext(editor);
|
788
621
|
var cursor = editor.getCursorPosition();
|
789
622
|
var line = session.doc.getLine(cursor.row);
|
790
623
|
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
@@ -801,9 +634,10 @@ var CstyleBehaviour = function () {
|
|
801
634
|
}
|
802
635
|
});
|
803
636
|
|
804
|
-
this.add("brackets", "deletion", function
|
637
|
+
this.add("brackets", "deletion", function(state, action, editor, session, range) {
|
805
638
|
var selected = session.doc.getTextRange(range);
|
806
639
|
if (!range.isMultiLine() && selected == '[') {
|
640
|
+
initContext(editor);
|
807
641
|
var line = session.doc.getLine(range.start.row);
|
808
642
|
var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
|
809
643
|
if (rightChar == ']') {
|
@@ -813,8 +647,9 @@ var CstyleBehaviour = function () {
|
|
813
647
|
}
|
814
648
|
});
|
815
649
|
|
816
|
-
this.add("string_dquotes", "insertion", function
|
650
|
+
this.add("string_dquotes", "insertion", function(state, action, editor, session, text) {
|
817
651
|
if (text == '"' || text == "'") {
|
652
|
+
initContext(editor);
|
818
653
|
var quote = text;
|
819
654
|
var selection = editor.getSelectionRange();
|
820
655
|
var selected = session.doc.getTextRange(selection);
|
@@ -866,9 +701,10 @@ var CstyleBehaviour = function () {
|
|
866
701
|
}
|
867
702
|
});
|
868
703
|
|
869
|
-
this.add("string_dquotes", "deletion", function
|
704
|
+
this.add("string_dquotes", "deletion", function(state, action, editor, session, range) {
|
870
705
|
var selected = session.doc.getTextRange(range);
|
871
706
|
if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
|
707
|
+
initContext(editor);
|
872
708
|
var line = session.doc.getLine(range.start.row);
|
873
709
|
var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
|
874
710
|
if (rightChar == selected) {
|
@@ -880,23 +716,90 @@ var CstyleBehaviour = function () {
|
|
880
716
|
|
881
717
|
};
|
882
718
|
|
883
|
-
|
719
|
+
|
720
|
+
CstyleBehaviour.isSaneInsertion = function(editor, session) {
|
721
|
+
var cursor = editor.getCursorPosition();
|
722
|
+
var iterator = new TokenIterator(session, cursor.row, cursor.column);
|
723
|
+
if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) {
|
724
|
+
var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1);
|
725
|
+
if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS))
|
726
|
+
return false;
|
727
|
+
}
|
728
|
+
iterator.stepForward();
|
729
|
+
return iterator.getCurrentTokenRow() !== cursor.row ||
|
730
|
+
this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS);
|
731
|
+
};
|
884
732
|
|
885
|
-
|
886
|
-
|
733
|
+
CstyleBehaviour.$matchTokenType = function(token, types) {
|
734
|
+
return types.indexOf(token.type || token) > -1;
|
735
|
+
};
|
887
736
|
|
888
|
-
|
737
|
+
CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) {
|
738
|
+
var cursor = editor.getCursorPosition();
|
739
|
+
var line = session.doc.getLine(cursor.row);
|
740
|
+
if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0]))
|
741
|
+
context.autoInsertedBrackets = 0;
|
742
|
+
context.autoInsertedRow = cursor.row;
|
743
|
+
context.autoInsertedLineEnd = bracket + line.substr(cursor.column);
|
744
|
+
context.autoInsertedBrackets++;
|
745
|
+
};
|
889
746
|
|
747
|
+
CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) {
|
748
|
+
var cursor = editor.getCursorPosition();
|
749
|
+
var line = session.doc.getLine(cursor.row);
|
750
|
+
if (!this.isMaybeInsertedClosing(cursor, line))
|
751
|
+
context.maybeInsertedBrackets = 0;
|
752
|
+
context.maybeInsertedRow = cursor.row;
|
753
|
+
context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket;
|
754
|
+
context.maybeInsertedLineEnd = line.substr(cursor.column);
|
755
|
+
context.maybeInsertedBrackets++;
|
756
|
+
};
|
890
757
|
|
891
|
-
|
892
|
-
|
893
|
-
|
758
|
+
CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) {
|
759
|
+
return context.autoInsertedBrackets > 0 &&
|
760
|
+
cursor.row === context.autoInsertedRow &&
|
761
|
+
bracket === context.autoInsertedLineEnd[0] &&
|
762
|
+
line.substr(cursor.column) === context.autoInsertedLineEnd;
|
763
|
+
};
|
894
764
|
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
);
|
765
|
+
CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) {
|
766
|
+
return context.maybeInsertedBrackets > 0 &&
|
767
|
+
cursor.row === context.maybeInsertedRow &&
|
768
|
+
line.substr(cursor.column) === context.maybeInsertedLineEnd &&
|
769
|
+
line.substr(0, cursor.column) == context.maybeInsertedLineStart;
|
770
|
+
};
|
771
|
+
|
772
|
+
CstyleBehaviour.popAutoInsertedClosing = function() {
|
773
|
+
context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1);
|
774
|
+
context.autoInsertedBrackets--;
|
775
|
+
};
|
776
|
+
|
777
|
+
CstyleBehaviour.clearMaybeInsertedClosing = function() {
|
778
|
+
if (context) {
|
779
|
+
context.maybeInsertedBrackets = 0;
|
780
|
+
context.maybeInsertedRow = -1;
|
781
|
+
}
|
782
|
+
};
|
783
|
+
|
784
|
+
|
785
|
+
|
786
|
+
oop.inherits(CstyleBehaviour, Behaviour);
|
787
|
+
|
788
|
+
exports.CstyleBehaviour = CstyleBehaviour;
|
789
|
+
});
|
790
|
+
|
791
|
+
define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {
|
792
|
+
"use strict";
|
793
|
+
|
794
|
+
var oop = require("../../lib/oop");
|
795
|
+
var Range = require("../../range").Range;
|
796
|
+
var BaseFoldMode = require("./fold_mode").FoldMode;
|
797
|
+
|
798
|
+
var FoldMode = exports.FoldMode = function(commentRegex) {
|
799
|
+
if (commentRegex) {
|
800
|
+
this.foldingStartMarker = new RegExp(
|
801
|
+
this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
|
802
|
+
);
|
900
803
|
this.foldingStopMarker = new RegExp(
|
901
804
|
this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
|
902
805
|
);
|
@@ -980,95 +883,168 @@ oop.inherits(FoldMode, BaseFoldMode);
|
|
980
883
|
|
981
884
|
});
|
982
885
|
|
983
|
-
define(
|
984
|
-
|
886
|
+
define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) {
|
887
|
+
"use strict";
|
985
888
|
|
986
889
|
var oop = require("../lib/oop");
|
987
890
|
var TextMode = require("./text").Mode;
|
988
|
-
var
|
989
|
-
var
|
990
|
-
var
|
991
|
-
var
|
891
|
+
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
|
892
|
+
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
|
893
|
+
var Range = require("../range").Range;
|
894
|
+
var WorkerClient = require("../worker/worker_client").WorkerClient;
|
895
|
+
var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
|
896
|
+
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
992
897
|
|
993
898
|
var Mode = function() {
|
994
|
-
this.HighlightRules =
|
995
|
-
|
996
|
-
this
|
899
|
+
this.HighlightRules = JavaScriptHighlightRules;
|
900
|
+
|
901
|
+
this.$outdent = new MatchingBraceOutdent();
|
902
|
+
this.$behaviour = new CstyleBehaviour();
|
903
|
+
this.foldingRules = new CStyleFoldMode();
|
997
904
|
};
|
998
|
-
|
999
905
|
oop.inherits(Mode, TextMode);
|
1000
906
|
|
1001
907
|
(function() {
|
1002
|
-
|
1003
|
-
this.blockComment = {start: "<!--", end: "-->"};
|
1004
908
|
|
1005
|
-
this
|
909
|
+
this.lineCommentStart = "//";
|
910
|
+
this.blockComment = {start: "/*", end: "*/"};
|
911
|
+
|
912
|
+
this.getNextLineIndent = function(state, line, tab) {
|
913
|
+
var indent = this.$getIndent(line);
|
914
|
+
|
915
|
+
var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
|
916
|
+
var tokens = tokenizedLine.tokens;
|
917
|
+
var endState = tokenizedLine.state;
|
918
|
+
|
919
|
+
if (tokens.length && tokens[tokens.length-1].type == "comment") {
|
920
|
+
return indent;
|
921
|
+
}
|
922
|
+
|
923
|
+
if (state == "start" || state == "no_regex") {
|
924
|
+
var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);
|
925
|
+
if (match) {
|
926
|
+
indent += tab;
|
927
|
+
}
|
928
|
+
} else if (state == "doc-start") {
|
929
|
+
if (endState == "start" || endState == "no_regex") {
|
930
|
+
return "";
|
931
|
+
}
|
932
|
+
var match = line.match(/^\s*(\/?)\*/);
|
933
|
+
if (match) {
|
934
|
+
if (match[1]) {
|
935
|
+
indent += " ";
|
936
|
+
}
|
937
|
+
indent += "* ";
|
938
|
+
}
|
939
|
+
}
|
940
|
+
|
941
|
+
return indent;
|
942
|
+
};
|
943
|
+
|
944
|
+
this.checkOutdent = function(state, line, input) {
|
945
|
+
return this.$outdent.checkOutdent(line, input);
|
946
|
+
};
|
947
|
+
|
948
|
+
this.autoOutdent = function(state, doc, row) {
|
949
|
+
this.$outdent.autoOutdent(doc, row);
|
950
|
+
};
|
951
|
+
|
952
|
+
this.createWorker = function(session) {
|
953
|
+
var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker");
|
954
|
+
worker.attachToDocument(session.getDocument());
|
955
|
+
|
956
|
+
worker.on("jslint", function(results) {
|
957
|
+
session.setAnnotations(results.data);
|
958
|
+
});
|
959
|
+
|
960
|
+
worker.on("terminate", function() {
|
961
|
+
session.clearAnnotations();
|
962
|
+
});
|
963
|
+
|
964
|
+
return worker;
|
965
|
+
};
|
966
|
+
|
967
|
+
this.$id = "ace/mode/javascript";
|
1006
968
|
}).call(Mode.prototype);
|
1007
969
|
|
1008
970
|
exports.Mode = Mode;
|
1009
971
|
});
|
1010
972
|
|
1011
|
-
define(
|
1012
|
-
|
973
|
+
define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
|
974
|
+
"use strict";
|
1013
975
|
|
1014
976
|
var oop = require("../lib/oop");
|
1015
|
-
var xmlUtil = require("./xml_util");
|
1016
977
|
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
1017
978
|
|
1018
979
|
var XmlHighlightRules = function(normalize) {
|
1019
980
|
this.$rules = {
|
1020
981
|
start : [
|
1021
|
-
{token : "
|
982
|
+
{token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"},
|
1022
983
|
{
|
1023
|
-
token : ["punctuation.
|
1024
|
-
regex : "(<\\?)(xml)(?=[\\s])", next : "
|
984
|
+
token : ["punctuation.xml-decl.xml", "keyword.xml-decl.xml"],
|
985
|
+
regex : "(<\\?)(xml)(?=[\\s])", next : "xml_decl", caseInsensitive: true
|
1025
986
|
},
|
1026
987
|
{
|
1027
|
-
token : ["punctuation.instruction.
|
1028
|
-
regex : "(<\\?)([-_a-zA-Z0-9]+)", next : "
|
988
|
+
token : ["punctuation.instruction.xml", "keyword.instruction.xml"],
|
989
|
+
regex : "(<\\?)([-_a-zA-Z0-9]+)", next : "processing_instruction",
|
1029
990
|
},
|
1030
|
-
{token : "comment", regex : "<\\!--", next : "comment"},
|
991
|
+
{token : "comment.xml", regex : "<\\!--", next : "comment"},
|
1031
992
|
{
|
1032
|
-
token : ["
|
1033
|
-
regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype"
|
993
|
+
token : ["xml-pe.doctype.xml", "xml-pe.doctype.xml"],
|
994
|
+
regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype", caseInsensitive: true
|
1034
995
|
},
|
1035
996
|
{include : "tag"},
|
1036
|
-
{
|
997
|
+
{token : "text.end-tag-open.xml", regex: "</"},
|
998
|
+
{token : "text.tag-open.xml", regex: "<"},
|
999
|
+
{include : "reference"},
|
1000
|
+
{defaultToken : "text.xml"}
|
1037
1001
|
],
|
1038
1002
|
|
1039
|
-
|
1040
|
-
|
1041
|
-
|
1042
|
-
|
1003
|
+
xml_decl : [{
|
1004
|
+
token : "entity.other.attribute-name.decl-attribute-name.xml",
|
1005
|
+
regex : "(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+"
|
1006
|
+
}, {
|
1007
|
+
token : "keyword.operator.decl-attribute-equals.xml",
|
1008
|
+
regex : "="
|
1009
|
+
}, {
|
1010
|
+
include: "whitespace"
|
1011
|
+
}, {
|
1012
|
+
include: "string"
|
1013
|
+
}, {
|
1014
|
+
token : "punctuation.xml-decl.xml",
|
1015
|
+
regex : "\\?>",
|
1016
|
+
next : "start"
|
1017
|
+
}],
|
1043
1018
|
|
1044
|
-
|
1045
|
-
{token : "punctuation.instruction.
|
1019
|
+
processing_instruction : [
|
1020
|
+
{token : "punctuation.instruction.xml", regex : "\\?>", next : "start"},
|
1021
|
+
{defaultToken : "instruction.xml"}
|
1046
1022
|
],
|
1047
1023
|
|
1048
1024
|
doctype : [
|
1049
|
-
{include : "
|
1025
|
+
{include : "whitespace"},
|
1050
1026
|
{include : "string"},
|
1051
|
-
{token : "
|
1052
|
-
{token : "xml-pe", regex : "[-_a-zA-Z0-9:]+"},
|
1053
|
-
{token : "punctuation.
|
1027
|
+
{token : "xml-pe.doctype.xml", regex : ">", next : "start"},
|
1028
|
+
{token : "xml-pe.xml", regex : "[-_a-zA-Z0-9:]+"},
|
1029
|
+
{token : "punctuation.int-subset", regex : "\\[", push : "int_subset"}
|
1054
1030
|
],
|
1055
1031
|
|
1056
|
-
|
1057
|
-
token : "text",
|
1032
|
+
int_subset : [{
|
1033
|
+
token : "text.xml",
|
1058
1034
|
regex : "\\s+"
|
1059
1035
|
}, {
|
1060
|
-
token: "punctuation.
|
1036
|
+
token: "punctuation.int-subset.xml",
|
1061
1037
|
regex: "]",
|
1062
1038
|
next: "pop"
|
1063
1039
|
}, {
|
1064
|
-
token : ["punctuation.
|
1040
|
+
token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"],
|
1065
1041
|
regex : "(<\\!)([-_a-zA-Z0-9]+)",
|
1066
1042
|
push : [{
|
1067
1043
|
token : "text",
|
1068
1044
|
regex : "\\s+"
|
1069
1045
|
},
|
1070
1046
|
{
|
1071
|
-
token : "punctuation.
|
1047
|
+
token : "punctuation.markup-decl.xml",
|
1072
1048
|
regex : ">",
|
1073
1049
|
next : "pop"
|
1074
1050
|
},
|
@@ -1076,75 +1052,85 @@ var XmlHighlightRules = function(normalize) {
|
|
1076
1052
|
}],
|
1077
1053
|
|
1078
1054
|
cdata : [
|
1079
|
-
{token : "string.
|
1080
|
-
{token : "text", regex : "\\s+"},
|
1081
|
-
{token : "text", regex : "(?:[^\\]]|\\](?!\\]>))+"}
|
1055
|
+
{token : "string.cdata.xml", regex : "\\]\\]>", next : "start"},
|
1056
|
+
{token : "text.xml", regex : "\\s+"},
|
1057
|
+
{token : "text.xml", regex : "(?:[^\\]]|\\](?!\\]>))+"}
|
1082
1058
|
],
|
1083
1059
|
|
1084
1060
|
comment : [
|
1085
|
-
{token : "comment", regex : "-->", next : "start"},
|
1086
|
-
{defaultToken : "comment"}
|
1061
|
+
{token : "comment.xml", regex : "-->", next : "start"},
|
1062
|
+
{defaultToken : "comment.xml"}
|
1087
1063
|
],
|
1088
1064
|
|
1065
|
+
reference : [{
|
1066
|
+
token : "constant.language.escape.reference.xml",
|
1067
|
+
regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
|
1068
|
+
}],
|
1069
|
+
|
1070
|
+
attr_reference : [{
|
1071
|
+
token : "constant.language.escape.reference.attribute-value.xml",
|
1072
|
+
regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
|
1073
|
+
}],
|
1074
|
+
|
1089
1075
|
tag : [{
|
1090
|
-
token : ["meta.tag.punctuation.
|
1091
|
-
regex : "(<)((?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+)",
|
1076
|
+
token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"],
|
1077
|
+
regex : "(?:(<)|(</))((?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+)",
|
1092
1078
|
next: [
|
1093
1079
|
{include : "attributes"},
|
1094
|
-
{token : "meta.tag.punctuation.
|
1095
|
-
]
|
1096
|
-
}, {
|
1097
|
-
token : ["meta.tag.punctuation.begin", "meta.tag.name"],
|
1098
|
-
regex : "(</)((?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+)",
|
1099
|
-
next: [
|
1100
|
-
{include : "space"},
|
1101
|
-
{token : "meta.tag.punctuation.end", regex : ">", next : "start"}
|
1080
|
+
{token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : "start"}
|
1102
1081
|
]
|
1103
1082
|
}],
|
1104
1083
|
|
1105
|
-
|
1106
|
-
{token : "text", regex : "\\s+"}
|
1084
|
+
tag_whitespace : [
|
1085
|
+
{token : "text.tag-whitespace.xml", regex : "\\s+"}
|
1086
|
+
],
|
1087
|
+
whitespace : [
|
1088
|
+
{token : "text.whitespace.xml", regex : "\\s+"}
|
1107
1089
|
],
|
1108
|
-
|
1109
|
-
reference : [{
|
1110
|
-
token : "constant.language.escape",
|
1111
|
-
regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
|
1112
|
-
}, {
|
1113
|
-
token : "text", regex : "&"
|
1114
|
-
}],
|
1115
|
-
|
1116
1090
|
string: [{
|
1117
|
-
token : "string",
|
1091
|
+
token : "string.xml",
|
1118
1092
|
regex : "'",
|
1119
|
-
push :
|
1093
|
+
push : [
|
1094
|
+
{token : "string.xml", regex: "'", next: "pop"},
|
1095
|
+
{defaultToken : "string.xml"}
|
1096
|
+
]
|
1120
1097
|
}, {
|
1121
|
-
token : "string",
|
1098
|
+
token : "string.xml",
|
1122
1099
|
regex : '"',
|
1123
|
-
push :
|
1100
|
+
push : [
|
1101
|
+
{token : "string.xml", regex: '"', next: "pop"},
|
1102
|
+
{defaultToken : "string.xml"}
|
1103
|
+
]
|
1124
1104
|
}],
|
1125
1105
|
|
1126
|
-
qstring_inner: [
|
1127
|
-
{token : "string", regex: "'", next: "pop"},
|
1128
|
-
{include : "reference"},
|
1129
|
-
{defaultToken : "string"}
|
1130
|
-
],
|
1131
|
-
|
1132
|
-
qqstring_inner: [
|
1133
|
-
{token : "string", regex: '"', next: "pop"},
|
1134
|
-
{include : "reference"},
|
1135
|
-
{defaultToken : "string"}
|
1136
|
-
],
|
1137
|
-
|
1138
1106
|
attributes: [{
|
1139
|
-
token : "entity.other.attribute-name",
|
1107
|
+
token : "entity.other.attribute-name.xml",
|
1140
1108
|
regex : "(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+"
|
1141
1109
|
}, {
|
1142
|
-
token : "keyword.operator.
|
1110
|
+
token : "keyword.operator.attribute-equals.xml",
|
1143
1111
|
regex : "="
|
1144
1112
|
}, {
|
1145
|
-
include
|
1113
|
+
include: "tag_whitespace"
|
1146
1114
|
}, {
|
1147
|
-
include
|
1115
|
+
include: "attribute_value"
|
1116
|
+
}],
|
1117
|
+
|
1118
|
+
attribute_value: [{
|
1119
|
+
token : "string.attribute-value.xml",
|
1120
|
+
regex : "'",
|
1121
|
+
push : [
|
1122
|
+
{token : "string.attribute-value.xml", regex: "'", next: "pop"},
|
1123
|
+
{include : "attr_reference"},
|
1124
|
+
{defaultToken : "string.attribute-value.xml"}
|
1125
|
+
]
|
1126
|
+
}, {
|
1127
|
+
token : "string.attribute-value.xml",
|
1128
|
+
regex : '"',
|
1129
|
+
push : [
|
1130
|
+
{token : "string.attribute-value.xml", regex: '"', next: "pop"},
|
1131
|
+
{include : "attr_reference"},
|
1132
|
+
{defaultToken : "string.attribute-value.xml"}
|
1133
|
+
]
|
1148
1134
|
}]
|
1149
1135
|
};
|
1150
1136
|
|
@@ -1157,18 +1143,17 @@ var XmlHighlightRules = function(normalize) {
|
|
1157
1143
|
|
1158
1144
|
this.embedTagRules = function(HighlightRules, prefix, tag){
|
1159
1145
|
this.$rules.tag.unshift({
|
1160
|
-
token : ["meta.tag.punctuation.
|
1161
|
-
regex : "(<)(" + tag + ")",
|
1146
|
+
token : ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
|
1147
|
+
regex : "(<)(" + tag + "(?=\\s|>|$))",
|
1162
1148
|
next: [
|
1163
|
-
{include : "space"},
|
1164
1149
|
{include : "attributes"},
|
1165
|
-
{token : "meta.tag.punctuation.
|
1150
|
+
{token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : prefix + "start"}
|
1166
1151
|
]
|
1167
1152
|
});
|
1168
1153
|
|
1169
1154
|
this.$rules[tag + "-end"] = [
|
1170
|
-
{include : "
|
1171
|
-
{token : "meta.tag.punctuation.
|
1155
|
+
{include : "attributes"},
|
1156
|
+
{token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next: "start",
|
1172
1157
|
onMatch : function(value, currentState, stack) {
|
1173
1158
|
stack.splice(0);
|
1174
1159
|
return this.token;
|
@@ -1176,14 +1161,14 @@ var XmlHighlightRules = function(normalize) {
|
|
1176
1161
|
]
|
1177
1162
|
|
1178
1163
|
this.embedRules(HighlightRules, prefix, [{
|
1179
|
-
token: ["meta.tag.punctuation.
|
1180
|
-
regex : "(</)(" + tag + ")",
|
1164
|
+
token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
|
1165
|
+
regex : "(</)(" + tag + "(?=\\s|>|$))",
|
1181
1166
|
next: tag + "-end"
|
1182
1167
|
}, {
|
1183
|
-
token: "string.
|
1168
|
+
token: "string.cdata.xml",
|
1184
1169
|
regex : "<\\!\\[CDATA\\["
|
1185
1170
|
}, {
|
1186
|
-
token: "string.
|
1171
|
+
token: "string.cdata.xml",
|
1187
1172
|
regex : "\\]\\]>"
|
1188
1173
|
}]);
|
1189
1174
|
};
|
@@ -1195,124 +1180,112 @@ oop.inherits(XmlHighlightRules, TextHighlightRules);
|
|
1195
1180
|
exports.XmlHighlightRules = XmlHighlightRules;
|
1196
1181
|
});
|
1197
1182
|
|
1198
|
-
define(
|
1183
|
+
define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module) {
|
1184
|
+
"use strict";
|
1199
1185
|
|
1186
|
+
var oop = require("../../lib/oop");
|
1187
|
+
var Behaviour = require("../behaviour").Behaviour;
|
1188
|
+
var TokenIterator = require("../../token_iterator").TokenIterator;
|
1200
1189
|
|
1201
|
-
function
|
1202
|
-
return
|
1203
|
-
token : "string",
|
1204
|
-
regex : '"',
|
1205
|
-
next : state + "_qqstring"
|
1206
|
-
}, {
|
1207
|
-
token : "string",
|
1208
|
-
regex : "'",
|
1209
|
-
next : state + "_qstring"
|
1210
|
-
}];
|
1190
|
+
function is(token, type) {
|
1191
|
+
return token.type.lastIndexOf(type + ".xml") > -1;
|
1211
1192
|
}
|
1212
1193
|
|
1213
|
-
function
|
1214
|
-
return [
|
1215
|
-
{token : "string", regex : quote, next : state},
|
1216
|
-
{
|
1217
|
-
token : "constant.language.escape",
|
1218
|
-
regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
|
1219
|
-
},
|
1220
|
-
{defaultToken : "string"}
|
1221
|
-
];
|
1222
|
-
}
|
1194
|
+
var XmlBehaviour = function () {
|
1223
1195
|
|
1224
|
-
|
1225
|
-
|
1226
|
-
|
1227
|
-
|
1228
|
-
|
1229
|
-
|
1230
|
-
|
1231
|
-
|
1232
|
-
|
1233
|
-
|
1234
|
-
return "meta.tag.tag-name";
|
1235
|
-
},
|
1236
|
-
regex : "[-_a-zA-Z0-9:]+",
|
1237
|
-
next : name + "_embed_attribute_list"
|
1238
|
-
}, {
|
1239
|
-
token: "empty",
|
1240
|
-
regex: "",
|
1241
|
-
next : name + "_embed_attribute_list"
|
1242
|
-
}];
|
1196
|
+
this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
|
1197
|
+
if (text == '"' || text == "'") {
|
1198
|
+
var quote = text;
|
1199
|
+
var selected = session.doc.getTextRange(editor.getSelectionRange());
|
1200
|
+
if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
|
1201
|
+
return {
|
1202
|
+
text: quote + selected + quote,
|
1203
|
+
selection: false
|
1204
|
+
};
|
1205
|
+
}
|
1243
1206
|
|
1244
|
-
|
1245
|
-
|
1246
|
-
|
1247
|
-
|
1248
|
-
|
1249
|
-
regex : "/?>",
|
1250
|
-
next : nextState
|
1251
|
-
}, {
|
1252
|
-
token : "keyword.operator",
|
1253
|
-
regex : "="
|
1254
|
-
}, {
|
1255
|
-
token : "entity.other.attribute-name",
|
1256
|
-
regex : "[-_a-zA-Z0-9:]+"
|
1257
|
-
}, {
|
1258
|
-
token : "constant.numeric", // float
|
1259
|
-
regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
|
1260
|
-
}, {
|
1261
|
-
token : "text",
|
1262
|
-
regex : "\\s+"
|
1263
|
-
}].concat(string(name));
|
1264
|
-
};
|
1207
|
+
var cursor = editor.getCursorPosition();
|
1208
|
+
var line = session.doc.getLine(cursor.row);
|
1209
|
+
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
1210
|
+
var iterator = new TokenIterator(session, cursor.row, cursor.column);
|
1211
|
+
var token = iterator.getCurrentToken();
|
1265
1212
|
|
1266
|
-
|
1213
|
+
if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
|
1214
|
+
return {
|
1215
|
+
text: "",
|
1216
|
+
selection: [1, 1]
|
1217
|
+
};
|
1218
|
+
}
|
1267
1219
|
|
1268
|
-
|
1220
|
+
if (!token)
|
1221
|
+
token = iterator.stepBackward();
|
1269
1222
|
|
1223
|
+
if (!token)
|
1224
|
+
return;
|
1270
1225
|
|
1271
|
-
|
1272
|
-
|
1273
|
-
|
1274
|
-
var
|
1226
|
+
while (is(token, "tag-whitespace") || is(token, "whitespace")) {
|
1227
|
+
token = iterator.stepBackward();
|
1228
|
+
}
|
1229
|
+
var rightSpace = !rightChar || rightChar.match(/\s/);
|
1230
|
+
if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
|
1231
|
+
return {
|
1232
|
+
text: quote + quote,
|
1233
|
+
selection: [1, 1]
|
1234
|
+
};
|
1235
|
+
}
|
1236
|
+
}
|
1237
|
+
});
|
1275
1238
|
|
1276
|
-
function
|
1277
|
-
|
1278
|
-
|
1279
|
-
|
1239
|
+
this.add("string_dquotes", "deletion", function(state, action, editor, session, range) {
|
1240
|
+
var selected = session.doc.getTextRange(range);
|
1241
|
+
if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
|
1242
|
+
var line = session.doc.getLine(range.start.row);
|
1243
|
+
var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
|
1244
|
+
if (rightChar == selected) {
|
1245
|
+
range.end.column++;
|
1246
|
+
return range;
|
1247
|
+
}
|
1248
|
+
}
|
1280
1249
|
});
|
1281
|
-
return hasType;
|
1282
|
-
}
|
1283
1250
|
|
1284
|
-
var XmlBehaviour = function () {
|
1285
|
-
|
1286
|
-
this.inherit(CstyleBehaviour, ["string_dquotes"]); // Get string behaviour
|
1287
|
-
|
1288
1251
|
this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
|
1289
1252
|
if (text == '>') {
|
1290
1253
|
var position = editor.getCursorPosition();
|
1291
1254
|
var iterator = new TokenIterator(session, position.row, position.column);
|
1292
|
-
var token = iterator.getCurrentToken();
|
1293
|
-
|
1294
|
-
if (token && hasType(token, 'string') && iterator.getCurrentTokenColumn() + token.value.length > position.column)
|
1255
|
+
var token = iterator.getCurrentToken() || iterator.stepBackward();
|
1256
|
+
if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
|
1295
1257
|
return;
|
1296
|
-
|
1297
|
-
if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){
|
1298
|
-
do {
|
1299
|
-
token = iterator.stepBackward();
|
1300
|
-
} while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text')));
|
1301
|
-
} else {
|
1302
|
-
atCursor = true;
|
1303
|
-
}
|
1304
|
-
if (!token || !hasType(token, 'meta.tag.name') || iterator.stepBackward().value.match('/')) {
|
1258
|
+
if (is(token, "reference.attribute-value"))
|
1305
1259
|
return;
|
1260
|
+
if (is(token, "attribute-value")) {
|
1261
|
+
var firstChar = token.value.charAt(0);
|
1262
|
+
if (firstChar == '"' || firstChar == "'") {
|
1263
|
+
var lastChar = token.value.charAt(token.value.length - 1);
|
1264
|
+
var tokenEnd = iterator.getCurrentTokenColumn() + token.value.length;
|
1265
|
+
if (tokenEnd > position.column || tokenEnd == position.column && firstChar != lastChar)
|
1266
|
+
return;
|
1267
|
+
}
|
1306
1268
|
}
|
1307
|
-
|
1308
|
-
|
1309
|
-
var tag = tag.substring(0, position.column - token.start);
|
1269
|
+
while (!is(token, "tag-name")) {
|
1270
|
+
token = iterator.stepBackward();
|
1310
1271
|
}
|
1311
1272
|
|
1273
|
+
var tokenRow = iterator.getCurrentTokenRow();
|
1274
|
+
var tokenColumn = iterator.getCurrentTokenColumn();
|
1275
|
+
if (is(iterator.stepBackward(), "end-tag-open"))
|
1276
|
+
return;
|
1277
|
+
|
1278
|
+
var element = token.value;
|
1279
|
+
if (tokenRow == position.row)
|
1280
|
+
element = element.substring(0, position.column - tokenColumn);
|
1281
|
+
|
1282
|
+
if (this.voidElements.hasOwnProperty(element.toLowerCase()))
|
1283
|
+
return;
|
1284
|
+
|
1312
1285
|
return {
|
1313
|
-
text: '>' + '</' +
|
1286
|
+
text: '>' + '</' + element + '>',
|
1314
1287
|
selection: [1, 1]
|
1315
|
-
}
|
1288
|
+
};
|
1316
1289
|
}
|
1317
1290
|
});
|
1318
1291
|
|
@@ -1328,19 +1301,20 @@ var XmlBehaviour = function () {
|
|
1328
1301
|
return {
|
1329
1302
|
text: '\n' + indent + '\n' + next_indent,
|
1330
1303
|
selection: [1, indent.length, 1, indent.length]
|
1331
|
-
}
|
1304
|
+
};
|
1332
1305
|
}
|
1333
1306
|
}
|
1334
1307
|
});
|
1335
1308
|
|
1336
|
-
}
|
1309
|
+
};
|
1310
|
+
|
1337
1311
|
oop.inherits(XmlBehaviour, Behaviour);
|
1338
1312
|
|
1339
1313
|
exports.XmlBehaviour = XmlBehaviour;
|
1340
1314
|
});
|
1341
1315
|
|
1342
|
-
define(
|
1343
|
-
|
1316
|
+
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) {
|
1317
|
+
"use strict";
|
1344
1318
|
|
1345
1319
|
var oop = require("../../lib/oop");
|
1346
1320
|
var lang = require("../../lib/lang");
|
@@ -1348,91 +1322,118 @@ var Range = require("../../range").Range;
|
|
1348
1322
|
var BaseFoldMode = require("./fold_mode").FoldMode;
|
1349
1323
|
var TokenIterator = require("../../token_iterator").TokenIterator;
|
1350
1324
|
|
1351
|
-
var FoldMode = exports.FoldMode = function(voidElements) {
|
1325
|
+
var FoldMode = exports.FoldMode = function(voidElements, optionalEndTags) {
|
1352
1326
|
BaseFoldMode.call(this);
|
1353
1327
|
this.voidElements = voidElements || {};
|
1328
|
+
this.optionalEndTags = oop.mixin({}, this.voidElements);
|
1329
|
+
if (optionalEndTags)
|
1330
|
+
oop.mixin(this.optionalEndTags, optionalEndTags);
|
1331
|
+
|
1354
1332
|
};
|
1355
1333
|
oop.inherits(FoldMode, BaseFoldMode);
|
1356
1334
|
|
1335
|
+
var Tag = function() {
|
1336
|
+
this.tagName = "";
|
1337
|
+
this.closing = false;
|
1338
|
+
this.selfClosing = false;
|
1339
|
+
this.start = {row: 0, column: 0};
|
1340
|
+
this.end = {row: 0, column: 0};
|
1341
|
+
};
|
1342
|
+
|
1343
|
+
function is(token, type) {
|
1344
|
+
return token.type.lastIndexOf(type + ".xml") > -1;
|
1345
|
+
}
|
1346
|
+
|
1357
1347
|
(function() {
|
1358
1348
|
|
1359
1349
|
this.getFoldWidget = function(session, foldStyle, row) {
|
1360
1350
|
var tag = this._getFirstTagInLine(session, row);
|
1361
1351
|
|
1362
|
-
if (tag
|
1363
|
-
return foldStyle == "markbeginend" ? "end" : "";
|
1364
|
-
|
1365
|
-
if (!tag.tagName || this.voidElements[tag.tagName.toLowerCase()])
|
1352
|
+
if (!tag)
|
1366
1353
|
return "";
|
1367
1354
|
|
1368
|
-
if (tag.selfClosing)
|
1355
|
+
if (tag.closing || (!tag.tagName && tag.selfClosing))
|
1356
|
+
return foldStyle == "markbeginend" ? "end" : "";
|
1357
|
+
|
1358
|
+
if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
|
1369
1359
|
return "";
|
1370
1360
|
|
1371
|
-
if (
|
1361
|
+
if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
|
1372
1362
|
return "";
|
1373
1363
|
|
1374
1364
|
return "start";
|
1375
1365
|
};
|
1376
|
-
|
1377
1366
|
this._getFirstTagInLine = function(session, row) {
|
1378
1367
|
var tokens = session.getTokens(row);
|
1379
|
-
var
|
1368
|
+
var tag = new Tag();
|
1369
|
+
|
1380
1370
|
for (var i = 0; i < tokens.length; i++) {
|
1381
1371
|
var token = tokens[i];
|
1382
|
-
if (token
|
1383
|
-
|
1384
|
-
|
1385
|
-
|
1372
|
+
if (is(token, "tag-open")) {
|
1373
|
+
tag.end.column = tag.start.column + token.value.length;
|
1374
|
+
tag.closing = is(token, "end-tag-open");
|
1375
|
+
token = tokens[++i];
|
1376
|
+
if (!token)
|
1377
|
+
return null;
|
1378
|
+
tag.tagName = token.value;
|
1379
|
+
tag.end.column += token.value.length;
|
1380
|
+
for (i++; i < tokens.length; i++) {
|
1381
|
+
token = tokens[i];
|
1382
|
+
tag.end.column += token.value.length;
|
1383
|
+
if (is(token, "tag-close")) {
|
1384
|
+
tag.selfClosing = token.value == '/>';
|
1385
|
+
break;
|
1386
|
+
}
|
1387
|
+
}
|
1388
|
+
return tag;
|
1389
|
+
} else if (is(token, "tag-close")) {
|
1390
|
+
tag.selfClosing = token.value == '/>';
|
1391
|
+
return tag;
|
1392
|
+
}
|
1393
|
+
tag.start.column += token.value.length;
|
1386
1394
|
}
|
1387
|
-
|
1388
|
-
return
|
1395
|
+
|
1396
|
+
return null;
|
1389
1397
|
};
|
1390
1398
|
|
1391
|
-
this.
|
1392
|
-
|
1393
|
-
|
1394
|
-
var match = tag.match(this.tagRe);
|
1399
|
+
this._findEndTagInLine = function(session, row, tagName, startColumn) {
|
1400
|
+
var tokens = session.getTokens(row);
|
1395
1401
|
var column = 0;
|
1396
|
-
|
1397
|
-
|
1398
|
-
value
|
1399
|
-
|
1400
|
-
|
1401
|
-
|
1402
|
-
|
1403
|
-
|
1404
|
-
|
1402
|
+
for (var i = 0; i < tokens.length; i++) {
|
1403
|
+
var token = tokens[i];
|
1404
|
+
column += token.value.length;
|
1405
|
+
if (column < startColumn)
|
1406
|
+
continue;
|
1407
|
+
if (is(token, "end-tag-open")) {
|
1408
|
+
token = tokens[i + 1];
|
1409
|
+
if (token && token.value == tagName)
|
1410
|
+
return true;
|
1411
|
+
}
|
1412
|
+
}
|
1413
|
+
return false;
|
1405
1414
|
};
|
1406
1415
|
this._readTagForward = function(iterator) {
|
1407
1416
|
var token = iterator.getCurrentToken();
|
1408
1417
|
if (!token)
|
1409
1418
|
return null;
|
1410
|
-
|
1411
|
-
var
|
1412
|
-
var start;
|
1413
|
-
|
1419
|
+
|
1420
|
+
var tag = new Tag();
|
1414
1421
|
do {
|
1415
|
-
if (token
|
1416
|
-
|
1417
|
-
|
1418
|
-
|
1419
|
-
|
1420
|
-
|
1421
|
-
|
1422
|
-
|
1423
|
-
|
1424
|
-
|
1425
|
-
|
1426
|
-
|
1427
|
-
row: iterator.getCurrentTokenRow(),
|
1428
|
-
column: iterator.getCurrentTokenColumn() + token.value.length
|
1429
|
-
};
|
1430
|
-
iterator.stepForward();
|
1431
|
-
return tag;
|
1432
|
-
}
|
1422
|
+
if (is(token, "tag-open")) {
|
1423
|
+
tag.closing = is(token, "end-tag-open");
|
1424
|
+
tag.start.row = iterator.getCurrentTokenRow();
|
1425
|
+
tag.start.column = iterator.getCurrentTokenColumn();
|
1426
|
+
} else if (is(token, "tag-name")) {
|
1427
|
+
tag.tagName = token.value;
|
1428
|
+
} else if (is(token, "tag-close")) {
|
1429
|
+
tag.selfClosing = token.value == "/>";
|
1430
|
+
tag.end.row = iterator.getCurrentTokenRow();
|
1431
|
+
tag.end.column = iterator.getCurrentTokenColumn() + token.value.length;
|
1432
|
+
iterator.stepForward();
|
1433
|
+
return tag;
|
1433
1434
|
}
|
1434
1435
|
} while(token = iterator.stepForward());
|
1435
|
-
|
1436
|
+
|
1436
1437
|
return null;
|
1437
1438
|
};
|
1438
1439
|
|
@@ -1440,32 +1441,24 @@ oop.inherits(FoldMode, BaseFoldMode);
|
|
1440
1441
|
var token = iterator.getCurrentToken();
|
1441
1442
|
if (!token)
|
1442
1443
|
return null;
|
1443
|
-
|
1444
|
-
var value = "";
|
1445
|
-
var end;
|
1446
1444
|
|
1445
|
+
var tag = new Tag();
|
1447
1446
|
do {
|
1448
|
-
if (token
|
1449
|
-
|
1450
|
-
|
1451
|
-
|
1452
|
-
|
1453
|
-
|
1454
|
-
|
1455
|
-
|
1456
|
-
|
1457
|
-
|
1458
|
-
|
1459
|
-
|
1460
|
-
row: iterator.getCurrentTokenRow(),
|
1461
|
-
column: iterator.getCurrentTokenColumn()
|
1462
|
-
};
|
1463
|
-
iterator.stepBackward();
|
1464
|
-
return tag;
|
1465
|
-
}
|
1447
|
+
if (is(token, "tag-open")) {
|
1448
|
+
tag.closing = is(token, "end-tag-open");
|
1449
|
+
tag.start.row = iterator.getCurrentTokenRow();
|
1450
|
+
tag.start.column = iterator.getCurrentTokenColumn();
|
1451
|
+
iterator.stepBackward();
|
1452
|
+
return tag;
|
1453
|
+
} else if (is(token, "tag-name")) {
|
1454
|
+
tag.tagName = token.value;
|
1455
|
+
} else if (is(token, "tag-close")) {
|
1456
|
+
tag.selfClosing = token.value == "/>";
|
1457
|
+
tag.end.row = iterator.getCurrentTokenRow();
|
1458
|
+
tag.end.column = iterator.getCurrentTokenColumn() + token.value.length;
|
1466
1459
|
}
|
1467
1460
|
} while(token = iterator.stepBackward());
|
1468
|
-
|
1461
|
+
|
1469
1462
|
return null;
|
1470
1463
|
};
|
1471
1464
|
|
@@ -1476,10 +1469,10 @@ oop.inherits(FoldMode, BaseFoldMode);
|
|
1476
1469
|
if (!tag || top.tagName == tag.tagName) {
|
1477
1470
|
return stack.pop();
|
1478
1471
|
}
|
1479
|
-
else if (this.
|
1472
|
+
else if (this.optionalEndTags.hasOwnProperty(tag.tagName)) {
|
1480
1473
|
return;
|
1481
1474
|
}
|
1482
|
-
else if (this.
|
1475
|
+
else if (this.optionalEndTags.hasOwnProperty(top.tagName)) {
|
1483
1476
|
stack.pop();
|
1484
1477
|
continue;
|
1485
1478
|
} else {
|
@@ -1491,7 +1484,7 @@ oop.inherits(FoldMode, BaseFoldMode);
|
|
1491
1484
|
this.getFoldWidgetRange = function(session, foldStyle, row) {
|
1492
1485
|
var firstTag = this._getFirstTagInLine(session, row);
|
1493
1486
|
|
1494
|
-
if (!firstTag
|
1487
|
+
if (!firstTag)
|
1495
1488
|
return null;
|
1496
1489
|
|
1497
1490
|
var isBackward = firstTag.closing || firstTag.selfClosing;
|
@@ -1499,10 +1492,10 @@ oop.inherits(FoldMode, BaseFoldMode);
|
|
1499
1492
|
var tag;
|
1500
1493
|
|
1501
1494
|
if (!isBackward) {
|
1502
|
-
var iterator = new TokenIterator(session, row, firstTag.column);
|
1495
|
+
var iterator = new TokenIterator(session, row, firstTag.start.column);
|
1503
1496
|
var start = {
|
1504
1497
|
row: row,
|
1505
|
-
column: firstTag.column + firstTag.tagName.length + 2
|
1498
|
+
column: firstTag.start.column + firstTag.tagName.length + 2
|
1506
1499
|
};
|
1507
1500
|
while (tag = this._readTagForward(iterator)) {
|
1508
1501
|
if (tag.selfClosing) {
|
@@ -1520,15 +1513,15 @@ oop.inherits(FoldMode, BaseFoldMode);
|
|
1520
1513
|
return Range.fromPoints(start, tag.start);
|
1521
1514
|
}
|
1522
1515
|
else {
|
1523
|
-
stack.push(tag)
|
1516
|
+
stack.push(tag);
|
1524
1517
|
}
|
1525
1518
|
}
|
1526
1519
|
}
|
1527
1520
|
else {
|
1528
|
-
var iterator = new TokenIterator(session, row, firstTag.column
|
1521
|
+
var iterator = new TokenIterator(session, row, firstTag.end.column);
|
1529
1522
|
var end = {
|
1530
1523
|
row: row,
|
1531
|
-
column: firstTag.column
|
1524
|
+
column: firstTag.start.column
|
1532
1525
|
};
|
1533
1526
|
|
1534
1527
|
while (tag = this._readTagBackward(iterator)) {
|
@@ -1549,7 +1542,7 @@ oop.inherits(FoldMode, BaseFoldMode);
|
|
1549
1542
|
}
|
1550
1543
|
}
|
1551
1544
|
else {
|
1552
|
-
stack.push(tag)
|
1545
|
+
stack.push(tag);
|
1553
1546
|
}
|
1554
1547
|
}
|
1555
1548
|
}
|
@@ -1560,127 +1553,38 @@ oop.inherits(FoldMode, BaseFoldMode);
|
|
1560
1553
|
|
1561
1554
|
});
|
1562
1555
|
|
1563
|
-
define(
|
1564
|
-
|
1556
|
+
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"], function(require, exports, module) {
|
1557
|
+
"use strict";
|
1565
1558
|
|
1566
1559
|
var oop = require("../lib/oop");
|
1560
|
+
var lang = require("../lib/lang");
|
1567
1561
|
var TextMode = require("./text").Mode;
|
1568
|
-
var
|
1569
|
-
var
|
1570
|
-
var
|
1571
|
-
var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
|
1572
|
-
var HtmlBehaviour = require("./behaviour/html").HtmlBehaviour;
|
1573
|
-
var HtmlFoldMode = require("./folding/html").FoldMode;
|
1574
|
-
var HtmlCompletions = require("./html_completions").HtmlCompletions;
|
1562
|
+
var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
|
1563
|
+
var XmlBehaviour = require("./behaviour/xml").XmlBehaviour;
|
1564
|
+
var XmlFoldMode = require("./folding/xml").FoldMode;
|
1575
1565
|
|
1576
1566
|
var Mode = function() {
|
1577
|
-
this.HighlightRules =
|
1578
|
-
this.$behaviour = new
|
1579
|
-
this
|
1580
|
-
|
1581
|
-
this.createModeDelegates({
|
1582
|
-
"js-": JavaScriptMode,
|
1583
|
-
"css-": CssMode
|
1584
|
-
});
|
1585
|
-
|
1586
|
-
this.foldingRules = new HtmlFoldMode();
|
1567
|
+
this.HighlightRules = XmlHighlightRules;
|
1568
|
+
this.$behaviour = new XmlBehaviour();
|
1569
|
+
this.foldingRules = new XmlFoldMode();
|
1587
1570
|
};
|
1588
|
-
oop.inherits(Mode, TextMode);
|
1589
|
-
|
1590
|
-
(function() {
|
1591
|
-
|
1592
|
-
this.blockComment = {start: "<!--", end: "-->"};
|
1593
|
-
|
1594
|
-
this.getNextLineIndent = function(state, line, tab) {
|
1595
|
-
return this.$getIndent(line);
|
1596
|
-
};
|
1597
|
-
|
1598
|
-
this.checkOutdent = function(state, line, input) {
|
1599
|
-
return false;
|
1600
|
-
};
|
1601
|
-
|
1602
|
-
this.getCompletions = function(state, session, pos, prefix) {
|
1603
|
-
return this.$completer.getCompletions(state, session, pos, prefix);
|
1604
|
-
};
|
1605
|
-
|
1606
|
-
this.$id = "ace/mode/html";
|
1607
|
-
}).call(Mode.prototype);
|
1608
1571
|
|
1609
|
-
exports.Mode = Mode;
|
1610
|
-
});
|
1611
|
-
|
1612
|
-
define('ace/mode/css', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/css_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/worker/worker_client', 'ace/mode/behaviour/css', 'ace/mode/folding/cstyle'], function(require, exports, module) {
|
1613
|
-
|
1614
|
-
|
1615
|
-
var oop = require("../lib/oop");
|
1616
|
-
var TextMode = require("./text").Mode;
|
1617
|
-
var Tokenizer = require("../tokenizer").Tokenizer;
|
1618
|
-
var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
|
1619
|
-
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
|
1620
|
-
var WorkerClient = require("../worker/worker_client").WorkerClient;
|
1621
|
-
var CssBehaviour = require("./behaviour/css").CssBehaviour;
|
1622
|
-
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
1623
|
-
|
1624
|
-
var Mode = function() {
|
1625
|
-
this.HighlightRules = CssHighlightRules;
|
1626
|
-
this.$outdent = new MatchingBraceOutdent();
|
1627
|
-
this.$behaviour = new CssBehaviour();
|
1628
|
-
this.foldingRules = new CStyleFoldMode();
|
1629
|
-
};
|
1630
1572
|
oop.inherits(Mode, TextMode);
|
1631
1573
|
|
1632
1574
|
(function() {
|
1633
1575
|
|
1634
|
-
this.
|
1635
|
-
this.blockComment = {start: "/*", end: "*/"};
|
1636
|
-
|
1637
|
-
this.getNextLineIndent = function(state, line, tab) {
|
1638
|
-
var indent = this.$getIndent(line);
|
1639
|
-
var tokens = this.getTokenizer().getLineTokens(line, state).tokens;
|
1640
|
-
if (tokens.length && tokens[tokens.length-1].type == "comment") {
|
1641
|
-
return indent;
|
1642
|
-
}
|
1643
|
-
|
1644
|
-
var match = line.match(/^.*\{\s*$/);
|
1645
|
-
if (match) {
|
1646
|
-
indent += tab;
|
1647
|
-
}
|
1648
|
-
|
1649
|
-
return indent;
|
1650
|
-
};
|
1576
|
+
this.voidElements = lang.arrayToMap([]);
|
1651
1577
|
|
1652
|
-
this.
|
1653
|
-
return this.$outdent.checkOutdent(line, input);
|
1654
|
-
};
|
1655
|
-
|
1656
|
-
this.autoOutdent = function(state, doc, row) {
|
1657
|
-
this.$outdent.autoOutdent(doc, row);
|
1658
|
-
};
|
1659
|
-
|
1660
|
-
this.createWorker = function(session) {
|
1661
|
-
var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker");
|
1662
|
-
worker.attachToDocument(session.getDocument());
|
1663
|
-
|
1664
|
-
worker.on("csslint", function(e) {
|
1665
|
-
session.setAnnotations(e.data);
|
1666
|
-
});
|
1667
|
-
|
1668
|
-
worker.on("terminate", function() {
|
1669
|
-
session.clearAnnotations();
|
1670
|
-
});
|
1671
|
-
|
1672
|
-
return worker;
|
1673
|
-
};
|
1578
|
+
this.blockComment = {start: "<!--", end: "-->"};
|
1674
1579
|
|
1675
|
-
this.$id = "ace/mode/
|
1580
|
+
this.$id = "ace/mode/xml";
|
1676
1581
|
}).call(Mode.prototype);
|
1677
1582
|
|
1678
1583
|
exports.Mode = Mode;
|
1679
|
-
|
1680
1584
|
});
|
1681
1585
|
|
1682
|
-
define(
|
1683
|
-
|
1586
|
+
define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) {
|
1587
|
+
"use strict";
|
1684
1588
|
|
1685
1589
|
var oop = require("../lib/oop");
|
1686
1590
|
var lang = require("../lib/lang");
|
@@ -1823,8 +1727,8 @@ exports.CssHighlightRules = CssHighlightRules;
|
|
1823
1727
|
|
1824
1728
|
});
|
1825
1729
|
|
1826
|
-
define(
|
1827
|
-
|
1730
|
+
define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"], function(require, exports, module) {
|
1731
|
+
"use strict";
|
1828
1732
|
|
1829
1733
|
var oop = require("../../lib/oop");
|
1830
1734
|
var Behaviour = require("../behaviour").Behaviour;
|
@@ -1902,8 +1806,77 @@ oop.inherits(CssBehaviour, CstyleBehaviour);
|
|
1902
1806
|
exports.CssBehaviour = CssBehaviour;
|
1903
1807
|
});
|
1904
1808
|
|
1905
|
-
define(
|
1809
|
+
define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module) {
|
1810
|
+
"use strict";
|
1811
|
+
|
1812
|
+
var oop = require("../lib/oop");
|
1813
|
+
var TextMode = require("./text").Mode;
|
1814
|
+
var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
|
1815
|
+
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
|
1816
|
+
var WorkerClient = require("../worker/worker_client").WorkerClient;
|
1817
|
+
var CssBehaviour = require("./behaviour/css").CssBehaviour;
|
1818
|
+
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
1819
|
+
|
1820
|
+
var Mode = function() {
|
1821
|
+
this.HighlightRules = CssHighlightRules;
|
1822
|
+
this.$outdent = new MatchingBraceOutdent();
|
1823
|
+
this.$behaviour = new CssBehaviour();
|
1824
|
+
this.foldingRules = new CStyleFoldMode();
|
1825
|
+
};
|
1826
|
+
oop.inherits(Mode, TextMode);
|
1827
|
+
|
1828
|
+
(function() {
|
1829
|
+
|
1830
|
+
this.foldingRules = "cStyle";
|
1831
|
+
this.blockComment = {start: "/*", end: "*/"};
|
1832
|
+
|
1833
|
+
this.getNextLineIndent = function(state, line, tab) {
|
1834
|
+
var indent = this.$getIndent(line);
|
1835
|
+
var tokens = this.getTokenizer().getLineTokens(line, state).tokens;
|
1836
|
+
if (tokens.length && tokens[tokens.length-1].type == "comment") {
|
1837
|
+
return indent;
|
1838
|
+
}
|
1839
|
+
|
1840
|
+
var match = line.match(/^.*\{\s*$/);
|
1841
|
+
if (match) {
|
1842
|
+
indent += tab;
|
1843
|
+
}
|
1844
|
+
|
1845
|
+
return indent;
|
1846
|
+
};
|
1847
|
+
|
1848
|
+
this.checkOutdent = function(state, line, input) {
|
1849
|
+
return this.$outdent.checkOutdent(line, input);
|
1850
|
+
};
|
1851
|
+
|
1852
|
+
this.autoOutdent = function(state, doc, row) {
|
1853
|
+
this.$outdent.autoOutdent(doc, row);
|
1854
|
+
};
|
1855
|
+
|
1856
|
+
this.createWorker = function(session) {
|
1857
|
+
var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker");
|
1858
|
+
worker.attachToDocument(session.getDocument());
|
1859
|
+
|
1860
|
+
worker.on("csslint", function(e) {
|
1861
|
+
session.setAnnotations(e.data);
|
1862
|
+
});
|
1863
|
+
|
1864
|
+
worker.on("terminate", function() {
|
1865
|
+
session.clearAnnotations();
|
1866
|
+
});
|
1867
|
+
|
1868
|
+
return worker;
|
1869
|
+
};
|
1870
|
+
|
1871
|
+
this.$id = "ace/mode/css";
|
1872
|
+
}).call(Mode.prototype);
|
1873
|
+
|
1874
|
+
exports.Mode = Mode;
|
1875
|
+
|
1876
|
+
});
|
1906
1877
|
|
1878
|
+
define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"], function(require, exports, module) {
|
1879
|
+
"use strict";
|
1907
1880
|
|
1908
1881
|
var oop = require("../lib/oop");
|
1909
1882
|
var lang = require("../lib/lang");
|
@@ -1936,17 +1909,17 @@ var HtmlHighlightRules = function() {
|
|
1936
1909
|
|
1937
1910
|
this.addRules({
|
1938
1911
|
attributes: [{
|
1939
|
-
include : "
|
1912
|
+
include : "tag_whitespace"
|
1940
1913
|
}, {
|
1941
|
-
token : "entity.other.attribute-name",
|
1914
|
+
token : "entity.other.attribute-name.xml",
|
1942
1915
|
regex : "[-_a-zA-Z0-9:]+"
|
1943
1916
|
}, {
|
1944
|
-
token : "keyword.operator.
|
1917
|
+
token : "keyword.operator.attribute-equals.xml",
|
1945
1918
|
regex : "=",
|
1946
1919
|
push : [{
|
1947
|
-
include: "
|
1920
|
+
include: "tag_whitespace"
|
1948
1921
|
}, {
|
1949
|
-
token : "string",
|
1922
|
+
token : "string.unquoted.attribute-value.html",
|
1950
1923
|
regex : "[^<>='\"`\\s]+",
|
1951
1924
|
next : "pop"
|
1952
1925
|
}, {
|
@@ -1955,33 +1928,21 @@ var HtmlHighlightRules = function() {
|
|
1955
1928
|
next : "pop"
|
1956
1929
|
}]
|
1957
1930
|
}, {
|
1958
|
-
include : "
|
1931
|
+
include : "attribute_value"
|
1959
1932
|
}],
|
1960
1933
|
tag: [{
|
1961
1934
|
token : function(start, tag) {
|
1962
1935
|
var group = tagMap[tag];
|
1963
|
-
return ["meta.tag.punctuation.
|
1964
|
-
"meta.tag
|
1936
|
+
return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml",
|
1937
|
+
"meta.tag" + (group ? "." + group : "") + ".tag-name.xml"];
|
1965
1938
|
},
|
1966
|
-
regex : "(
|
1967
|
-
next: "
|
1968
|
-
}, {
|
1969
|
-
token : function(start, tag) {
|
1970
|
-
var group = tagMap[tag];
|
1971
|
-
return ["meta.tag.punctuation.begin",
|
1972
|
-
"meta.tag.name" + (group ? "." + group : "")];
|
1973
|
-
},
|
1974
|
-
regex : "(</)([-_a-zA-Z0-9:]+)",
|
1975
|
-
next: "end_tag_stuff"
|
1939
|
+
regex : "(</?)([-_a-zA-Z0-9:]+)",
|
1940
|
+
next: "tag_stuff"
|
1976
1941
|
}],
|
1977
|
-
|
1942
|
+
tag_stuff: [
|
1978
1943
|
{include : "attributes"},
|
1979
|
-
{token : "meta.tag.punctuation.
|
1944
|
+
{token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : "start"}
|
1980
1945
|
],
|
1981
|
-
end_tag_stuff: [
|
1982
|
-
{include : "space"},
|
1983
|
-
{token : "meta.tag.punctuation.end", regex : ">", next : "start"}
|
1984
|
-
]
|
1985
1946
|
});
|
1986
1947
|
|
1987
1948
|
this.embedTagRules(CssHighlightRules, "css-", "style");
|
@@ -1996,114 +1957,8 @@ oop.inherits(HtmlHighlightRules, XmlHighlightRules);
|
|
1996
1957
|
exports.HtmlHighlightRules = HtmlHighlightRules;
|
1997
1958
|
});
|
1998
1959
|
|
1999
|
-
define(
|
2000
|
-
|
2001
|
-
|
2002
|
-
var oop = require("../../lib/oop");
|
2003
|
-
var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
|
2004
|
-
var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
|
2005
|
-
var TokenIterator = require("../../token_iterator").TokenIterator;
|
2006
|
-
var voidElements = ['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr'];
|
2007
|
-
|
2008
|
-
function hasType(token, type) {
|
2009
|
-
var tokenTypes = token.type.split('.');
|
2010
|
-
return type.split('.').every(function(type){
|
2011
|
-
return (tokenTypes.indexOf(type) !== -1);
|
2012
|
-
});
|
2013
|
-
return hasType;
|
2014
|
-
}
|
2015
|
-
|
2016
|
-
var HtmlBehaviour = function () {
|
2017
|
-
|
2018
|
-
this.inherit(XmlBehaviour); // Get xml behaviour
|
2019
|
-
|
2020
|
-
this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
|
2021
|
-
if (text == '>') {
|
2022
|
-
var position = editor.getCursorPosition();
|
2023
|
-
var iterator = new TokenIterator(session, position.row, position.column);
|
2024
|
-
var token = iterator.getCurrentToken();
|
2025
|
-
|
2026
|
-
if (token && hasType(token, 'string') && iterator.getCurrentTokenColumn() + token.value.length > position.column)
|
2027
|
-
return;
|
2028
|
-
var atCursor = false;
|
2029
|
-
if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){
|
2030
|
-
do {
|
2031
|
-
token = iterator.stepBackward();
|
2032
|
-
} while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text')));
|
2033
|
-
} else {
|
2034
|
-
atCursor = true;
|
2035
|
-
}
|
2036
|
-
if (!token || !hasType(token, 'meta.tag.name') || iterator.stepBackward().value.match('/')) {
|
2037
|
-
return;
|
2038
|
-
}
|
2039
|
-
var element = token.value;
|
2040
|
-
if (atCursor){
|
2041
|
-
var element = element.substring(0, position.column - token.start);
|
2042
|
-
}
|
2043
|
-
if (voidElements.indexOf(element) !== -1){
|
2044
|
-
return;
|
2045
|
-
}
|
2046
|
-
return {
|
2047
|
-
text: '>' + '</' + element + '>',
|
2048
|
-
selection: [1, 1]
|
2049
|
-
}
|
2050
|
-
}
|
2051
|
-
});
|
2052
|
-
}
|
2053
|
-
oop.inherits(HtmlBehaviour, XmlBehaviour);
|
2054
|
-
|
2055
|
-
exports.HtmlBehaviour = HtmlBehaviour;
|
2056
|
-
});
|
2057
|
-
|
2058
|
-
define('ace/mode/folding/html', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/mixed', 'ace/mode/folding/xml', 'ace/mode/folding/cstyle'], function(require, exports, module) {
|
2059
|
-
|
2060
|
-
|
2061
|
-
var oop = require("../../lib/oop");
|
2062
|
-
var MixedFoldMode = require("./mixed").FoldMode;
|
2063
|
-
var XmlFoldMode = require("./xml").FoldMode;
|
2064
|
-
var CStyleFoldMode = require("./cstyle").FoldMode;
|
2065
|
-
|
2066
|
-
var FoldMode = exports.FoldMode = function() {
|
2067
|
-
MixedFoldMode.call(this, new XmlFoldMode({
|
2068
|
-
"area": 1,
|
2069
|
-
"base": 1,
|
2070
|
-
"br": 1,
|
2071
|
-
"col": 1,
|
2072
|
-
"command": 1,
|
2073
|
-
"embed": 1,
|
2074
|
-
"hr": 1,
|
2075
|
-
"img": 1,
|
2076
|
-
"input": 1,
|
2077
|
-
"keygen": 1,
|
2078
|
-
"link": 1,
|
2079
|
-
"meta": 1,
|
2080
|
-
"param": 1,
|
2081
|
-
"source": 1,
|
2082
|
-
"track": 1,
|
2083
|
-
"wbr": 1,
|
2084
|
-
"li": 1,
|
2085
|
-
"dt": 1,
|
2086
|
-
"dd": 1,
|
2087
|
-
"p": 1,
|
2088
|
-
"rt": 1,
|
2089
|
-
"rp": 1,
|
2090
|
-
"optgroup": 1,
|
2091
|
-
"option": 1,
|
2092
|
-
"colgroup": 1,
|
2093
|
-
"td": 1,
|
2094
|
-
"th": 1
|
2095
|
-
}), {
|
2096
|
-
"js-": new CStyleFoldMode(),
|
2097
|
-
"css-": new CStyleFoldMode()
|
2098
|
-
});
|
2099
|
-
};
|
2100
|
-
|
2101
|
-
oop.inherits(FoldMode, MixedFoldMode);
|
2102
|
-
|
2103
|
-
});
|
2104
|
-
|
2105
|
-
define('ace/mode/folding/mixed', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
|
2106
|
-
|
1960
|
+
define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module) {
|
1961
|
+
"use strict";
|
2107
1962
|
|
2108
1963
|
var oop = require("../../lib/oop");
|
2109
1964
|
var BaseFoldMode = require("./fold_mode").FoldMode;
|
@@ -2156,8 +2011,27 @@ oop.inherits(FoldMode, BaseFoldMode);
|
|
2156
2011
|
|
2157
2012
|
});
|
2158
2013
|
|
2159
|
-
define(
|
2014
|
+
define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module) {
|
2015
|
+
"use strict";
|
2016
|
+
|
2017
|
+
var oop = require("../../lib/oop");
|
2018
|
+
var MixedFoldMode = require("./mixed").FoldMode;
|
2019
|
+
var XmlFoldMode = require("./xml").FoldMode;
|
2020
|
+
var CStyleFoldMode = require("./cstyle").FoldMode;
|
2021
|
+
|
2022
|
+
var FoldMode = exports.FoldMode = function(voidElements, optionalTags) {
|
2023
|
+
MixedFoldMode.call(this, new XmlFoldMode(voidElements, optionalTags), {
|
2024
|
+
"js-": new CStyleFoldMode(),
|
2025
|
+
"css-": new CStyleFoldMode()
|
2026
|
+
});
|
2027
|
+
};
|
2028
|
+
|
2029
|
+
oop.inherits(FoldMode, MixedFoldMode);
|
2030
|
+
|
2031
|
+
});
|
2160
2032
|
|
2033
|
+
define("ace/mode/html_completions",["require","exports","module","ace/token_iterator"], function(require, exports, module) {
|
2034
|
+
"use strict";
|
2161
2035
|
|
2162
2036
|
var TokenIterator = require("../token_iterator").TokenIterator;
|
2163
2037
|
|
@@ -2171,6 +2045,12 @@ var commonAttributes = [
|
|
2171
2045
|
"dropzone",
|
2172
2046
|
"hidden",
|
2173
2047
|
"id",
|
2048
|
+
"inert",
|
2049
|
+
"itemid",
|
2050
|
+
"itemprop",
|
2051
|
+
"itemref",
|
2052
|
+
"itemscope",
|
2053
|
+
"itemtype",
|
2174
2054
|
"lang",
|
2175
2055
|
"spellcheck",
|
2176
2056
|
"style",
|
@@ -2354,24 +2234,19 @@ var attributeMap = {
|
|
2354
2234
|
"dialog": ["open"]
|
2355
2235
|
};
|
2356
2236
|
|
2357
|
-
var
|
2237
|
+
var elements = Object.keys(attributeMap);
|
2358
2238
|
|
2359
|
-
function
|
2360
|
-
|
2361
|
-
return type.split('.').every(function(type){
|
2362
|
-
return (tokenTypes.indexOf(type) !== -1);
|
2363
|
-
});
|
2239
|
+
function is(token, type) {
|
2240
|
+
return token.type.lastIndexOf(type + ".xml") > -1;
|
2364
2241
|
}
|
2365
2242
|
|
2366
2243
|
function findTagName(session, pos) {
|
2367
2244
|
var iterator = new TokenIterator(session, pos.row, pos.column);
|
2368
2245
|
var token = iterator.getCurrentToken();
|
2369
|
-
|
2370
|
-
|
2371
|
-
token = iterator.stepBackward();
|
2372
|
-
} while (token && (hasType(token, 'string') || hasType(token, 'operator') || hasType(token, 'attribute-name') || hasType(token, 'text')));
|
2246
|
+
while (token && !is(token, "tag-name")){
|
2247
|
+
token = iterator.stepBackward();
|
2373
2248
|
}
|
2374
|
-
if (token
|
2249
|
+
if (token)
|
2375
2250
|
return token.value;
|
2376
2251
|
}
|
2377
2252
|
|
@@ -2386,25 +2261,20 @@ var HtmlCompletions = function() {
|
|
2386
2261
|
|
2387
2262
|
if (!token)
|
2388
2263
|
return [];
|
2389
|
-
if (
|
2264
|
+
if (is(token, "tag-name") || is(token, "tag-open") || is(token, "end-tag-open"))
|
2390
2265
|
return this.getTagCompletions(state, session, pos, prefix);
|
2391
|
-
if (
|
2266
|
+
if (is(token, "tag-whitespace") || is(token, "attribute-name"))
|
2392
2267
|
return this.getAttributeCompetions(state, session, pos, prefix);
|
2393
2268
|
|
2394
2269
|
return [];
|
2395
2270
|
};
|
2396
2271
|
|
2397
2272
|
this.getTagCompletions = function(state, session, pos, prefix) {
|
2398
|
-
var elements = allElements;
|
2399
|
-
if (prefix) {
|
2400
|
-
elements = elements.filter(function(element){
|
2401
|
-
return element.indexOf(prefix) === 0;
|
2402
|
-
});
|
2403
|
-
}
|
2404
2273
|
return elements.map(function(element){
|
2405
2274
|
return {
|
2406
2275
|
value: element,
|
2407
|
-
meta: "tag"
|
2276
|
+
meta: "tag",
|
2277
|
+
score: Number.MAX_VALUE
|
2408
2278
|
};
|
2409
2279
|
});
|
2410
2280
|
};
|
@@ -2417,16 +2287,12 @@ var HtmlCompletions = function() {
|
|
2417
2287
|
if (tagName in attributeMap) {
|
2418
2288
|
attributes = attributes.concat(attributeMap[tagName]);
|
2419
2289
|
}
|
2420
|
-
if (prefix) {
|
2421
|
-
attributes = attributes.filter(function(attribute){
|
2422
|
-
return attribute.indexOf(prefix) === 0;
|
2423
|
-
});
|
2424
|
-
}
|
2425
2290
|
return attributes.map(function(attribute){
|
2426
2291
|
return {
|
2427
2292
|
caption: attribute,
|
2428
2293
|
snippet: attribute + '="$0"',
|
2429
|
-
meta: "attribute"
|
2294
|
+
meta: "attribute",
|
2295
|
+
score: Number.MAX_VALUE
|
2430
2296
|
};
|
2431
2297
|
});
|
2432
2298
|
};
|
@@ -2436,8 +2302,83 @@ var HtmlCompletions = function() {
|
|
2436
2302
|
exports.HtmlCompletions = HtmlCompletions;
|
2437
2303
|
});
|
2438
2304
|
|
2439
|
-
define(
|
2305
|
+
define("ace/mode/html",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/javascript","ace/mode/css","ace/mode/html_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/html","ace/mode/html_completions","ace/worker/worker_client"], function(require, exports, module) {
|
2306
|
+
"use strict";
|
2307
|
+
|
2308
|
+
var oop = require("../lib/oop");
|
2309
|
+
var lang = require("../lib/lang");
|
2310
|
+
var TextMode = require("./text").Mode;
|
2311
|
+
var JavaScriptMode = require("./javascript").Mode;
|
2312
|
+
var CssMode = require("./css").Mode;
|
2313
|
+
var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
|
2314
|
+
var XmlBehaviour = require("./behaviour/xml").XmlBehaviour;
|
2315
|
+
var HtmlFoldMode = require("./folding/html").FoldMode;
|
2316
|
+
var HtmlCompletions = require("./html_completions").HtmlCompletions;
|
2317
|
+
var WorkerClient = require("../worker/worker_client").WorkerClient;
|
2318
|
+
var voidElements = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "menuitem", "param", "source", "track", "wbr"];
|
2319
|
+
var optionalEndTags = ["li", "dt", "dd", "p", "rt", "rp", "optgroup", "option", "colgroup", "td", "th"];
|
2320
|
+
|
2321
|
+
var Mode = function(options) {
|
2322
|
+
this.fragmentContext = options && options.fragmentContext;
|
2323
|
+
this.HighlightRules = HtmlHighlightRules;
|
2324
|
+
this.$behaviour = new XmlBehaviour();
|
2325
|
+
this.$completer = new HtmlCompletions();
|
2326
|
+
|
2327
|
+
this.createModeDelegates({
|
2328
|
+
"js-": JavaScriptMode,
|
2329
|
+
"css-": CssMode
|
2330
|
+
});
|
2331
|
+
|
2332
|
+
this.foldingRules = new HtmlFoldMode(this.voidElements, lang.arrayToMap(optionalEndTags));
|
2333
|
+
};
|
2334
|
+
oop.inherits(Mode, TextMode);
|
2335
|
+
|
2336
|
+
(function() {
|
2337
|
+
|
2338
|
+
this.blockComment = {start: "<!--", end: "-->"};
|
2339
|
+
|
2340
|
+
this.voidElements = lang.arrayToMap(voidElements);
|
2341
|
+
|
2342
|
+
this.getNextLineIndent = function(state, line, tab) {
|
2343
|
+
return this.$getIndent(line);
|
2344
|
+
};
|
2345
|
+
|
2346
|
+
this.checkOutdent = function(state, line, input) {
|
2347
|
+
return false;
|
2348
|
+
};
|
2349
|
+
|
2350
|
+
this.getCompletions = function(state, session, pos, prefix) {
|
2351
|
+
return this.$completer.getCompletions(state, session, pos, prefix);
|
2352
|
+
};
|
2353
|
+
|
2354
|
+
this.createWorker = function(session) {
|
2355
|
+
if (this.constructor != Mode)
|
2356
|
+
return;
|
2357
|
+
var worker = new WorkerClient(["ace"], "ace/mode/html_worker", "Worker");
|
2358
|
+
worker.attachToDocument(session.getDocument());
|
2359
|
+
|
2360
|
+
if (this.fragmentContext)
|
2361
|
+
worker.call("setOptions", [{context: this.fragmentContext}]);
|
2362
|
+
|
2363
|
+
worker.on("error", function(e) {
|
2364
|
+
session.setAnnotations(e.data);
|
2365
|
+
});
|
2366
|
+
|
2367
|
+
worker.on("terminate", function() {
|
2368
|
+
session.clearAnnotations();
|
2369
|
+
});
|
2370
|
+
|
2371
|
+
return worker;
|
2372
|
+
};
|
2373
|
+
|
2374
|
+
this.$id = "ace/mode/html";
|
2375
|
+
}).call(Mode.prototype);
|
2376
|
+
|
2377
|
+
exports.Mode = Mode;
|
2378
|
+
});
|
2440
2379
|
|
2380
|
+
define("ace/mode/markdown_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules","ace/mode/html_highlight_rules","ace/mode/css_highlight_rules"], function(require, exports, module) {
|
2381
|
+
"use strict";
|
2441
2382
|
|
2442
2383
|
var oop = require("../lib/oop");
|
2443
2384
|
var lang = require("../lib/lang");
|
@@ -2454,7 +2395,7 @@ var escaped = function(ch) {
|
|
2454
2395
|
function github_embed(tag, prefix) {
|
2455
2396
|
return { // Github style block
|
2456
2397
|
token : "support.function",
|
2457
|
-
regex : "
|
2398
|
+
regex : "^\\s*```" + tag + "\\s*$",
|
2458
2399
|
push : prefix + "start"
|
2459
2400
|
};
|
2460
2401
|
}
|
@@ -2485,7 +2426,7 @@ var MarkdownHighlightRules = function() {
|
|
2485
2426
|
github_embed("css", "csscode-"),
|
2486
2427
|
{ // Github style block
|
2487
2428
|
token : "support.function",
|
2488
|
-
regex : "
|
2429
|
+
regex : "^\\s*```\\s*\\S*(?:{.*?\\})?\\s*$",
|
2489
2430
|
next : "githubblock"
|
2490
2431
|
}, { // block quote
|
2491
2432
|
token : "string.blockquote",
|
@@ -2568,11 +2509,15 @@ var MarkdownHighlightRules = function() {
|
|
2568
2509
|
next : "listblock-start"
|
2569
2510
|
}, {
|
2570
2511
|
include : "basic", noEscape: true
|
2512
|
+
}, { // Github style block
|
2513
|
+
token : "support.function",
|
2514
|
+
regex : "^\\s*```\\s*[a-zA-Z]*(?:{.*?\\})?\\s*$",
|
2515
|
+
next : "githubblock"
|
2571
2516
|
}, {
|
2572
2517
|
defaultToken : "list" //do not use markup.list to allow stling leading `*` differntly
|
2573
2518
|
} ],
|
2574
2519
|
|
2575
|
-
"blockquote" : [ { //
|
2520
|
+
"blockquote" : [ { // Blockquotes only escape on blank lines.
|
2576
2521
|
token : "empty_line",
|
2577
2522
|
regex : "^\\s*$",
|
2578
2523
|
next : "start"
|
@@ -2588,7 +2533,7 @@ var MarkdownHighlightRules = function() {
|
|
2588
2533
|
|
2589
2534
|
"githubblock" : [ {
|
2590
2535
|
token : "support.function",
|
2591
|
-
regex : "
|
2536
|
+
regex : "^\\s*```",
|
2592
2537
|
next : "start"
|
2593
2538
|
}, {
|
2594
2539
|
token : "support.function",
|
@@ -2598,25 +2543,25 @@ var MarkdownHighlightRules = function() {
|
|
2598
2543
|
|
2599
2544
|
this.embedRules(JavaScriptHighlightRules, "jscode-", [{
|
2600
2545
|
token : "support.function",
|
2601
|
-
regex : "
|
2546
|
+
regex : "^\\s*```",
|
2602
2547
|
next : "pop"
|
2603
2548
|
}]);
|
2604
2549
|
|
2605
2550
|
this.embedRules(HtmlHighlightRules, "htmlcode-", [{
|
2606
2551
|
token : "support.function",
|
2607
|
-
regex : "
|
2552
|
+
regex : "^\\s*```",
|
2608
2553
|
next : "pop"
|
2609
2554
|
}]);
|
2610
2555
|
|
2611
2556
|
this.embedRules(CssHighlightRules, "csscode-", [{
|
2612
2557
|
token : "support.function",
|
2613
|
-
regex : "
|
2558
|
+
regex : "^\\s*```",
|
2614
2559
|
next : "pop"
|
2615
2560
|
}]);
|
2616
2561
|
|
2617
2562
|
this.embedRules(XmlHighlightRules, "xmlcode-", [{
|
2618
2563
|
token : "support.function",
|
2619
|
-
regex : "
|
2564
|
+
regex : "^\\s*```",
|
2620
2565
|
next : "pop"
|
2621
2566
|
}]);
|
2622
2567
|
|
@@ -2627,8 +2572,8 @@ oop.inherits(MarkdownHighlightRules, TextHighlightRules);
|
|
2627
2572
|
exports.MarkdownHighlightRules = MarkdownHighlightRules;
|
2628
2573
|
});
|
2629
2574
|
|
2630
|
-
define(
|
2631
|
-
|
2575
|
+
define("ace/mode/folding/markdown",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module) {
|
2576
|
+
"use strict";
|
2632
2577
|
|
2633
2578
|
var oop = require("../../lib/oop");
|
2634
2579
|
var BaseFoldMode = require("./fold_mode").FoldMode;
|
@@ -2722,3 +2667,50 @@ oop.inherits(FoldMode, BaseFoldMode);
|
|
2722
2667
|
}).call(FoldMode.prototype);
|
2723
2668
|
|
2724
2669
|
});
|
2670
|
+
|
2671
|
+
define("ace/mode/markdown",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript","ace/mode/xml","ace/mode/html","ace/mode/markdown_highlight_rules","ace/mode/folding/markdown"], function(require, exports, module) {
|
2672
|
+
"use strict";
|
2673
|
+
|
2674
|
+
var oop = require("../lib/oop");
|
2675
|
+
var TextMode = require("./text").Mode;
|
2676
|
+
var JavaScriptMode = require("./javascript").Mode;
|
2677
|
+
var XmlMode = require("./xml").Mode;
|
2678
|
+
var HtmlMode = require("./html").Mode;
|
2679
|
+
var MarkdownHighlightRules = require("./markdown_highlight_rules").MarkdownHighlightRules;
|
2680
|
+
var MarkdownFoldMode = require("./folding/markdown").FoldMode;
|
2681
|
+
|
2682
|
+
var Mode = function() {
|
2683
|
+
this.HighlightRules = MarkdownHighlightRules;
|
2684
|
+
|
2685
|
+
this.createModeDelegates({
|
2686
|
+
"js-": JavaScriptMode,
|
2687
|
+
"xml-": XmlMode,
|
2688
|
+
"html-": HtmlMode
|
2689
|
+
});
|
2690
|
+
|
2691
|
+
this.foldingRules = new MarkdownFoldMode();
|
2692
|
+
};
|
2693
|
+
oop.inherits(Mode, TextMode);
|
2694
|
+
|
2695
|
+
(function() {
|
2696
|
+
this.type = "text";
|
2697
|
+
this.blockComment = {start: "<!--", end: "-->"};
|
2698
|
+
|
2699
|
+
this.getNextLineIndent = function(state, line, tab) {
|
2700
|
+
if (state == "listblock") {
|
2701
|
+
var match = /^(\s*)(?:([-+*])|(\d+)\.)(\s+)/.exec(line);
|
2702
|
+
if (!match)
|
2703
|
+
return "";
|
2704
|
+
var marker = match[2];
|
2705
|
+
if (!marker)
|
2706
|
+
marker = parseInt(match[3], 10) + 1 + ".";
|
2707
|
+
return match[1] + marker + match[4];
|
2708
|
+
} else {
|
2709
|
+
return this.$getIndent(line);
|
2710
|
+
}
|
2711
|
+
};
|
2712
|
+
this.$id = "ace/mode/markdown";
|
2713
|
+
}).call(Mode.prototype);
|
2714
|
+
|
2715
|
+
exports.Mode = Mode;
|
2716
|
+
});
|