ace-rails-ap 4.0.0 → 4.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (158) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ace/rails/version.rb +1 -1
  3. data/vendor/assets/javascripts/ace/ace.js +993 -613
  4. data/vendor/assets/javascripts/ace/ext-chromevox.js +3 -4
  5. data/vendor/assets/javascripts/ace/ext-elastic_tabstops_lite.js +5 -6
  6. data/vendor/assets/javascripts/ace/ext-emmet.js +50 -21
  7. data/vendor/assets/javascripts/ace/ext-language_tools.js +21 -19
  8. data/vendor/assets/javascripts/ace/ext-modelist.js +11 -6
  9. data/vendor/assets/javascripts/ace/ext-old_ie.js +12 -5
  10. data/vendor/assets/javascripts/ace/ext-searchbox.js +12 -5
  11. data/vendor/assets/javascripts/ace/ext-settings_menu.js +14 -7
  12. data/vendor/assets/javascripts/ace/ext-static_highlight.js +5 -5
  13. data/vendor/assets/javascripts/ace/ext-statusbar.js +14 -12
  14. data/vendor/assets/javascripts/ace/ext-textarea.js +1 -2
  15. data/vendor/assets/javascripts/ace/ext-themelist.js +2 -0
  16. data/vendor/assets/javascripts/ace/ext-whitespace.js +17 -13
  17. data/vendor/assets/javascripts/ace/keybinding-emacs.js +76 -78
  18. data/vendor/assets/javascripts/ace/keybinding-vim.js +221 -80
  19. data/vendor/assets/javascripts/ace/mode-abc.js +2 -3
  20. data/vendor/assets/javascripts/ace/mode-actionscript.js +2 -3
  21. data/vendor/assets/javascripts/ace/mode-apache_conf.js +2 -3
  22. data/vendor/assets/javascripts/ace/mode-applescript.js +2 -3
  23. data/vendor/assets/javascripts/ace/mode-autohotkey.js +2 -3
  24. data/vendor/assets/javascripts/ace/mode-batchfile.js +2 -3
  25. data/vendor/assets/javascripts/ace/mode-c_cpp.js +8 -5
  26. data/vendor/assets/javascripts/ace/mode-coffee.js +1 -1
  27. data/vendor/assets/javascripts/ace/mode-coldfusion.js +533 -139
  28. data/vendor/assets/javascripts/ace/mode-csharp.js +4 -5
  29. data/vendor/assets/javascripts/ace/mode-css.js +185 -6
  30. data/vendor/assets/javascripts/ace/mode-curly.js +495 -138
  31. data/vendor/assets/javascripts/ace/mode-d.js +2 -3
  32. data/vendor/assets/javascripts/ace/mode-dart.js +8 -5
  33. data/vendor/assets/javascripts/ace/mode-django.js +495 -138
  34. data/vendor/assets/javascripts/ace/mode-dockerfile.js +59 -14
  35. data/vendor/assets/javascripts/ace/mode-dot.js +2 -3
  36. data/vendor/assets/javascripts/ace/mode-ejs.js +497 -152
  37. data/vendor/assets/javascripts/ace/mode-elm.js +6 -4
  38. data/vendor/assets/javascripts/ace/mode-erlang.js +3 -4
  39. data/vendor/assets/javascripts/ace/mode-forth.js +3 -4
  40. data/vendor/assets/javascripts/ace/mode-ftl.js +145 -17
  41. data/vendor/assets/javascripts/ace/mode-gherkin.js +58 -25
  42. data/vendor/assets/javascripts/ace/mode-glsl.js +8 -5
  43. data/vendor/assets/javascripts/ace/mode-golang.js +36 -25
  44. data/vendor/assets/javascripts/ace/mode-groovy.js +145 -17
  45. data/vendor/assets/javascripts/ace/mode-handlebars.js +496 -140
  46. data/vendor/assets/javascripts/ace/mode-haskell.js +3 -4
  47. data/vendor/assets/javascripts/ace/mode-haxe.js +4 -5
  48. data/vendor/assets/javascripts/ace/mode-html.js +495 -138
  49. data/vendor/assets/javascripts/ace/mode-html_elixir.js +3372 -0
  50. data/vendor/assets/javascripts/ace/mode-html_ruby.js +495 -138
  51. data/vendor/assets/javascripts/ace/mode-ini.js +1 -1
  52. data/vendor/assets/javascripts/ace/mode-io.js +2 -3
  53. data/vendor/assets/javascripts/ace/mode-jack.js +4 -5
  54. data/vendor/assets/javascripts/ace/mode-jade.js +155 -25
  55. data/vendor/assets/javascripts/ace/mode-java.js +145 -17
  56. data/vendor/assets/javascripts/ace/mode-javascript.js +145 -17
  57. data/vendor/assets/javascripts/ace/mode-json.js +4 -5
  58. data/vendor/assets/javascripts/ace/mode-jsoniq.js +4 -5
  59. data/vendor/assets/javascripts/ace/mode-jsp.js +150 -23
  60. data/vendor/assets/javascripts/ace/mode-jsx.js +4 -5
  61. data/vendor/assets/javascripts/ace/mode-julia.js +2 -3
  62. data/vendor/assets/javascripts/ace/mode-less.js +5 -6
  63. data/vendor/assets/javascripts/ace/mode-liquid.js +145 -17
  64. data/vendor/assets/javascripts/ace/mode-logiql.js +2 -2
  65. data/vendor/assets/javascripts/ace/mode-lsl.js +8 -10
  66. data/vendor/assets/javascripts/ace/mode-lua.js +2 -2
  67. data/vendor/assets/javascripts/ace/mode-luapage.js +497 -140
  68. data/vendor/assets/javascripts/ace/mode-makefile.js +54 -8
  69. data/vendor/assets/javascripts/ace/mode-markdown.js +497 -139
  70. data/vendor/assets/javascripts/ace/mode-mask.js +150 -22
  71. data/vendor/assets/javascripts/ace/mode-maze.js +283 -0
  72. data/vendor/assets/javascripts/ace/mode-mel.js +4 -5
  73. data/vendor/assets/javascripts/ace/mode-mushcode.js +0 -1
  74. data/vendor/assets/javascripts/ace/mode-mysql.js +1 -1
  75. data/vendor/assets/javascripts/ace/mode-nix.js +8 -5
  76. data/vendor/assets/javascripts/ace/mode-objectivec.js +6 -3
  77. data/vendor/assets/javascripts/ace/mode-perl.js +4 -5
  78. data/vendor/assets/javascripts/ace/mode-pgsql.js +141 -12
  79. data/vendor/assets/javascripts/ace/mode-php.js +9872 -143
  80. data/vendor/assets/javascripts/ace/mode-powershell.js +4 -5
  81. data/vendor/assets/javascripts/ace/mode-praat.js +18 -14
  82. data/vendor/assets/javascripts/ace/mode-prolog.js +2 -3
  83. data/vendor/assets/javascripts/ace/mode-protobuf.js +8 -5
  84. data/vendor/assets/javascripts/ace/mode-rhtml.js +495 -138
  85. data/vendor/assets/javascripts/ace/mode-ruby.js +2 -2
  86. data/vendor/assets/javascripts/ace/mode-rust.js +32 -39
  87. data/vendor/assets/javascripts/ace/mode-scad.js +4 -5
  88. data/vendor/assets/javascripts/ace/mode-scala.js +158 -21
  89. data/vendor/assets/javascripts/ace/mode-scheme.js +118 -1
  90. data/vendor/assets/javascripts/ace/mode-scss.js +4 -5
  91. data/vendor/assets/javascripts/ace/mode-sh.js +58 -13
  92. data/vendor/assets/javascripts/ace/mode-sjs.js +145 -17
  93. data/vendor/assets/javascripts/ace/mode-smarty.js +495 -138
  94. data/vendor/assets/javascripts/ace/mode-soy_template.js +496 -140
  95. data/vendor/assets/javascripts/ace/mode-sql.js +12 -4
  96. data/vendor/assets/javascripts/ace/mode-sqlserver.js +437 -0
  97. data/vendor/assets/javascripts/ace/mode-svg.js +147 -20
  98. data/vendor/assets/javascripts/ace/mode-swift.js +738 -0
  99. data/vendor/assets/javascripts/ace/mode-swig.js +1099 -0
  100. data/vendor/assets/javascripts/ace/mode-tcl.js +2 -3
  101. data/vendor/assets/javascripts/ace/mode-tex.js +1 -0
  102. data/vendor/assets/javascripts/ace/mode-toml.js +4 -0
  103. data/vendor/assets/javascripts/ace/mode-twig.js +495 -138
  104. data/vendor/assets/javascripts/ace/mode-typescript.js +147 -19
  105. data/vendor/assets/javascripts/ace/mode-vala.js +4 -5
  106. data/vendor/assets/javascripts/ace/mode-vbscript.js +26 -13
  107. data/vendor/assets/javascripts/ace/mode-velocity.js +495 -138
  108. data/vendor/assets/javascripts/ace/mode-verilog.js +8 -0
  109. data/vendor/assets/javascripts/ace/mode-xml.js +2 -3
  110. data/vendor/assets/javascripts/ace/mode-xquery.js +4 -5
  111. data/vendor/assets/javascripts/ace/snippets/actionscript.js +5 -0
  112. data/vendor/assets/javascripts/ace/snippets/html_elixir.js +7 -0
  113. data/vendor/assets/javascripts/ace/snippets/java.js +6 -0
  114. data/vendor/assets/javascripts/ace/snippets/javascript.js +13 -0
  115. data/vendor/assets/javascripts/ace/snippets/lsl.js +166 -0
  116. data/vendor/assets/javascripts/ace/snippets/maze.js +16 -0
  117. data/vendor/assets/javascripts/ace/snippets/php.js +105 -4
  118. data/vendor/assets/javascripts/ace/snippets/sqlserver.js +76 -0
  119. data/vendor/assets/javascripts/ace/snippets/swift.js +7 -0
  120. data/vendor/assets/javascripts/ace/snippets/swig.js +7 -0
  121. data/vendor/assets/javascripts/ace/theme-clouds.js +0 -1
  122. data/vendor/assets/javascripts/ace/theme-clouds_midnight.js +0 -1
  123. data/vendor/assets/javascripts/ace/theme-cobalt.js +3 -3
  124. data/vendor/assets/javascripts/ace/theme-dawn.js +0 -1
  125. data/vendor/assets/javascripts/ace/theme-github.js +0 -1
  126. data/vendor/assets/javascripts/ace/theme-idle_fingers.js +0 -1
  127. data/vendor/assets/javascripts/ace/theme-iplastic.js +121 -0
  128. data/vendor/assets/javascripts/ace/theme-katzenmilch.js +1 -2
  129. data/vendor/assets/javascripts/ace/theme-kr_theme.js +0 -1
  130. data/vendor/assets/javascripts/ace/theme-kuroir.js +0 -1
  131. data/vendor/assets/javascripts/ace/theme-merbivore.js +0 -1
  132. data/vendor/assets/javascripts/ace/theme-merbivore_soft.js +0 -1
  133. data/vendor/assets/javascripts/ace/theme-mono_industrial.js +0 -1
  134. data/vendor/assets/javascripts/ace/theme-monokai.js +0 -1
  135. data/vendor/assets/javascripts/ace/theme-pastel_on_dark.js +0 -1
  136. data/vendor/assets/javascripts/ace/theme-solarized_dark.js +0 -1
  137. data/vendor/assets/javascripts/ace/theme-solarized_light.js +0 -1
  138. data/vendor/assets/javascripts/ace/theme-sqlserver.js +138 -0
  139. data/vendor/assets/javascripts/ace/theme-terminal.js +0 -1
  140. data/vendor/assets/javascripts/ace/theme-textmate.js +0 -1
  141. data/vendor/assets/javascripts/ace/theme-tomorrow.js +0 -1
  142. data/vendor/assets/javascripts/ace/theme-tomorrow_night.js +0 -1
  143. data/vendor/assets/javascripts/ace/theme-tomorrow_night_blue.js +0 -1
  144. data/vendor/assets/javascripts/ace/theme-tomorrow_night_bright.js +0 -1
  145. data/vendor/assets/javascripts/ace/theme-tomorrow_night_eighties.js +0 -1
  146. data/vendor/assets/javascripts/ace/theme-twilight.js +0 -1
  147. data/vendor/assets/javascripts/ace/theme-vibrant_ink.js +0 -1
  148. data/vendor/assets/javascripts/ace/theme-xcode.js +0 -1
  149. data/vendor/assets/javascripts/ace/worker-coffee.js +576 -6015
  150. data/vendor/assets/javascripts/ace/worker-css.js +529 -449
  151. data/vendor/assets/javascripts/ace/worker-html.js +528 -448
  152. data/vendor/assets/javascripts/ace/worker-javascript.js +8719 -7656
  153. data/vendor/assets/javascripts/ace/worker-json.js +530 -450
  154. data/vendor/assets/javascripts/ace/worker-lua.js +530 -450
  155. data/vendor/assets/javascripts/ace/worker-php.js +530 -450
  156. data/vendor/assets/javascripts/ace/worker-xml.js +530 -450
  157. data/vendor/assets/javascripts/ace/worker-xquery.js +529 -449
  158. metadata +14 -2
@@ -0,0 +1,1099 @@
1
+ define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) {
2
+ "use strict";
3
+
4
+ var oop = require("../lib/oop");
5
+ var lang = require("../lib/lang");
6
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
7
+ var supportType = exports.supportType = "animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|pointer-events|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index";
8
+ var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters";
9
+ var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero";
10
+ var supportConstantColor = exports.supportConstantColor = "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow";
11
+ var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace";
12
+
13
+ var numRe = exports.numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
14
+ var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
15
+ var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b";
16
+
17
+ var CssHighlightRules = function() {
18
+
19
+ var keywordMapper = this.createKeywordMapper({
20
+ "support.function": supportFunction,
21
+ "support.constant": supportConstant,
22
+ "support.type": supportType,
23
+ "support.constant.color": supportConstantColor,
24
+ "support.constant.fonts": supportConstantFonts
25
+ }, "text", true);
26
+
27
+ this.$rules = {
28
+ "start" : [{
29
+ token : "comment", // multi line comment
30
+ regex : "\\/\\*",
31
+ push : "comment"
32
+ }, {
33
+ token: "paren.lparen",
34
+ regex: "\\{",
35
+ push: "ruleset"
36
+ }, {
37
+ token: "string",
38
+ regex: "@.*?{",
39
+ push: "media"
40
+ }, {
41
+ token: "keyword",
42
+ regex: "#[a-z0-9-_]+"
43
+ }, {
44
+ token: "variable",
45
+ regex: "\\.[a-z0-9-_]+"
46
+ }, {
47
+ token: "string",
48
+ regex: ":[a-z0-9-_]+"
49
+ }, {
50
+ token: "constant",
51
+ regex: "[a-z0-9-_]+"
52
+ }, {
53
+ caseInsensitive: true
54
+ }],
55
+
56
+ "media" : [{
57
+ token : "comment", // multi line comment
58
+ regex : "\\/\\*",
59
+ push : "comment"
60
+ }, {
61
+ token: "paren.lparen",
62
+ regex: "\\{",
63
+ push: "ruleset"
64
+ }, {
65
+ token: "string",
66
+ regex: "\\}",
67
+ next: "pop"
68
+ }, {
69
+ token: "keyword",
70
+ regex: "#[a-z0-9-_]+"
71
+ }, {
72
+ token: "variable",
73
+ regex: "\\.[a-z0-9-_]+"
74
+ }, {
75
+ token: "string",
76
+ regex: ":[a-z0-9-_]+"
77
+ }, {
78
+ token: "constant",
79
+ regex: "[a-z0-9-_]+"
80
+ }, {
81
+ caseInsensitive: true
82
+ }],
83
+
84
+ "comment" : [{
85
+ token : "comment",
86
+ regex : "\\*\\/",
87
+ next : "pop"
88
+ }, {
89
+ defaultToken : "comment"
90
+ }],
91
+
92
+ "ruleset" : [
93
+ {
94
+ token : "paren.rparen",
95
+ regex : "\\}",
96
+ next: "pop"
97
+ }, {
98
+ token : "comment", // multi line comment
99
+ regex : "\\/\\*",
100
+ push : "comment"
101
+ }, {
102
+ token : "string", // single line
103
+ regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
104
+ }, {
105
+ token : "string", // single line
106
+ regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
107
+ }, {
108
+ token : ["constant.numeric", "keyword"],
109
+ regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)"
110
+ }, {
111
+ token : "constant.numeric",
112
+ regex : numRe
113
+ }, {
114
+ token : "constant.numeric", // hex6 color
115
+ regex : "#[a-f0-9]{6}"
116
+ }, {
117
+ token : "constant.numeric", // hex3 color
118
+ regex : "#[a-f0-9]{3}"
119
+ }, {
120
+ token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
121
+ regex : pseudoElements
122
+ }, {
123
+ token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
124
+ regex : pseudoClasses
125
+ }, {
126
+ token : ["support.function", "string", "support.function"],
127
+ regex : "(url\\()(.*)(\\))"
128
+ }, {
129
+ token : keywordMapper,
130
+ regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
131
+ }, {
132
+ caseInsensitive: true
133
+ }]
134
+ };
135
+
136
+ this.normalizeRules();
137
+ };
138
+
139
+ oop.inherits(CssHighlightRules, TextHighlightRules);
140
+
141
+ exports.CssHighlightRules = CssHighlightRules;
142
+
143
+ });
144
+
145
+ define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
146
+ "use strict";
147
+
148
+ var oop = require("../lib/oop");
149
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
150
+
151
+ var DocCommentHighlightRules = function() {
152
+ this.$rules = {
153
+ "start" : [ {
154
+ token : "comment.doc.tag",
155
+ regex : "@[\\w\\d_]+" // TODO: fix email addresses
156
+ },
157
+ DocCommentHighlightRules.getTagRule(),
158
+ {
159
+ defaultToken : "comment.doc",
160
+ caseInsensitive: true
161
+ }]
162
+ };
163
+ };
164
+
165
+ oop.inherits(DocCommentHighlightRules, TextHighlightRules);
166
+
167
+ DocCommentHighlightRules.getTagRule = function(start) {
168
+ return {
169
+ token : "comment.doc.tag.storage.type",
170
+ regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b"
171
+ };
172
+ }
173
+
174
+ DocCommentHighlightRules.getStartRule = function(start) {
175
+ return {
176
+ token : "comment.doc", // doc comment
177
+ regex : "\\/\\*(?=\\*)",
178
+ next : start
179
+ };
180
+ };
181
+
182
+ DocCommentHighlightRules.getEndRule = function (start) {
183
+ return {
184
+ token : "comment.doc", // closing comment
185
+ regex : "\\*\\/",
186
+ next : start
187
+ };
188
+ };
189
+
190
+
191
+ exports.DocCommentHighlightRules = DocCommentHighlightRules;
192
+
193
+ });
194
+
195
+ 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) {
196
+ "use strict";
197
+
198
+ var oop = require("../lib/oop");
199
+ var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
200
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
201
+ var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b";
202
+
203
+ var JavaScriptHighlightRules = function(options) {
204
+ var keywordMapper = this.createKeywordMapper({
205
+ "variable.language":
206
+ "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors
207
+ "Namespace|QName|XML|XMLList|" + // E4X
208
+ "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
209
+ "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
210
+ "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors
211
+ "SyntaxError|TypeError|URIError|" +
212
+ "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions
213
+ "isNaN|parseFloat|parseInt|" +
214
+ "JSON|Math|" + // Other
215
+ "this|arguments|prototype|window|document" , // Pseudo
216
+ "keyword":
217
+ "const|yield|import|get|set|" +
218
+ "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
219
+ "if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
220
+ "__parent__|__count__|escape|unescape|with|__proto__|" +
221
+ "class|enum|extends|super|export|implements|private|public|interface|package|protected|static",
222
+ "storage.type":
223
+ "const|let|var|function",
224
+ "constant.language":
225
+ "null|Infinity|NaN|undefined",
226
+ "support.function":
227
+ "alert",
228
+ "constant.language.boolean": "true|false"
229
+ }, "identifier");
230
+ var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
231
+
232
+ var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
233
+ "u[0-9a-fA-F]{4}|" + // unicode
234
+ "[0-2][0-7]{0,2}|" + // oct
235
+ "3[0-6][0-7]?|" + // oct
236
+ "37[0-7]?|" + // oct
237
+ "[4-7][0-7]?|" + //oct
238
+ ".)";
239
+
240
+ this.$rules = {
241
+ "no_regex" : [
242
+ {
243
+ token : "comment",
244
+ regex : "\\/\\/",
245
+ next : "line_comment"
246
+ },
247
+ DocCommentHighlightRules.getStartRule("doc-start"),
248
+ {
249
+ token : "comment", // multi line comment
250
+ regex : /\/\*/,
251
+ next : "comment"
252
+ }, {
253
+ token : "string",
254
+ regex : "'(?=.)",
255
+ next : "qstring"
256
+ }, {
257
+ token : "string",
258
+ regex : '"(?=.)',
259
+ next : "qqstring"
260
+ }, {
261
+ token : "constant.numeric", // hex
262
+ regex : /0[xX][0-9a-fA-F]+\b/
263
+ }, {
264
+ token : "constant.numeric", // float
265
+ regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/
266
+ }, {
267
+ token : [
268
+ "storage.type", "punctuation.operator", "support.function",
269
+ "punctuation.operator", "entity.name.function", "text","keyword.operator"
270
+ ],
271
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)",
272
+ next: "function_arguments"
273
+ }, {
274
+ token : [
275
+ "storage.type", "punctuation.operator", "entity.name.function", "text",
276
+ "keyword.operator", "text", "storage.type", "text", "paren.lparen"
277
+ ],
278
+ regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
279
+ next: "function_arguments"
280
+ }, {
281
+ token : [
282
+ "entity.name.function", "text", "keyword.operator", "text", "storage.type",
283
+ "text", "paren.lparen"
284
+ ],
285
+ regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
286
+ next: "function_arguments"
287
+ }, {
288
+ token : [
289
+ "storage.type", "punctuation.operator", "entity.name.function", "text",
290
+ "keyword.operator", "text",
291
+ "storage.type", "text", "entity.name.function", "text", "paren.lparen"
292
+ ],
293
+ regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",
294
+ next: "function_arguments"
295
+ }, {
296
+ token : [
297
+ "storage.type", "text", "entity.name.function", "text", "paren.lparen"
298
+ ],
299
+ regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
300
+ next: "function_arguments"
301
+ }, {
302
+ token : [
303
+ "entity.name.function", "text", "punctuation.operator",
304
+ "text", "storage.type", "text", "paren.lparen"
305
+ ],
306
+ regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
307
+ next: "function_arguments"
308
+ }, {
309
+ token : [
310
+ "text", "text", "storage.type", "text", "paren.lparen"
311
+ ],
312
+ regex : "(:)(\\s*)(function)(\\s*)(\\()",
313
+ next: "function_arguments"
314
+ }, {
315
+ token : "keyword",
316
+ regex : "(?:" + kwBeforeRe + ")\\b",
317
+ next : "start"
318
+ }, {
319
+ token : ["support.constant"],
320
+ regex : /that\b/
321
+ }, {
322
+ token : ["storage.type", "punctuation.operator", "support.function.firebug"],
323
+ regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/
324
+ }, {
325
+ token : keywordMapper,
326
+ regex : identifierRe
327
+ }, {
328
+ token : "punctuation.operator",
329
+ regex : /[.](?![.])/,
330
+ next : "property"
331
+ }, {
332
+ token : "keyword.operator",
333
+ regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|[!$%&*+\-~\/^]=?/,
334
+ next : "start"
335
+ }, {
336
+ token : "punctuation.operator",
337
+ regex : /[?:,;.]/,
338
+ next : "start"
339
+ }, {
340
+ token : "paren.lparen",
341
+ regex : /[\[({]/,
342
+ next : "start"
343
+ }, {
344
+ token : "paren.rparen",
345
+ regex : /[\])}]/
346
+ }, {
347
+ token: "comment",
348
+ regex: /^#!.*$/
349
+ }
350
+ ],
351
+ property: [{
352
+ token : "text",
353
+ regex : "\\s+"
354
+ }, {
355
+ token : [
356
+ "storage.type", "punctuation.operator", "entity.name.function", "text",
357
+ "keyword.operator", "text",
358
+ "storage.type", "text", "entity.name.function", "text", "paren.lparen"
359
+ ],
360
+ regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()",
361
+ next: "function_arguments"
362
+ }, {
363
+ token : "punctuation.operator",
364
+ regex : /[.](?![.])/
365
+ }, {
366
+ token : "support.function",
367
+ regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
368
+ }, {
369
+ token : "support.function.dom",
370
+ regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
371
+ }, {
372
+ token : "support.constant",
373
+ 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/
374
+ }, {
375
+ token : "identifier",
376
+ regex : identifierRe
377
+ }, {
378
+ regex: "",
379
+ token: "empty",
380
+ next: "no_regex"
381
+ }
382
+ ],
383
+ "start": [
384
+ DocCommentHighlightRules.getStartRule("doc-start"),
385
+ {
386
+ token : "comment", // multi line comment
387
+ regex : "\\/\\*",
388
+ next : "comment_regex_allowed"
389
+ }, {
390
+ token : "comment",
391
+ regex : "\\/\\/",
392
+ next : "line_comment_regex_allowed"
393
+ }, {
394
+ token: "string.regexp",
395
+ regex: "\\/",
396
+ next: "regex"
397
+ }, {
398
+ token : "text",
399
+ regex : "\\s+|^$",
400
+ next : "start"
401
+ }, {
402
+ token: "empty",
403
+ regex: "",
404
+ next: "no_regex"
405
+ }
406
+ ],
407
+ "regex": [
408
+ {
409
+ token: "regexp.keyword.operator",
410
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
411
+ }, {
412
+ token: "string.regexp",
413
+ regex: "/[sxngimy]*",
414
+ next: "no_regex"
415
+ }, {
416
+ token : "invalid",
417
+ regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/
418
+ }, {
419
+ token : "constant.language.escape",
420
+ regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/
421
+ }, {
422
+ token : "constant.language.delimiter",
423
+ regex: /\|/
424
+ }, {
425
+ token: "constant.language.escape",
426
+ regex: /\[\^?/,
427
+ next: "regex_character_class"
428
+ }, {
429
+ token: "empty",
430
+ regex: "$",
431
+ next: "no_regex"
432
+ }, {
433
+ defaultToken: "string.regexp"
434
+ }
435
+ ],
436
+ "regex_character_class": [
437
+ {
438
+ token: "regexp.charclass.keyword.operator",
439
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
440
+ }, {
441
+ token: "constant.language.escape",
442
+ regex: "]",
443
+ next: "regex"
444
+ }, {
445
+ token: "constant.language.escape",
446
+ regex: "-"
447
+ }, {
448
+ token: "empty",
449
+ regex: "$",
450
+ next: "no_regex"
451
+ }, {
452
+ defaultToken: "string.regexp.charachterclass"
453
+ }
454
+ ],
455
+ "function_arguments": [
456
+ {
457
+ token: "variable.parameter",
458
+ regex: identifierRe
459
+ }, {
460
+ token: "punctuation.operator",
461
+ regex: "[, ]+"
462
+ }, {
463
+ token: "punctuation.operator",
464
+ regex: "$"
465
+ }, {
466
+ token: "empty",
467
+ regex: "",
468
+ next: "no_regex"
469
+ }
470
+ ],
471
+ "comment_regex_allowed" : [
472
+ DocCommentHighlightRules.getTagRule(),
473
+ {token : "comment", regex : "\\*\\/", next : "start"},
474
+ {defaultToken : "comment", caseInsensitive: true}
475
+ ],
476
+ "comment" : [
477
+ DocCommentHighlightRules.getTagRule(),
478
+ {token : "comment", regex : "\\*\\/", next : "no_regex"},
479
+ {defaultToken : "comment", caseInsensitive: true}
480
+ ],
481
+ "line_comment_regex_allowed" : [
482
+ DocCommentHighlightRules.getTagRule(),
483
+ {token : "comment", regex : "$|^", next : "start"},
484
+ {defaultToken : "comment", caseInsensitive: true}
485
+ ],
486
+ "line_comment" : [
487
+ DocCommentHighlightRules.getTagRule(),
488
+ {token : "comment", regex : "$|^", next : "no_regex"},
489
+ {defaultToken : "comment", caseInsensitive: true}
490
+ ],
491
+ "qqstring" : [
492
+ {
493
+ token : "constant.language.escape",
494
+ regex : escapedRe
495
+ }, {
496
+ token : "string",
497
+ regex : "\\\\$",
498
+ next : "qqstring"
499
+ }, {
500
+ token : "string",
501
+ regex : '"|$',
502
+ next : "no_regex"
503
+ }, {
504
+ defaultToken: "string"
505
+ }
506
+ ],
507
+ "qstring" : [
508
+ {
509
+ token : "constant.language.escape",
510
+ regex : escapedRe
511
+ }, {
512
+ token : "string",
513
+ regex : "\\\\$",
514
+ next : "qstring"
515
+ }, {
516
+ token : "string",
517
+ regex : "'|$",
518
+ next : "no_regex"
519
+ }, {
520
+ defaultToken: "string"
521
+ }
522
+ ]
523
+ };
524
+
525
+
526
+ if (!options || !options.noES6) {
527
+ this.$rules.no_regex.unshift({
528
+ regex: "[{}]", onMatch: function(val, state, stack) {
529
+ this.next = val == "{" ? this.nextState : "";
530
+ if (val == "{" && stack.length) {
531
+ stack.unshift("start", state);
532
+ return "paren";
533
+ }
534
+ if (val == "}" && stack.length) {
535
+ stack.shift();
536
+ this.next = stack.shift();
537
+ if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1)
538
+ return "paren.quasi.end";
539
+ }
540
+ return val == "{" ? "paren.lparen" : "paren.rparen";
541
+ },
542
+ nextState: "start"
543
+ }, {
544
+ token : "string.quasi.start",
545
+ regex : /`/,
546
+ push : [{
547
+ token : "constant.language.escape",
548
+ regex : escapedRe
549
+ }, {
550
+ token : "paren.quasi.start",
551
+ regex : /\${/,
552
+ push : "start"
553
+ }, {
554
+ token : "string.quasi.end",
555
+ regex : /`/,
556
+ next : "pop"
557
+ }, {
558
+ defaultToken: "string.quasi"
559
+ }]
560
+ });
561
+
562
+ if (!options || !options.noJSX)
563
+ JSX.call(this);
564
+ }
565
+
566
+ this.embedRules(DocCommentHighlightRules, "doc-",
567
+ [ DocCommentHighlightRules.getEndRule("no_regex") ]);
568
+
569
+ this.normalizeRules();
570
+ };
571
+
572
+ oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
573
+
574
+ function JSX() {
575
+ var tagRegex = identifierRe.replace("\\d", "\\d\\-");
576
+ var jsxTag = {
577
+ onMatch : function(val, state, stack) {
578
+ var offset = val.charAt(1) == "/" ? 2 : 1;
579
+ if (offset == 1) {
580
+ if (state != this.nextState)
581
+ stack.unshift(this.next, this.nextState, 0);
582
+ else
583
+ stack.unshift(this.next);
584
+ stack[2]++;
585
+ } else if (offset == 2) {
586
+ if (state == this.nextState) {
587
+ stack[1]--;
588
+ if (!stack[1] || stack[1] < 0) {
589
+ stack.shift();
590
+ stack.shift();
591
+ }
592
+ }
593
+ }
594
+ return [{
595
+ type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml",
596
+ value: val.slice(0, offset)
597
+ }, {
598
+ type: "meta.tag.tag-name.xml",
599
+ value: val.substr(offset)
600
+ }];
601
+ },
602
+ regex : "</?" + tagRegex + "",
603
+ next: "jsxAttributes",
604
+ nextState: "jsx"
605
+ };
606
+ this.$rules.start.unshift(jsxTag);
607
+ var jsxJsRule = {
608
+ regex: "{",
609
+ token: "paren.quasi.start",
610
+ push: "start"
611
+ };
612
+ this.$rules.jsx = [
613
+ jsxJsRule,
614
+ jsxTag,
615
+ {include : "reference"},
616
+ {defaultToken: "string"}
617
+ ];
618
+ this.$rules.jsxAttributes = [{
619
+ token : "meta.tag.punctuation.tag-close.xml",
620
+ regex : "/?>",
621
+ onMatch : function(value, currentState, stack) {
622
+ if (currentState == stack[0])
623
+ stack.shift();
624
+ if (value.length == 2) {
625
+ if (stack[0] == this.nextState)
626
+ stack[1]--;
627
+ if (!stack[1] || stack[1] < 0) {
628
+ stack.splice(0, 2);
629
+ }
630
+ }
631
+ this.next = stack[0] || "start";
632
+ return [{type: this.token, value: value}];
633
+ },
634
+ nextState: "jsx"
635
+ },
636
+ jsxJsRule,
637
+ {
638
+ token : "entity.other.attribute-name.xml",
639
+ regex : tagRegex
640
+ }, {
641
+ token : "keyword.operator.attribute-equals.xml",
642
+ regex : "="
643
+ }, {
644
+ token : "text.tag-whitespace.xml",
645
+ regex : "\\s+"
646
+ }, {
647
+ token : "string.attribute-value.xml",
648
+ regex : "'",
649
+ stateName : "jsx_attr_q",
650
+ push : [
651
+ {token : "string.attribute-value.xml", regex: "'", next: "pop"},
652
+ jsxJsRule,
653
+ {include : "reference"},
654
+ {defaultToken : "string.attribute-value.xml"}
655
+ ]
656
+ }, {
657
+ token : "string.attribute-value.xml",
658
+ regex : '"',
659
+ stateName : "jsx_attr_qq",
660
+ push : [
661
+ jsxJsRule,
662
+ {token : "string.attribute-value.xml", regex: '"', next: "pop"},
663
+ {include : "reference"},
664
+ {defaultToken : "string.attribute-value.xml"}
665
+ ]
666
+ }];
667
+ this.$rules.reference = [{
668
+ token : "constant.language.escape.reference.xml",
669
+ regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
670
+ }];
671
+ }
672
+
673
+ exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
674
+ });
675
+
676
+ define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
677
+ "use strict";
678
+
679
+ var oop = require("../lib/oop");
680
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
681
+
682
+ var XmlHighlightRules = function(normalize) {
683
+ var tagRegex = "[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*";
684
+
685
+ this.$rules = {
686
+ start : [
687
+ {token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"},
688
+ {
689
+ token : ["punctuation.xml-decl.xml", "keyword.xml-decl.xml"],
690
+ regex : "(<\\?)(xml)(?=[\\s])", next : "xml_decl", caseInsensitive: true
691
+ },
692
+ {
693
+ token : ["punctuation.instruction.xml", "keyword.instruction.xml"],
694
+ regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction",
695
+ },
696
+ {token : "comment.xml", regex : "<\\!--", next : "comment"},
697
+ {
698
+ token : ["xml-pe.doctype.xml", "xml-pe.doctype.xml"],
699
+ regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype", caseInsensitive: true
700
+ },
701
+ {include : "tag"},
702
+ {token : "text.end-tag-open.xml", regex: "</"},
703
+ {token : "text.tag-open.xml", regex: "<"},
704
+ {include : "reference"},
705
+ {defaultToken : "text.xml"}
706
+ ],
707
+
708
+ xml_decl : [{
709
+ token : "entity.other.attribute-name.decl-attribute-name.xml",
710
+ regex : "(?:" + tagRegex + ":)?" + tagRegex + ""
711
+ }, {
712
+ token : "keyword.operator.decl-attribute-equals.xml",
713
+ regex : "="
714
+ }, {
715
+ include: "whitespace"
716
+ }, {
717
+ include: "string"
718
+ }, {
719
+ token : "punctuation.xml-decl.xml",
720
+ regex : "\\?>",
721
+ next : "start"
722
+ }],
723
+
724
+ processing_instruction : [
725
+ {token : "punctuation.instruction.xml", regex : "\\?>", next : "start"},
726
+ {defaultToken : "instruction.xml"}
727
+ ],
728
+
729
+ doctype : [
730
+ {include : "whitespace"},
731
+ {include : "string"},
732
+ {token : "xml-pe.doctype.xml", regex : ">", next : "start"},
733
+ {token : "xml-pe.xml", regex : "[-_a-zA-Z0-9:]+"},
734
+ {token : "punctuation.int-subset", regex : "\\[", push : "int_subset"}
735
+ ],
736
+
737
+ int_subset : [{
738
+ token : "text.xml",
739
+ regex : "\\s+"
740
+ }, {
741
+ token: "punctuation.int-subset.xml",
742
+ regex: "]",
743
+ next: "pop"
744
+ }, {
745
+ token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"],
746
+ regex : "(<\\!)(" + tagRegex + ")",
747
+ push : [{
748
+ token : "text",
749
+ regex : "\\s+"
750
+ },
751
+ {
752
+ token : "punctuation.markup-decl.xml",
753
+ regex : ">",
754
+ next : "pop"
755
+ },
756
+ {include : "string"}]
757
+ }],
758
+
759
+ cdata : [
760
+ {token : "string.cdata.xml", regex : "\\]\\]>", next : "start"},
761
+ {token : "text.xml", regex : "\\s+"},
762
+ {token : "text.xml", regex : "(?:[^\\]]|\\](?!\\]>))+"}
763
+ ],
764
+
765
+ comment : [
766
+ {token : "comment.xml", regex : "-->", next : "start"},
767
+ {defaultToken : "comment.xml"}
768
+ ],
769
+
770
+ reference : [{
771
+ token : "constant.language.escape.reference.xml",
772
+ regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
773
+ }],
774
+
775
+ attr_reference : [{
776
+ token : "constant.language.escape.reference.attribute-value.xml",
777
+ regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
778
+ }],
779
+
780
+ tag : [{
781
+ token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"],
782
+ regex : "(?:(<)|(</))((?:" + tagRegex + ":)?" + tagRegex + ")",
783
+ next: [
784
+ {include : "attributes"},
785
+ {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : "start"}
786
+ ]
787
+ }],
788
+
789
+ tag_whitespace : [
790
+ {token : "text.tag-whitespace.xml", regex : "\\s+"}
791
+ ],
792
+ whitespace : [
793
+ {token : "text.whitespace.xml", regex : "\\s+"}
794
+ ],
795
+ string: [{
796
+ token : "string.xml",
797
+ regex : "'",
798
+ push : [
799
+ {token : "string.xml", regex: "'", next: "pop"},
800
+ {defaultToken : "string.xml"}
801
+ ]
802
+ }, {
803
+ token : "string.xml",
804
+ regex : '"',
805
+ push : [
806
+ {token : "string.xml", regex: '"', next: "pop"},
807
+ {defaultToken : "string.xml"}
808
+ ]
809
+ }],
810
+
811
+ attributes: [{
812
+ token : "entity.other.attribute-name.xml",
813
+ regex : "(?:" + tagRegex + ":)?" + tagRegex + ""
814
+ }, {
815
+ token : "keyword.operator.attribute-equals.xml",
816
+ regex : "="
817
+ }, {
818
+ include: "tag_whitespace"
819
+ }, {
820
+ include: "attribute_value"
821
+ }],
822
+
823
+ attribute_value: [{
824
+ token : "string.attribute-value.xml",
825
+ regex : "'",
826
+ push : [
827
+ {token : "string.attribute-value.xml", regex: "'", next: "pop"},
828
+ {include : "attr_reference"},
829
+ {defaultToken : "string.attribute-value.xml"}
830
+ ]
831
+ }, {
832
+ token : "string.attribute-value.xml",
833
+ regex : '"',
834
+ push : [
835
+ {token : "string.attribute-value.xml", regex: '"', next: "pop"},
836
+ {include : "attr_reference"},
837
+ {defaultToken : "string.attribute-value.xml"}
838
+ ]
839
+ }]
840
+ };
841
+
842
+ if (this.constructor === XmlHighlightRules)
843
+ this.normalizeRules();
844
+ };
845
+
846
+
847
+ (function() {
848
+
849
+ this.embedTagRules = function(HighlightRules, prefix, tag){
850
+ this.$rules.tag.unshift({
851
+ token : ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
852
+ regex : "(<)(" + tag + "(?=\\s|>|$))",
853
+ next: [
854
+ {include : "attributes"},
855
+ {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : prefix + "start"}
856
+ ]
857
+ });
858
+
859
+ this.$rules[tag + "-end"] = [
860
+ {include : "attributes"},
861
+ {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next: "start",
862
+ onMatch : function(value, currentState, stack) {
863
+ stack.splice(0);
864
+ return this.token;
865
+ }}
866
+ ]
867
+
868
+ this.embedRules(HighlightRules, prefix, [{
869
+ token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
870
+ regex : "(</)(" + tag + "(?=\\s|>|$))",
871
+ next: tag + "-end"
872
+ }, {
873
+ token: "string.cdata.xml",
874
+ regex : "<\\!\\[CDATA\\["
875
+ }, {
876
+ token: "string.cdata.xml",
877
+ regex : "\\]\\]>"
878
+ }]);
879
+ };
880
+
881
+ }).call(TextHighlightRules.prototype);
882
+
883
+ oop.inherits(XmlHighlightRules, TextHighlightRules);
884
+
885
+ exports.XmlHighlightRules = XmlHighlightRules;
886
+ });
887
+
888
+ 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) {
889
+ "use strict";
890
+
891
+ var oop = require("../lib/oop");
892
+ var lang = require("../lib/lang");
893
+ var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
894
+ var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
895
+ var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
896
+
897
+ var tagMap = lang.createMap({
898
+ a : 'anchor',
899
+ button : 'form',
900
+ form : 'form',
901
+ img : 'image',
902
+ input : 'form',
903
+ label : 'form',
904
+ option : 'form',
905
+ script : 'script',
906
+ select : 'form',
907
+ textarea : 'form',
908
+ style : 'style',
909
+ table : 'table',
910
+ tbody : 'table',
911
+ td : 'table',
912
+ tfoot : 'table',
913
+ th : 'table',
914
+ tr : 'table'
915
+ });
916
+
917
+ var HtmlHighlightRules = function() {
918
+ XmlHighlightRules.call(this);
919
+
920
+ this.addRules({
921
+ attributes: [{
922
+ include : "tag_whitespace"
923
+ }, {
924
+ token : "entity.other.attribute-name.xml",
925
+ regex : "[-_a-zA-Z0-9:.]+"
926
+ }, {
927
+ token : "keyword.operator.attribute-equals.xml",
928
+ regex : "=",
929
+ push : [{
930
+ include: "tag_whitespace"
931
+ }, {
932
+ token : "string.unquoted.attribute-value.html",
933
+ regex : "[^<>='\"`\\s]+",
934
+ next : "pop"
935
+ }, {
936
+ token : "empty",
937
+ regex : "",
938
+ next : "pop"
939
+ }]
940
+ }, {
941
+ include : "attribute_value"
942
+ }],
943
+ tag: [{
944
+ token : function(start, tag) {
945
+ var group = tagMap[tag];
946
+ return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml",
947
+ "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"];
948
+ },
949
+ regex : "(</?)([-_a-zA-Z0-9:.]+)",
950
+ next: "tag_stuff"
951
+ }],
952
+ tag_stuff: [
953
+ {include : "attributes"},
954
+ {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : "start"}
955
+ ],
956
+ });
957
+
958
+ this.embedTagRules(CssHighlightRules, "css-", "style");
959
+ this.embedTagRules(new JavaScriptHighlightRules({noJSX: true}).getRules(), "js-", "script");
960
+
961
+ if (this.constructor === HtmlHighlightRules)
962
+ this.normalizeRules();
963
+ };
964
+
965
+ oop.inherits(HtmlHighlightRules, XmlHighlightRules);
966
+
967
+ exports.HtmlHighlightRules = HtmlHighlightRules;
968
+ });
969
+
970
+ define("ace/mode/swig",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/html_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) {
971
+ "use strict";
972
+
973
+ var oop = require("../lib/oop");
974
+ var lang = require("../lib/lang");
975
+ var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
976
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
977
+
978
+ var SwigHighlightRules = function() {
979
+ HtmlHighlightRules.call(this);
980
+
981
+ var tags = "autoescape|block|else|elif|extends|filter|for|if|import|include|macro|parent|raw|set|spaceless";
982
+ tags = tags + "|end" + tags.replace(/\|/g, "|end");
983
+ var filters = "addslashes|capitalize|date|default|escape|first|groupBy|join|json|last|lower|raw|replace|reverse|safe|sort|striptags|title|uniq|upper|url_encode|url_decode";
984
+ var special = "first|last|index|index0|revindex|revindex0|key"
985
+ var constants = "null|none|true|false|loop";
986
+ var operators = "in|is|and|or|not|as|with|only";
987
+
988
+ var keywordMapper = this.createKeywordMapper({
989
+ "keyword.control.swig": tags,
990
+ "support.function.swig": filters+"|"+special,
991
+ "keyword.operator.swig": operators,
992
+ "constant.language.swig": constants,
993
+ }, "identifier");
994
+ for (var rule in this.$rules) {
995
+ this.$rules[rule].unshift({
996
+ token : "variable.other.readwrite.local.swig",
997
+ regex : "\\{\\{-?",
998
+ push : "swig-start"
999
+ }, {
1000
+ token : "meta.tag.swig",
1001
+ regex : "\\{%-?",
1002
+ push : "swig-start"
1003
+ }, {
1004
+ token : "comment.block.swig",
1005
+ regex : "\\{#-?",
1006
+ push : "swig-comment"
1007
+ });
1008
+ }
1009
+ this.$rules["swig-comment"] = [{
1010
+ token : "comment.block.swig",
1011
+ regex : ".*-?#}",
1012
+ next : "pop"
1013
+ }];
1014
+
1015
+ this.$rules["swig-start"] = [{
1016
+ token : "variable.other.readwrite.local.swig",
1017
+ regex : "-?\\}\\}",
1018
+ next : "pop"
1019
+ }, {
1020
+ token : "meta.tag.swig",
1021
+ regex : "-?%\\}",
1022
+ next : "pop"
1023
+ }, {
1024
+ token : "string",
1025
+ regex : "'",
1026
+ next : "swig-qstring"
1027
+ }, {
1028
+ token : "string",
1029
+ regex : '"',
1030
+ next : "swig-qqstring"
1031
+ }, {
1032
+ token : "constant.numeric", // hex
1033
+ regex : "0[xX][0-9a-fA-F]+\\b"
1034
+ }, {
1035
+ token : "constant.numeric", // float
1036
+ regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
1037
+ }, {
1038
+ token : "constant.language.boolean",
1039
+ regex : "(?:true|false)\\b"
1040
+ }, {
1041
+ token : keywordMapper,
1042
+ regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
1043
+ }, {
1044
+ token : "keyword.operator.assignment",
1045
+ regex : "=|~"
1046
+ }, {
1047
+ token : "keyword.operator.comparison",
1048
+ regex : "==|!=|<|>|>=|<=|==="
1049
+ }, {
1050
+ token : "keyword.operator.arithmetic",
1051
+ regex : "\\+|-|/|%|//|\\*|\\*\\*"
1052
+ }, {
1053
+ token : "keyword.operator.other",
1054
+ regex : "\\.\\.|\\|"
1055
+ }, {
1056
+ token : "punctuation.operator",
1057
+ regex : /\?|\:|\,|\;|\./
1058
+ }, {
1059
+ token : "paren.lparen",
1060
+ regex : /[\[\({]/
1061
+ }, {
1062
+ token : "paren.rparen",
1063
+ regex : /[\])}]/
1064
+ }, {
1065
+ token : "text",
1066
+ regex : "\\s+"
1067
+ } ];
1068
+
1069
+ this.$rules["swig-qqstring"] = [{
1070
+ token : "constant.language.escape",
1071
+ regex : /\\[\\"$#ntr]|#{[^"}]*}/
1072
+ }, {
1073
+ token : "string",
1074
+ regex : '"',
1075
+ next : "swig-start"
1076
+ }, {
1077
+ defaultToken : "string"
1078
+ }
1079
+ ];
1080
+
1081
+ this.$rules["swig-qstring"] = [{
1082
+ token : "constant.language.escape",
1083
+ regex : /\\[\\'ntr]}/
1084
+ }, {
1085
+ token : "string",
1086
+ regex : "'",
1087
+ next : "swig-start"
1088
+ }, {
1089
+ defaultToken : "string"
1090
+ }
1091
+ ];
1092
+
1093
+ this.normalizeRules();
1094
+ };
1095
+
1096
+ oop.inherits(SwigHighlightRules, TextHighlightRules);
1097
+
1098
+ exports.SwigHighlightRules = SwigHighlightRules;
1099
+ });