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,3372 @@
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/elixir_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
971
+ "use strict";
972
+
973
+ var oop = require("../lib/oop");
974
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
975
+
976
+ var ElixirHighlightRules = function() {
977
+
978
+ this.$rules = { start:
979
+ [ { token:
980
+ [ 'meta.module.elixir',
981
+ 'keyword.control.module.elixir',
982
+ 'meta.module.elixir',
983
+ 'entity.name.type.module.elixir' ],
984
+ regex: '^(\\s*)(defmodule)(\\s+)((?:[A-Z]\\w*\\s*\\.\\s*)*[A-Z]\\w*)' },
985
+ { token: 'comment.documentation.heredoc',
986
+ regex: '@(?:module|type)?doc (?:~[a-z])?"""',
987
+ push:
988
+ [ { token: 'comment.documentation.heredoc',
989
+ regex: '\\s*"""',
990
+ next: 'pop' },
991
+ { include: '#interpolated_elixir' },
992
+ { include: '#escaped_char' },
993
+ { defaultToken: 'comment.documentation.heredoc' } ],
994
+ comment: '@doc with heredocs is treated as documentation' },
995
+ { token: 'comment.documentation.heredoc',
996
+ regex: '@(?:module|type)?doc ~[A-Z]"""',
997
+ push:
998
+ [ { token: 'comment.documentation.heredoc',
999
+ regex: '\\s*"""',
1000
+ next: 'pop' },
1001
+ { defaultToken: 'comment.documentation.heredoc' } ],
1002
+ comment: '@doc with heredocs is treated as documentation' },
1003
+ { token: 'comment.documentation.heredoc',
1004
+ regex: '@(?:module|type)?doc (?:~[a-z])?\'\'\'',
1005
+ push:
1006
+ [ { token: 'comment.documentation.heredoc',
1007
+ regex: '\\s*\'\'\'',
1008
+ next: 'pop' },
1009
+ { include: '#interpolated_elixir' },
1010
+ { include: '#escaped_char' },
1011
+ { defaultToken: 'comment.documentation.heredoc' } ],
1012
+ comment: '@doc with heredocs is treated as documentation' },
1013
+ { token: 'comment.documentation.heredoc',
1014
+ regex: '@(?:module|type)?doc ~[A-Z]\'\'\'',
1015
+ push:
1016
+ [ { token: 'comment.documentation.heredoc',
1017
+ regex: '\\s*\'\'\'',
1018
+ next: 'pop' },
1019
+ { defaultToken: 'comment.documentation.heredoc' } ],
1020
+ comment: '@doc with heredocs is treated as documentation' },
1021
+ { token: 'comment.documentation.false',
1022
+ regex: '@(?:module|type)?doc false',
1023
+ comment: '@doc false is treated as documentation' },
1024
+ { token: 'comment.documentation.string',
1025
+ regex: '@(?:module|type)?doc "',
1026
+ push:
1027
+ [ { token: 'comment.documentation.string',
1028
+ regex: '"',
1029
+ next: 'pop' },
1030
+ { include: '#interpolated_elixir' },
1031
+ { include: '#escaped_char' },
1032
+ { defaultToken: 'comment.documentation.string' } ],
1033
+ comment: '@doc with string is treated as documentation' },
1034
+ { token: 'keyword.control.elixir',
1035
+ regex: '\\b(?:do|end|case|bc|lc|for|if|cond|unless|try|receive|fn|defmodule|defp?|defprotocol|defimpl|defrecord|defstruct|defmacrop?|defdelegate|defcallback|defmacrocallback|defexception|defoverridable|exit|after|rescue|catch|else|raise|throw|import|require|alias|use|quote|unquote|super)\\b(?![?!])',
1036
+ TODO: 'FIXME: regexp doesn\'t have js equivalent',
1037
+ originalRegex: '(?<!\\.)\\b(do|end|case|bc|lc|for|if|cond|unless|try|receive|fn|defmodule|defp?|defprotocol|defimpl|defrecord|defstruct|defmacrop?|defdelegate|defcallback|defmacrocallback|defexception|defoverridable|exit|after|rescue|catch|else|raise|throw|import|require|alias|use|quote|unquote|super)\\b(?![?!])' },
1038
+ { token: 'keyword.operator.elixir',
1039
+ regex: '\\b(?:and|not|or|when|xor|in|inlist|inbits)\\b',
1040
+ TODO: 'FIXME: regexp doesn\'t have js equivalent',
1041
+ originalRegex: '(?<!\\.)\\b(and|not|or|when|xor|in|inlist|inbits)\\b',
1042
+ comment: ' as above, just doesn\'t need a \'end\' and does a logic operation' },
1043
+ { token: 'constant.language.elixir',
1044
+ regex: '\\b(?:nil|true|false)\\b(?![?!])' },
1045
+ { token: 'variable.language.elixir',
1046
+ regex: '\\b__(?:CALLER|ENV|MODULE|DIR)__\\b(?![?!])' },
1047
+ { token:
1048
+ [ 'punctuation.definition.variable.elixir',
1049
+ 'variable.other.readwrite.module.elixir' ],
1050
+ regex: '(@)([a-zA-Z_]\\w*)' },
1051
+ { token:
1052
+ [ 'punctuation.definition.variable.elixir',
1053
+ 'variable.other.anonymous.elixir' ],
1054
+ regex: '(&)(\\d*)' },
1055
+ { token: 'variable.other.constant.elixir',
1056
+ regex: '\\b[A-Z]\\w*\\b' },
1057
+ { token: 'constant.numeric.elixir',
1058
+ regex: '\\b(?:0x[\\da-fA-F](?:_?[\\da-fA-F])*|\\d(?:_?\\d)*(?:\\.(?![^[:space:][:digit:]])(?:_?\\d)*)?(?:[eE][-+]?\\d(?:_?\\d)*)?|0b[01]+|0o[0-7]+)\\b',
1059
+ TODO: 'FIXME: regexp doesn\'t have js equivalent',
1060
+ originalRegex: '\\b(0x\\h(?>_?\\h)*|\\d(?>_?\\d)*(\\.(?![^[:space:][:digit:]])(?>_?\\d)*)?([eE][-+]?\\d(?>_?\\d)*)?|0b[01]+|0o[0-7]+)\\b' },
1061
+ { token: 'punctuation.definition.constant.elixir',
1062
+ regex: ':\'',
1063
+ push:
1064
+ [ { token: 'punctuation.definition.constant.elixir',
1065
+ regex: '\'',
1066
+ next: 'pop' },
1067
+ { include: '#interpolated_elixir' },
1068
+ { include: '#escaped_char' },
1069
+ { defaultToken: 'constant.other.symbol.single-quoted.elixir' } ] },
1070
+ { token: 'punctuation.definition.constant.elixir',
1071
+ regex: ':"',
1072
+ push:
1073
+ [ { token: 'punctuation.definition.constant.elixir',
1074
+ regex: '"',
1075
+ next: 'pop' },
1076
+ { include: '#interpolated_elixir' },
1077
+ { include: '#escaped_char' },
1078
+ { defaultToken: 'constant.other.symbol.double-quoted.elixir' } ] },
1079
+ { token: 'punctuation.definition.string.begin.elixir',
1080
+ regex: '(?:\'\'\')',
1081
+ TODO: 'FIXME: regexp doesn\'t have js equivalent',
1082
+ originalRegex: '(?>\'\'\')',
1083
+ push:
1084
+ [ { token: 'punctuation.definition.string.end.elixir',
1085
+ regex: '^\\s*\'\'\'',
1086
+ next: 'pop' },
1087
+ { include: '#interpolated_elixir' },
1088
+ { include: '#escaped_char' },
1089
+ { defaultToken: 'support.function.variable.quoted.single.heredoc.elixir' } ],
1090
+ comment: 'Single-quoted heredocs' },
1091
+ { token: 'punctuation.definition.string.begin.elixir',
1092
+ regex: '\'',
1093
+ push:
1094
+ [ { token: 'punctuation.definition.string.end.elixir',
1095
+ regex: '\'',
1096
+ next: 'pop' },
1097
+ { include: '#interpolated_elixir' },
1098
+ { include: '#escaped_char' },
1099
+ { defaultToken: 'support.function.variable.quoted.single.elixir' } ],
1100
+ comment: 'single quoted string (allows for interpolation)' },
1101
+ { token: 'punctuation.definition.string.begin.elixir',
1102
+ regex: '(?:""")',
1103
+ TODO: 'FIXME: regexp doesn\'t have js equivalent',
1104
+ originalRegex: '(?>""")',
1105
+ push:
1106
+ [ { token: 'punctuation.definition.string.end.elixir',
1107
+ regex: '^\\s*"""',
1108
+ next: 'pop' },
1109
+ { include: '#interpolated_elixir' },
1110
+ { include: '#escaped_char' },
1111
+ { defaultToken: 'string.quoted.double.heredoc.elixir' } ],
1112
+ comment: 'Double-quoted heredocs' },
1113
+ { token: 'punctuation.definition.string.begin.elixir',
1114
+ regex: '"',
1115
+ push:
1116
+ [ { token: 'punctuation.definition.string.end.elixir',
1117
+ regex: '"',
1118
+ next: 'pop' },
1119
+ { include: '#interpolated_elixir' },
1120
+ { include: '#escaped_char' },
1121
+ { defaultToken: 'string.quoted.double.elixir' } ],
1122
+ comment: 'double quoted string (allows for interpolation)' },
1123
+ { token: 'punctuation.definition.string.begin.elixir',
1124
+ regex: '~[a-z](?:""")',
1125
+ TODO: 'FIXME: regexp doesn\'t have js equivalent',
1126
+ originalRegex: '~[a-z](?>""")',
1127
+ push:
1128
+ [ { token: 'punctuation.definition.string.end.elixir',
1129
+ regex: '^\\s*"""',
1130
+ next: 'pop' },
1131
+ { include: '#interpolated_elixir' },
1132
+ { include: '#escaped_char' },
1133
+ { defaultToken: 'string.quoted.double.heredoc.elixir' } ],
1134
+ comment: 'Double-quoted heredocs sigils' },
1135
+ { token: 'punctuation.definition.string.begin.elixir',
1136
+ regex: '~[a-z]\\{',
1137
+ push:
1138
+ [ { token: 'punctuation.definition.string.end.elixir',
1139
+ regex: '\\}[a-z]*',
1140
+ next: 'pop' },
1141
+ { include: '#interpolated_elixir' },
1142
+ { include: '#escaped_char' },
1143
+ { defaultToken: 'string.interpolated.elixir' } ],
1144
+ comment: 'sigil (allow for interpolation)' },
1145
+ { token: 'punctuation.definition.string.begin.elixir',
1146
+ regex: '~[a-z]\\[',
1147
+ push:
1148
+ [ { token: 'punctuation.definition.string.end.elixir',
1149
+ regex: '\\][a-z]*',
1150
+ next: 'pop' },
1151
+ { include: '#interpolated_elixir' },
1152
+ { include: '#escaped_char' },
1153
+ { defaultToken: 'string.interpolated.elixir' } ],
1154
+ comment: 'sigil (allow for interpolation)' },
1155
+ { token: 'punctuation.definition.string.begin.elixir',
1156
+ regex: '~[a-z]\\<',
1157
+ push:
1158
+ [ { token: 'punctuation.definition.string.end.elixir',
1159
+ regex: '\\>[a-z]*',
1160
+ next: 'pop' },
1161
+ { include: '#interpolated_elixir' },
1162
+ { include: '#escaped_char' },
1163
+ { defaultToken: 'string.interpolated.elixir' } ],
1164
+ comment: 'sigil (allow for interpolation)' },
1165
+ { token: 'punctuation.definition.string.begin.elixir',
1166
+ regex: '~[a-z]\\(',
1167
+ push:
1168
+ [ { token: 'punctuation.definition.string.end.elixir',
1169
+ regex: '\\)[a-z]*',
1170
+ next: 'pop' },
1171
+ { include: '#interpolated_elixir' },
1172
+ { include: '#escaped_char' },
1173
+ { defaultToken: 'string.interpolated.elixir' } ],
1174
+ comment: 'sigil (allow for interpolation)' },
1175
+ { token: 'punctuation.definition.string.begin.elixir',
1176
+ regex: '~[a-z][^\\w]',
1177
+ push:
1178
+ [ { token: 'punctuation.definition.string.end.elixir',
1179
+ regex: '[^\\w][a-z]*',
1180
+ next: 'pop' },
1181
+ { include: '#interpolated_elixir' },
1182
+ { include: '#escaped_char' },
1183
+ { include: '#escaped_char' },
1184
+ { defaultToken: 'string.interpolated.elixir' } ],
1185
+ comment: 'sigil (allow for interpolation)' },
1186
+ { token: 'punctuation.definition.string.begin.elixir',
1187
+ regex: '~[A-Z](?:""")',
1188
+ TODO: 'FIXME: regexp doesn\'t have js equivalent',
1189
+ originalRegex: '~[A-Z](?>""")',
1190
+ push:
1191
+ [ { token: 'punctuation.definition.string.end.elixir',
1192
+ regex: '^\\s*"""',
1193
+ next: 'pop' },
1194
+ { defaultToken: 'string.quoted.other.literal.upper.elixir' } ],
1195
+ comment: 'Double-quoted heredocs sigils' },
1196
+ { token: 'punctuation.definition.string.begin.elixir',
1197
+ regex: '~[A-Z]\\{',
1198
+ push:
1199
+ [ { token: 'punctuation.definition.string.end.elixir',
1200
+ regex: '\\}[a-z]*',
1201
+ next: 'pop' },
1202
+ { defaultToken: 'string.quoted.other.literal.upper.elixir' } ],
1203
+ comment: 'sigil (without interpolation)' },
1204
+ { token: 'punctuation.definition.string.begin.elixir',
1205
+ regex: '~[A-Z]\\[',
1206
+ push:
1207
+ [ { token: 'punctuation.definition.string.end.elixir',
1208
+ regex: '\\][a-z]*',
1209
+ next: 'pop' },
1210
+ { defaultToken: 'string.quoted.other.literal.upper.elixir' } ],
1211
+ comment: 'sigil (without interpolation)' },
1212
+ { token: 'punctuation.definition.string.begin.elixir',
1213
+ regex: '~[A-Z]\\<',
1214
+ push:
1215
+ [ { token: 'punctuation.definition.string.end.elixir',
1216
+ regex: '\\>[a-z]*',
1217
+ next: 'pop' },
1218
+ { defaultToken: 'string.quoted.other.literal.upper.elixir' } ],
1219
+ comment: 'sigil (without interpolation)' },
1220
+ { token: 'punctuation.definition.string.begin.elixir',
1221
+ regex: '~[A-Z]\\(',
1222
+ push:
1223
+ [ { token: 'punctuation.definition.string.end.elixir',
1224
+ regex: '\\)[a-z]*',
1225
+ next: 'pop' },
1226
+ { defaultToken: 'string.quoted.other.literal.upper.elixir' } ],
1227
+ comment: 'sigil (without interpolation)' },
1228
+ { token: 'punctuation.definition.string.begin.elixir',
1229
+ regex: '~[A-Z][^\\w]',
1230
+ push:
1231
+ [ { token: 'punctuation.definition.string.end.elixir',
1232
+ regex: '[^\\w][a-z]*',
1233
+ next: 'pop' },
1234
+ { defaultToken: 'string.quoted.other.literal.upper.elixir' } ],
1235
+ comment: 'sigil (without interpolation)' },
1236
+ { token: ['punctuation.definition.constant.elixir', 'constant.other.symbol.elixir'],
1237
+ regex: '(:)([a-zA-Z_][\\w@]*(?:[?!]|=(?![>=]))?|\\<\\>|===?|!==?|<<>>|<<<|>>>|~~~|::|<\\-|\\|>|=>|~|~=|=|/|\\\\\\\\|\\*\\*?|\\.\\.?\\.?|>=?|<=?|&&?&?|\\+\\+?|\\-\\-?|\\|\\|?\\|?|\\!|@|\\%?\\{\\}|%|\\[\\]|\\^(?:\\^\\^)?)',
1238
+ TODO: 'FIXME: regexp doesn\'t have js equivalent',
1239
+ originalRegex: '(?<!:)(:)(?>[a-zA-Z_][\\w@]*(?>[?!]|=(?![>=]))?|\\<\\>|===?|!==?|<<>>|<<<|>>>|~~~|::|<\\-|\\|>|=>|~|~=|=|/|\\\\\\\\|\\*\\*?|\\.\\.?\\.?|>=?|<=?|&&?&?|\\+\\+?|\\-\\-?|\\|\\|?\\|?|\\!|@|\\%?\\{\\}|%|\\[\\]|\\^(\\^\\^)?)',
1240
+ comment: 'symbols' },
1241
+ { token: 'punctuation.definition.constant.elixir',
1242
+ regex: '(?:[a-zA-Z_][\\w@]*(?:[?!])?):(?!:)',
1243
+ TODO: 'FIXME: regexp doesn\'t have js equivalent',
1244
+ originalRegex: '(?>[a-zA-Z_][\\w@]*(?>[?!])?)(:)(?!:)',
1245
+ comment: 'symbols' },
1246
+ { token:
1247
+ [ 'punctuation.definition.comment.elixir',
1248
+ 'comment.line.number-sign.elixir' ],
1249
+ regex: '(#)(.*)' },
1250
+ { token: 'constant.numeric.elixir',
1251
+ regex: '\\?(?:\\\\(?:x[\\da-fA-F]{1,2}(?![\\da-fA-F])\\b|[^xMC])|[^\\s\\\\])',
1252
+ TODO: 'FIXME: regexp doesn\'t have js equivalent',
1253
+ originalRegex: '(?<!\\w)\\?(\\\\(x\\h{1,2}(?!\\h)\\b|[^xMC])|[^\\s\\\\])',
1254
+ comment: '\n\t\t\tmatches questionmark-letters.\n\n\t\t\texamples (1st alternation = hex):\n\t\t\t?\\x1 ?\\x61\n\n\t\t\texamples (2rd alternation = escaped):\n\t\t\t?\\n ?\\b\n\n\t\t\texamples (3rd alternation = normal):\n\t\t\t?a ?A ?0 \n\t\t\t?* ?" ?( \n\t\t\t?. ?#\n\t\t\t\n\t\t\tthe negative lookbehind prevents against matching\n\t\t\tp(42.tainted?)\n\t\t\t' },
1255
+ { token: 'keyword.operator.assignment.augmented.elixir',
1256
+ regex: '\\+=|\\-=|\\|\\|=|~=|&&=' },
1257
+ { token: 'keyword.operator.comparison.elixir',
1258
+ regex: '===?|!==?|<=?|>=?' },
1259
+ { token: 'keyword.operator.bitwise.elixir',
1260
+ regex: '\\|{3}|&{3}|\\^{3}|<{3}|>{3}|~{3}' },
1261
+ { token: 'keyword.operator.logical.elixir',
1262
+ regex: '!+|\\bnot\\b|&&|\\band\\b|\\|\\||\\bor\\b|\\bxor\\b',
1263
+ originalRegex: '(?<=[ \\t])!+|\\bnot\\b|&&|\\band\\b|\\|\\||\\bor\\b|\\bxor\\b' },
1264
+ { token: 'keyword.operator.arithmetic.elixir',
1265
+ regex: '\\*|\\+|\\-|/' },
1266
+ { token: 'keyword.operator.other.elixir',
1267
+ regex: '\\||\\+\\+|\\-\\-|\\*\\*|\\\\\\\\|\\<\\-|\\<\\>|\\<\\<|\\>\\>|\\:\\:|\\.\\.|\\|>|~|=>' },
1268
+ { token: 'keyword.operator.assignment.elixir', regex: '=' },
1269
+ { token: 'punctuation.separator.other.elixir', regex: ':' },
1270
+ { token: 'punctuation.separator.statement.elixir',
1271
+ regex: '\\;' },
1272
+ { token: 'punctuation.separator.object.elixir', regex: ',' },
1273
+ { token: 'punctuation.separator.method.elixir', regex: '\\.' },
1274
+ { token: 'punctuation.section.scope.elixir', regex: '\\{|\\}' },
1275
+ { token: 'punctuation.section.array.elixir', regex: '\\[|\\]' },
1276
+ { token: 'punctuation.section.function.elixir',
1277
+ regex: '\\(|\\)' } ],
1278
+ '#escaped_char':
1279
+ [ { token: 'constant.character.escape.elixir',
1280
+ regex: '\\\\(?:x[\\da-fA-F]{1,2}|.)' } ],
1281
+ '#interpolated_elixir':
1282
+ [ { token:
1283
+ [ 'source.elixir.embedded.source',
1284
+ 'source.elixir.embedded.source.empty' ],
1285
+ regex: '(#\\{)(\\})' },
1286
+ { todo:
1287
+ { token: 'punctuation.section.embedded.elixir',
1288
+ regex: '#\\{',
1289
+ push:
1290
+ [ { token: 'punctuation.section.embedded.elixir',
1291
+ regex: '\\}',
1292
+ next: 'pop' },
1293
+ { include: '#nest_curly_and_self' },
1294
+ { include: '$self' },
1295
+ { defaultToken: 'source.elixir.embedded.source' } ] } } ],
1296
+ '#nest_curly_and_self':
1297
+ [ { token: 'punctuation.section.scope.elixir',
1298
+ regex: '\\{',
1299
+ push:
1300
+ [ { token: 'punctuation.section.scope.elixir',
1301
+ regex: '\\}',
1302
+ next: 'pop' },
1303
+ { include: '#nest_curly_and_self' } ] },
1304
+ { include: '$self' } ],
1305
+ '#regex_sub':
1306
+ [ { include: '#interpolated_elixir' },
1307
+ { include: '#escaped_char' },
1308
+ { token:
1309
+ [ 'punctuation.definition.arbitrary-repitition.elixir',
1310
+ 'string.regexp.arbitrary-repitition.elixir',
1311
+ 'string.regexp.arbitrary-repitition.elixir',
1312
+ 'punctuation.definition.arbitrary-repitition.elixir' ],
1313
+ regex: '(\\{)(\\d+)((?:,\\d+)?)(\\})' },
1314
+ { token: 'punctuation.definition.character-class.elixir',
1315
+ regex: '\\[(?:\\^?\\])?',
1316
+ push:
1317
+ [ { token: 'punctuation.definition.character-class.elixir',
1318
+ regex: '\\]',
1319
+ next: 'pop' },
1320
+ { include: '#escaped_char' },
1321
+ { defaultToken: 'string.regexp.character-class.elixir' } ] },
1322
+ { token: 'punctuation.definition.group.elixir',
1323
+ regex: '\\(',
1324
+ push:
1325
+ [ { token: 'punctuation.definition.group.elixir',
1326
+ regex: '\\)',
1327
+ next: 'pop' },
1328
+ { include: '#regex_sub' },
1329
+ { defaultToken: 'string.regexp.group.elixir' } ] },
1330
+ { token:
1331
+ [ 'punctuation.definition.comment.elixir',
1332
+ 'comment.line.number-sign.elixir' ],
1333
+ regex: '(?:^|\\s)(#)(\\s[[a-zA-Z0-9,. \\t?!-][^\\x00-\\x7F]]*$)',
1334
+ originalRegex: '(?<=^|\\s)(#)\\s[[a-zA-Z0-9,. \\t?!-][^\\x{00}-\\x{7F}]]*$',
1335
+ comment: 'We are restrictive in what we allow to go after the comment character to avoid false positives, since the availability of comments depend on regexp flags.' } ] }
1336
+
1337
+ this.normalizeRules();
1338
+ };
1339
+
1340
+ ElixirHighlightRules.metaData = { comment: 'Textmate bundle for Elixir Programming Language.',
1341
+ fileTypes: [ 'ex', 'exs' ],
1342
+ firstLineMatch: '^#!/.*\\belixir',
1343
+ foldingStartMarker: '(after|else|catch|rescue|\\-\\>|\\{|\\[|do)\\s*$',
1344
+ foldingStopMarker: '^\\s*((\\}|\\]|after|else|catch|rescue)\\s*$|end\\b)',
1345
+ keyEquivalent: '^~E',
1346
+ name: 'Elixir',
1347
+ scopeName: 'source.elixir' }
1348
+
1349
+
1350
+ oop.inherits(ElixirHighlightRules, TextHighlightRules);
1351
+
1352
+ exports.ElixirHighlightRules = ElixirHighlightRules;
1353
+ });
1354
+
1355
+ define("ace/mode/html_elixir_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/html_highlight_rules","ace/mode/elixir_highlight_rules"], function(require, exports, module) {
1356
+ "use strict";
1357
+
1358
+ var oop = require("../lib/oop");
1359
+ var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
1360
+ var ElixirHighlightRules = require("./elixir_highlight_rules").ElixirHighlightRules;
1361
+
1362
+ var HtmlElixirHighlightRules = function() {
1363
+ HtmlHighlightRules.call(this);
1364
+
1365
+ var startRules = [
1366
+ {
1367
+ regex: "<%%|%%>",
1368
+ token: "constant.language.escape"
1369
+ }, {
1370
+ token : "comment.start.eex",
1371
+ regex : "<%#",
1372
+ push : [{
1373
+ token : "comment.end.eex",
1374
+ regex: "%>",
1375
+ next: "pop",
1376
+ defaultToken:"comment"
1377
+ }]
1378
+ }, {
1379
+ token : "support.elixir_tag",
1380
+ regex : "<%+(?!>)[-=]?",
1381
+ push : "elixir-start"
1382
+ }
1383
+ ];
1384
+
1385
+ var endRules = [
1386
+ {
1387
+ token : "support.elixir_tag",
1388
+ regex : "%>",
1389
+ next : "pop"
1390
+ }, {
1391
+ token: "comment",
1392
+ regex: "#(?:[^%]|%[^>])*"
1393
+ }
1394
+ ];
1395
+
1396
+ for (var key in this.$rules)
1397
+ this.$rules[key].unshift.apply(this.$rules[key], startRules);
1398
+
1399
+ this.embedRules(ElixirHighlightRules, "elixir-", endRules, ["start"]);
1400
+
1401
+ this.normalizeRules();
1402
+ };
1403
+
1404
+
1405
+ oop.inherits(HtmlElixirHighlightRules, HtmlHighlightRules);
1406
+
1407
+ exports.HtmlElixirHighlightRules = HtmlElixirHighlightRules;
1408
+ });
1409
+
1410
+ define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) {
1411
+ "use strict";
1412
+
1413
+ var Range = require("../range").Range;
1414
+
1415
+ var MatchingBraceOutdent = function() {};
1416
+
1417
+ (function() {
1418
+
1419
+ this.checkOutdent = function(line, input) {
1420
+ if (! /^\s+$/.test(line))
1421
+ return false;
1422
+
1423
+ return /^\s*\}/.test(input);
1424
+ };
1425
+
1426
+ this.autoOutdent = function(doc, row) {
1427
+ var line = doc.getLine(row);
1428
+ var match = line.match(/^(\s*\})/);
1429
+
1430
+ if (!match) return 0;
1431
+
1432
+ var column = match[1].length;
1433
+ var openBracePos = doc.findMatchingBracket({row: row, column: column});
1434
+
1435
+ if (!openBracePos || openBracePos.row == row) return 0;
1436
+
1437
+ var indent = this.$getIndent(doc.getLine(openBracePos.row));
1438
+ doc.replace(new Range(row, 0, row, column-1), indent);
1439
+ };
1440
+
1441
+ this.$getIndent = function(line) {
1442
+ return line.match(/^\s*/)[0];
1443
+ };
1444
+
1445
+ }).call(MatchingBraceOutdent.prototype);
1446
+
1447
+ exports.MatchingBraceOutdent = MatchingBraceOutdent;
1448
+ });
1449
+
1450
+ define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) {
1451
+ "use strict";
1452
+
1453
+ var oop = require("../../lib/oop");
1454
+ var Behaviour = require("../behaviour").Behaviour;
1455
+ var TokenIterator = require("../../token_iterator").TokenIterator;
1456
+ var lang = require("../../lib/lang");
1457
+
1458
+ var SAFE_INSERT_IN_TOKENS =
1459
+ ["text", "paren.rparen", "punctuation.operator"];
1460
+ var SAFE_INSERT_BEFORE_TOKENS =
1461
+ ["text", "paren.rparen", "punctuation.operator", "comment"];
1462
+
1463
+ var context;
1464
+ var contextCache = {};
1465
+ var initContext = function(editor) {
1466
+ var id = -1;
1467
+ if (editor.multiSelect) {
1468
+ id = editor.selection.index;
1469
+ if (contextCache.rangeCount != editor.multiSelect.rangeCount)
1470
+ contextCache = {rangeCount: editor.multiSelect.rangeCount};
1471
+ }
1472
+ if (contextCache[id])
1473
+ return context = contextCache[id];
1474
+ context = contextCache[id] = {
1475
+ autoInsertedBrackets: 0,
1476
+ autoInsertedRow: -1,
1477
+ autoInsertedLineEnd: "",
1478
+ maybeInsertedBrackets: 0,
1479
+ maybeInsertedRow: -1,
1480
+ maybeInsertedLineStart: "",
1481
+ maybeInsertedLineEnd: ""
1482
+ };
1483
+ };
1484
+
1485
+ var getWrapped = function(selection, selected, opening, closing) {
1486
+ var rowDiff = selection.end.row - selection.start.row;
1487
+ return {
1488
+ text: opening + selected + closing,
1489
+ selection: [
1490
+ 0,
1491
+ selection.start.column + 1,
1492
+ rowDiff,
1493
+ selection.end.column + (rowDiff ? 0 : 1)
1494
+ ]
1495
+ };
1496
+ };
1497
+
1498
+ var CstyleBehaviour = function() {
1499
+ this.add("braces", "insertion", function(state, action, editor, session, text) {
1500
+ var cursor = editor.getCursorPosition();
1501
+ var line = session.doc.getLine(cursor.row);
1502
+ if (text == '{') {
1503
+ initContext(editor);
1504
+ var selection = editor.getSelectionRange();
1505
+ var selected = session.doc.getTextRange(selection);
1506
+ if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) {
1507
+ return getWrapped(selection, selected, '{', '}');
1508
+ } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
1509
+ if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) {
1510
+ CstyleBehaviour.recordAutoInsert(editor, session, "}");
1511
+ return {
1512
+ text: '{}',
1513
+ selection: [1, 1]
1514
+ };
1515
+ } else {
1516
+ CstyleBehaviour.recordMaybeInsert(editor, session, "{");
1517
+ return {
1518
+ text: '{',
1519
+ selection: [1, 1]
1520
+ };
1521
+ }
1522
+ }
1523
+ } else if (text == '}') {
1524
+ initContext(editor);
1525
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
1526
+ if (rightChar == '}') {
1527
+ var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
1528
+ if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
1529
+ CstyleBehaviour.popAutoInsertedClosing();
1530
+ return {
1531
+ text: '',
1532
+ selection: [1, 1]
1533
+ };
1534
+ }
1535
+ }
1536
+ } else if (text == "\n" || text == "\r\n") {
1537
+ initContext(editor);
1538
+ var closing = "";
1539
+ if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) {
1540
+ closing = lang.stringRepeat("}", context.maybeInsertedBrackets);
1541
+ CstyleBehaviour.clearMaybeInsertedClosing();
1542
+ }
1543
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
1544
+ if (rightChar === '}') {
1545
+ var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}');
1546
+ if (!openBracePos)
1547
+ return null;
1548
+ var next_indent = this.$getIndent(session.getLine(openBracePos.row));
1549
+ } else if (closing) {
1550
+ var next_indent = this.$getIndent(line);
1551
+ } else {
1552
+ CstyleBehaviour.clearMaybeInsertedClosing();
1553
+ return;
1554
+ }
1555
+ var indent = next_indent + session.getTabString();
1556
+
1557
+ return {
1558
+ text: '\n' + indent + '\n' + next_indent + closing,
1559
+ selection: [1, indent.length, 1, indent.length]
1560
+ };
1561
+ } else {
1562
+ CstyleBehaviour.clearMaybeInsertedClosing();
1563
+ }
1564
+ });
1565
+
1566
+ this.add("braces", "deletion", function(state, action, editor, session, range) {
1567
+ var selected = session.doc.getTextRange(range);
1568
+ if (!range.isMultiLine() && selected == '{') {
1569
+ initContext(editor);
1570
+ var line = session.doc.getLine(range.start.row);
1571
+ var rightChar = line.substring(range.end.column, range.end.column + 1);
1572
+ if (rightChar == '}') {
1573
+ range.end.column++;
1574
+ return range;
1575
+ } else {
1576
+ context.maybeInsertedBrackets--;
1577
+ }
1578
+ }
1579
+ });
1580
+
1581
+ this.add("parens", "insertion", function(state, action, editor, session, text) {
1582
+ if (text == '(') {
1583
+ initContext(editor);
1584
+ var selection = editor.getSelectionRange();
1585
+ var selected = session.doc.getTextRange(selection);
1586
+ if (selected !== "" && editor.getWrapBehavioursEnabled()) {
1587
+ return getWrapped(selection, selected, '(', ')');
1588
+ } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
1589
+ CstyleBehaviour.recordAutoInsert(editor, session, ")");
1590
+ return {
1591
+ text: '()',
1592
+ selection: [1, 1]
1593
+ };
1594
+ }
1595
+ } else if (text == ')') {
1596
+ initContext(editor);
1597
+ var cursor = editor.getCursorPosition();
1598
+ var line = session.doc.getLine(cursor.row);
1599
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
1600
+ if (rightChar == ')') {
1601
+ var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row});
1602
+ if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
1603
+ CstyleBehaviour.popAutoInsertedClosing();
1604
+ return {
1605
+ text: '',
1606
+ selection: [1, 1]
1607
+ };
1608
+ }
1609
+ }
1610
+ }
1611
+ });
1612
+
1613
+ this.add("parens", "deletion", function(state, action, editor, session, range) {
1614
+ var selected = session.doc.getTextRange(range);
1615
+ if (!range.isMultiLine() && selected == '(') {
1616
+ initContext(editor);
1617
+ var line = session.doc.getLine(range.start.row);
1618
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
1619
+ if (rightChar == ')') {
1620
+ range.end.column++;
1621
+ return range;
1622
+ }
1623
+ }
1624
+ });
1625
+
1626
+ this.add("brackets", "insertion", function(state, action, editor, session, text) {
1627
+ if (text == '[') {
1628
+ initContext(editor);
1629
+ var selection = editor.getSelectionRange();
1630
+ var selected = session.doc.getTextRange(selection);
1631
+ if (selected !== "" && editor.getWrapBehavioursEnabled()) {
1632
+ return getWrapped(selection, selected, '[', ']');
1633
+ } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
1634
+ CstyleBehaviour.recordAutoInsert(editor, session, "]");
1635
+ return {
1636
+ text: '[]',
1637
+ selection: [1, 1]
1638
+ };
1639
+ }
1640
+ } else if (text == ']') {
1641
+ initContext(editor);
1642
+ var cursor = editor.getCursorPosition();
1643
+ var line = session.doc.getLine(cursor.row);
1644
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
1645
+ if (rightChar == ']') {
1646
+ var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row});
1647
+ if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
1648
+ CstyleBehaviour.popAutoInsertedClosing();
1649
+ return {
1650
+ text: '',
1651
+ selection: [1, 1]
1652
+ };
1653
+ }
1654
+ }
1655
+ }
1656
+ });
1657
+
1658
+ this.add("brackets", "deletion", function(state, action, editor, session, range) {
1659
+ var selected = session.doc.getTextRange(range);
1660
+ if (!range.isMultiLine() && selected == '[') {
1661
+ initContext(editor);
1662
+ var line = session.doc.getLine(range.start.row);
1663
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
1664
+ if (rightChar == ']') {
1665
+ range.end.column++;
1666
+ return range;
1667
+ }
1668
+ }
1669
+ });
1670
+
1671
+ this.add("string_dquotes", "insertion", function(state, action, editor, session, text) {
1672
+ if (text == '"' || text == "'") {
1673
+ initContext(editor);
1674
+ var quote = text;
1675
+ var selection = editor.getSelectionRange();
1676
+ var selected = session.doc.getTextRange(selection);
1677
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
1678
+ return getWrapped(selection, selected, quote, quote);
1679
+ } else if (!selected) {
1680
+ var cursor = editor.getCursorPosition();
1681
+ var line = session.doc.getLine(cursor.row);
1682
+ var leftChar = line.substring(cursor.column-1, cursor.column);
1683
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
1684
+
1685
+ var token = session.getTokenAt(cursor.row, cursor.column);
1686
+ var rightToken = session.getTokenAt(cursor.row, cursor.column + 1);
1687
+ if (leftChar == "\\" && token && /escape/.test(token.type))
1688
+ return null;
1689
+
1690
+ var stringBefore = token && /string|escape/.test(token.type);
1691
+ var stringAfter = !rightToken || /string|escape/.test(rightToken.type);
1692
+
1693
+ var pair;
1694
+ if (rightChar == quote) {
1695
+ pair = stringBefore !== stringAfter;
1696
+ } else {
1697
+ if (stringBefore && !stringAfter)
1698
+ return null; // wrap string with different quote
1699
+ if (stringBefore && stringAfter)
1700
+ return null; // do not pair quotes inside strings
1701
+ var wordRe = session.$mode.tokenRe;
1702
+ wordRe.lastIndex = 0;
1703
+ var isWordBefore = wordRe.test(leftChar);
1704
+ wordRe.lastIndex = 0;
1705
+ var isWordAfter = wordRe.test(leftChar);
1706
+ if (isWordBefore || isWordAfter)
1707
+ return null; // before or after alphanumeric
1708
+ if (rightChar && !/[\s;,.})\]\\]/.test(rightChar))
1709
+ return null; // there is rightChar and it isn't closing
1710
+ pair = true;
1711
+ }
1712
+ return {
1713
+ text: pair ? quote + quote : "",
1714
+ selection: [1,1]
1715
+ };
1716
+ }
1717
+ }
1718
+ });
1719
+
1720
+ this.add("string_dquotes", "deletion", function(state, action, editor, session, range) {
1721
+ var selected = session.doc.getTextRange(range);
1722
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
1723
+ initContext(editor);
1724
+ var line = session.doc.getLine(range.start.row);
1725
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
1726
+ if (rightChar == selected) {
1727
+ range.end.column++;
1728
+ return range;
1729
+ }
1730
+ }
1731
+ });
1732
+
1733
+ };
1734
+
1735
+
1736
+ CstyleBehaviour.isSaneInsertion = function(editor, session) {
1737
+ var cursor = editor.getCursorPosition();
1738
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
1739
+ if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) {
1740
+ var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1);
1741
+ if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS))
1742
+ return false;
1743
+ }
1744
+ iterator.stepForward();
1745
+ return iterator.getCurrentTokenRow() !== cursor.row ||
1746
+ this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS);
1747
+ };
1748
+
1749
+ CstyleBehaviour.$matchTokenType = function(token, types) {
1750
+ return types.indexOf(token.type || token) > -1;
1751
+ };
1752
+
1753
+ CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) {
1754
+ var cursor = editor.getCursorPosition();
1755
+ var line = session.doc.getLine(cursor.row);
1756
+ if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0]))
1757
+ context.autoInsertedBrackets = 0;
1758
+ context.autoInsertedRow = cursor.row;
1759
+ context.autoInsertedLineEnd = bracket + line.substr(cursor.column);
1760
+ context.autoInsertedBrackets++;
1761
+ };
1762
+
1763
+ CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) {
1764
+ var cursor = editor.getCursorPosition();
1765
+ var line = session.doc.getLine(cursor.row);
1766
+ if (!this.isMaybeInsertedClosing(cursor, line))
1767
+ context.maybeInsertedBrackets = 0;
1768
+ context.maybeInsertedRow = cursor.row;
1769
+ context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket;
1770
+ context.maybeInsertedLineEnd = line.substr(cursor.column);
1771
+ context.maybeInsertedBrackets++;
1772
+ };
1773
+
1774
+ CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) {
1775
+ return context.autoInsertedBrackets > 0 &&
1776
+ cursor.row === context.autoInsertedRow &&
1777
+ bracket === context.autoInsertedLineEnd[0] &&
1778
+ line.substr(cursor.column) === context.autoInsertedLineEnd;
1779
+ };
1780
+
1781
+ CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) {
1782
+ return context.maybeInsertedBrackets > 0 &&
1783
+ cursor.row === context.maybeInsertedRow &&
1784
+ line.substr(cursor.column) === context.maybeInsertedLineEnd &&
1785
+ line.substr(0, cursor.column) == context.maybeInsertedLineStart;
1786
+ };
1787
+
1788
+ CstyleBehaviour.popAutoInsertedClosing = function() {
1789
+ context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1);
1790
+ context.autoInsertedBrackets--;
1791
+ };
1792
+
1793
+ CstyleBehaviour.clearMaybeInsertedClosing = function() {
1794
+ if (context) {
1795
+ context.maybeInsertedBrackets = 0;
1796
+ context.maybeInsertedRow = -1;
1797
+ }
1798
+ };
1799
+
1800
+
1801
+
1802
+ oop.inherits(CstyleBehaviour, Behaviour);
1803
+
1804
+ exports.CstyleBehaviour = CstyleBehaviour;
1805
+ });
1806
+
1807
+ define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {
1808
+ "use strict";
1809
+
1810
+ var oop = require("../../lib/oop");
1811
+ var Range = require("../../range").Range;
1812
+ var BaseFoldMode = require("./fold_mode").FoldMode;
1813
+
1814
+ var FoldMode = exports.FoldMode = function(commentRegex) {
1815
+ if (commentRegex) {
1816
+ this.foldingStartMarker = new RegExp(
1817
+ this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
1818
+ );
1819
+ this.foldingStopMarker = new RegExp(
1820
+ this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
1821
+ );
1822
+ }
1823
+ };
1824
+ oop.inherits(FoldMode, BaseFoldMode);
1825
+
1826
+ (function() {
1827
+
1828
+ this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
1829
+ this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
1830
+ this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;
1831
+ this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
1832
+ this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
1833
+ this._getFoldWidgetBase = this.getFoldWidget;
1834
+ this.getFoldWidget = function(session, foldStyle, row) {
1835
+ var line = session.getLine(row);
1836
+
1837
+ if (this.singleLineBlockCommentRe.test(line)) {
1838
+ if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
1839
+ return "";
1840
+ }
1841
+
1842
+ var fw = this._getFoldWidgetBase(session, foldStyle, row);
1843
+
1844
+ if (!fw && this.startRegionRe.test(line))
1845
+ return "start"; // lineCommentRegionStart
1846
+
1847
+ return fw;
1848
+ };
1849
+
1850
+ this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
1851
+ var line = session.getLine(row);
1852
+
1853
+ if (this.startRegionRe.test(line))
1854
+ return this.getCommentRegionBlock(session, line, row);
1855
+
1856
+ var match = line.match(this.foldingStartMarker);
1857
+ if (match) {
1858
+ var i = match.index;
1859
+
1860
+ if (match[1])
1861
+ return this.openingBracketBlock(session, match[1], row, i);
1862
+
1863
+ var range = session.getCommentFoldRange(row, i + match[0].length, 1);
1864
+
1865
+ if (range && !range.isMultiLine()) {
1866
+ if (forceMultiline) {
1867
+ range = this.getSectionRange(session, row);
1868
+ } else if (foldStyle != "all")
1869
+ range = null;
1870
+ }
1871
+
1872
+ return range;
1873
+ }
1874
+
1875
+ if (foldStyle === "markbegin")
1876
+ return;
1877
+
1878
+ var match = line.match(this.foldingStopMarker);
1879
+ if (match) {
1880
+ var i = match.index + match[0].length;
1881
+
1882
+ if (match[1])
1883
+ return this.closingBracketBlock(session, match[1], row, i);
1884
+
1885
+ return session.getCommentFoldRange(row, i, -1);
1886
+ }
1887
+ };
1888
+
1889
+ this.getSectionRange = function(session, row) {
1890
+ var line = session.getLine(row);
1891
+ var startIndent = line.search(/\S/);
1892
+ var startRow = row;
1893
+ var startColumn = line.length;
1894
+ row = row + 1;
1895
+ var endRow = row;
1896
+ var maxRow = session.getLength();
1897
+ while (++row < maxRow) {
1898
+ line = session.getLine(row);
1899
+ var indent = line.search(/\S/);
1900
+ if (indent === -1)
1901
+ continue;
1902
+ if (startIndent > indent)
1903
+ break;
1904
+ var subRange = this.getFoldWidgetRange(session, "all", row);
1905
+
1906
+ if (subRange) {
1907
+ if (subRange.start.row <= startRow) {
1908
+ break;
1909
+ } else if (subRange.isMultiLine()) {
1910
+ row = subRange.end.row;
1911
+ } else if (startIndent == indent) {
1912
+ break;
1913
+ }
1914
+ }
1915
+ endRow = row;
1916
+ }
1917
+
1918
+ return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
1919
+ };
1920
+ this.getCommentRegionBlock = function(session, line, row) {
1921
+ var startColumn = line.search(/\s*$/);
1922
+ var maxRow = session.getLength();
1923
+ var startRow = row;
1924
+
1925
+ var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
1926
+ var depth = 1;
1927
+ while (++row < maxRow) {
1928
+ line = session.getLine(row);
1929
+ var m = re.exec(line);
1930
+ if (!m) continue;
1931
+ if (m[1]) depth--;
1932
+ else depth++;
1933
+
1934
+ if (!depth) break;
1935
+ }
1936
+
1937
+ var endRow = row;
1938
+ if (endRow > startRow) {
1939
+ return new Range(startRow, startColumn, endRow, line.length);
1940
+ }
1941
+ };
1942
+
1943
+ }).call(FoldMode.prototype);
1944
+
1945
+ });
1946
+
1947
+ 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) {
1948
+ "use strict";
1949
+
1950
+ var oop = require("../lib/oop");
1951
+ var TextMode = require("./text").Mode;
1952
+ var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
1953
+ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
1954
+ var Range = require("../range").Range;
1955
+ var WorkerClient = require("../worker/worker_client").WorkerClient;
1956
+ var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
1957
+ var CStyleFoldMode = require("./folding/cstyle").FoldMode;
1958
+
1959
+ var Mode = function() {
1960
+ this.HighlightRules = JavaScriptHighlightRules;
1961
+
1962
+ this.$outdent = new MatchingBraceOutdent();
1963
+ this.$behaviour = new CstyleBehaviour();
1964
+ this.foldingRules = new CStyleFoldMode();
1965
+ };
1966
+ oop.inherits(Mode, TextMode);
1967
+
1968
+ (function() {
1969
+
1970
+ this.lineCommentStart = "//";
1971
+ this.blockComment = {start: "/*", end: "*/"};
1972
+
1973
+ this.getNextLineIndent = function(state, line, tab) {
1974
+ var indent = this.$getIndent(line);
1975
+
1976
+ var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
1977
+ var tokens = tokenizedLine.tokens;
1978
+ var endState = tokenizedLine.state;
1979
+
1980
+ if (tokens.length && tokens[tokens.length-1].type == "comment") {
1981
+ return indent;
1982
+ }
1983
+
1984
+ if (state == "start" || state == "no_regex") {
1985
+ var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);
1986
+ if (match) {
1987
+ indent += tab;
1988
+ }
1989
+ } else if (state == "doc-start") {
1990
+ if (endState == "start" || endState == "no_regex") {
1991
+ return "";
1992
+ }
1993
+ var match = line.match(/^\s*(\/?)\*/);
1994
+ if (match) {
1995
+ if (match[1]) {
1996
+ indent += " ";
1997
+ }
1998
+ indent += "* ";
1999
+ }
2000
+ }
2001
+
2002
+ return indent;
2003
+ };
2004
+
2005
+ this.checkOutdent = function(state, line, input) {
2006
+ return this.$outdent.checkOutdent(line, input);
2007
+ };
2008
+
2009
+ this.autoOutdent = function(state, doc, row) {
2010
+ this.$outdent.autoOutdent(doc, row);
2011
+ };
2012
+
2013
+ this.createWorker = function(session) {
2014
+ var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker");
2015
+ worker.attachToDocument(session.getDocument());
2016
+
2017
+ worker.on("annotate", function(results) {
2018
+ session.setAnnotations(results.data);
2019
+ });
2020
+
2021
+ worker.on("terminate", function() {
2022
+ session.clearAnnotations();
2023
+ });
2024
+
2025
+ return worker;
2026
+ };
2027
+
2028
+ this.$id = "ace/mode/javascript";
2029
+ }).call(Mode.prototype);
2030
+
2031
+ exports.Mode = Mode;
2032
+ });
2033
+
2034
+ define("ace/mode/css_completions",["require","exports","module"], function(require, exports, module) {
2035
+ "use strict";
2036
+
2037
+ var propertyMap = {
2038
+ "background": {"#$0": 1},
2039
+ "background-color": {"#$0": 1, "transparent": 1, "fixed": 1},
2040
+ "background-image": {"url('/$0')": 1},
2041
+ "background-repeat": {"repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1},
2042
+ "background-position": {"bottom":2, "center":2, "left":2, "right":2, "top":2, "inherit":2,},
2043
+ "background-attachment": {"scroll": 1, "fixed": 1},
2044
+ "background-size": {"cover": 1, "contain": 1},
2045
+ "background-clip": {"border-box": 1, "padding-box": 1, "content-box": 1},
2046
+ "background-origin": {"border-box": 1, "padding-box": 1, "content-box": 1},
2047
+ "border": {"solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1},
2048
+ "border-color": {"#$0": 1},
2049
+ "border-style": {"solid":2, "dashed":2, "dotted":2, "double":2, "groove":2, "hidden":2, "inherit":2, "inset":2, "none":2, "outset":2, "ridged":2,},
2050
+ "border-collapse": {"collapse": 1, "separate": 1},
2051
+ "bottom": {"px": 1, "em": 1, "%": 1},
2052
+ "clear": {"left": 1, "right": 1, "both": 1, "none": 1},
2053
+ "color": {"#$0": 1, "rgb(#$00,0,0)": 1},
2054
+ "cursor": {"default": 1, "pointer": 1, "move": 1, "text": 1, "wait": 1, "help": 1, "progress": 1, "n-resize": 1, "ne-resize": 1, "e-resize": 1, "se-resize": 1, "s-resize": 1, "sw-resize": 1, "w-resize": 1, "nw-resize": 1},
2055
+ "display": {"none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1},
2056
+ "empty-cells": {"show": 1, "hide": 1},
2057
+ "float": {"left": 1, "right": 1, "none": 1},
2058
+ "font-family": {"Arial":2,"Comic Sans MS":2,"Consolas":2,"Courier New":2,"Courier":2,"Georgia":2,"Monospace":2,"Sans-Serif":2, "Segoe UI":2,"Tahoma":2,"Times New Roman":2,"Trebuchet MS":2,"Verdana": 1},
2059
+ "font-size": {"px": 1, "em": 1, "%": 1},
2060
+ "font-weight": {"bold": 1, "normal": 1},
2061
+ "font-style": {"italic": 1, "normal": 1},
2062
+ "font-variant": {"normal": 1, "small-caps": 1},
2063
+ "height": {"px": 1, "em": 1, "%": 1},
2064
+ "left": {"px": 1, "em": 1, "%": 1},
2065
+ "letter-spacing": {"normal": 1},
2066
+ "line-height": {"normal": 1},
2067
+ "list-style-type": {"none": 1, "disc": 1, "circle": 1, "square": 1, "decimal": 1, "decimal-leading-zero": 1, "lower-roman": 1, "upper-roman": 1, "lower-greek": 1, "lower-latin": 1, "upper-latin": 1, "georgian": 1, "lower-alpha": 1, "upper-alpha": 1},
2068
+ "margin": {"px": 1, "em": 1, "%": 1},
2069
+ "margin-right": {"px": 1, "em": 1, "%": 1},
2070
+ "margin-left": {"px": 1, "em": 1, "%": 1},
2071
+ "margin-top": {"px": 1, "em": 1, "%": 1},
2072
+ "margin-bottom": {"px": 1, "em": 1, "%": 1},
2073
+ "max-height": {"px": 1, "em": 1, "%": 1},
2074
+ "max-width": {"px": 1, "em": 1, "%": 1},
2075
+ "min-height": {"px": 1, "em": 1, "%": 1},
2076
+ "min-width": {"px": 1, "em": 1, "%": 1},
2077
+ "overflow": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1},
2078
+ "overflow-x": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1},
2079
+ "overflow-y": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1},
2080
+ "padding": {"px": 1, "em": 1, "%": 1},
2081
+ "padding-top": {"px": 1, "em": 1, "%": 1},
2082
+ "padding-right": {"px": 1, "em": 1, "%": 1},
2083
+ "padding-bottom": {"px": 1, "em": 1, "%": 1},
2084
+ "padding-left": {"px": 1, "em": 1, "%": 1},
2085
+ "page-break-after": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1},
2086
+ "page-break-before": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1},
2087
+ "position": {"absolute": 1, "relative": 1, "fixed": 1, "static": 1},
2088
+ "right": {"px": 1, "em": 1, "%": 1},
2089
+ "table-layout": {"fixed": 1, "auto": 1},
2090
+ "text-decoration": {"none": 1, "underline": 1, "line-through": 1, "blink": 1},
2091
+ "text-align": {"left": 1, "right": 1, "center": 1, "justify": 1},
2092
+ "text-transform": {"capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1},
2093
+ "top": {"px": 1, "em": 1, "%": 1},
2094
+ "vertical-align": {"top": 1, "bottom": 1},
2095
+ "visibility": {"hidden": 1, "visible": 1},
2096
+ "white-space": {"nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1},
2097
+ "width": {"px": 1, "em": 1, "%": 1},
2098
+ "word-spacing": {"normal": 1},
2099
+ "filter": {"alpha(opacity=$0100)": 1},
2100
+
2101
+ "text-shadow": {"$02px 2px 2px #777": 1},
2102
+ "text-overflow": {"ellipsis-word": 1, "clip": 1, "ellipsis": 1},
2103
+ "-moz-border-radius": 1,
2104
+ "-moz-border-radius-topright": 1,
2105
+ "-moz-border-radius-bottomright": 1,
2106
+ "-moz-border-radius-topleft": 1,
2107
+ "-moz-border-radius-bottomleft": 1,
2108
+ "-webkit-border-radius": 1,
2109
+ "-webkit-border-top-right-radius": 1,
2110
+ "-webkit-border-top-left-radius": 1,
2111
+ "-webkit-border-bottom-right-radius": 1,
2112
+ "-webkit-border-bottom-left-radius": 1,
2113
+ "-moz-box-shadow": 1,
2114
+ "-webkit-box-shadow": 1,
2115
+ "transform": {"rotate($00deg)": 1, "skew($00deg)": 1},
2116
+ "-moz-transform": {"rotate($00deg)": 1, "skew($00deg)": 1},
2117
+ "-webkit-transform": {"rotate($00deg)": 1, "skew($00deg)": 1 }
2118
+ };
2119
+
2120
+ var CssCompletions = function() {
2121
+
2122
+ };
2123
+
2124
+ (function() {
2125
+
2126
+ this.completionsDefined = false;
2127
+
2128
+ this.defineCompletions = function() {
2129
+ if (document) {
2130
+ var style = document.createElement('c').style;
2131
+
2132
+ for (var i in style) {
2133
+ if (typeof style[i] !== 'string')
2134
+ continue;
2135
+
2136
+ var name = i.replace(/[A-Z]/g, function(x) {
2137
+ return '-' + x.toLowerCase();
2138
+ });
2139
+
2140
+ if (!propertyMap.hasOwnProperty(name))
2141
+ propertyMap[name] = 1;
2142
+ }
2143
+ }
2144
+
2145
+ this.completionsDefined = true;
2146
+ }
2147
+
2148
+ this.getCompletions = function(state, session, pos, prefix) {
2149
+ if (!this.completionsDefined) {
2150
+ this.defineCompletions();
2151
+ }
2152
+
2153
+ var token = session.getTokenAt(pos.row, pos.column);
2154
+
2155
+ if (!token)
2156
+ return [];
2157
+ if (state==='ruleset'){
2158
+ var line = session.getLine(pos.row).substr(0, pos.column);
2159
+ if (/:[^;]+$/.test(line)) {
2160
+ /([\w\-]+):[^:]*$/.test(line);
2161
+
2162
+ return this.getPropertyValueCompletions(state, session, pos, prefix);
2163
+ } else {
2164
+ return this.getPropertyCompletions(state, session, pos, prefix);
2165
+ }
2166
+ }
2167
+
2168
+ return [];
2169
+ };
2170
+
2171
+ this.getPropertyCompletions = function(state, session, pos, prefix) {
2172
+ var properties = Object.keys(propertyMap);
2173
+ return properties.map(function(property){
2174
+ return {
2175
+ caption: property,
2176
+ snippet: property + ': $0',
2177
+ meta: "property",
2178
+ score: Number.MAX_VALUE
2179
+ };
2180
+ });
2181
+ };
2182
+
2183
+ this.getPropertyValueCompletions = function(state, session, pos, prefix) {
2184
+ var line = session.getLine(pos.row).substr(0, pos.column);
2185
+ var property = (/([\w\-]+):[^:]*$/.exec(line) || {})[1];
2186
+
2187
+ if (!property)
2188
+ return [];
2189
+ var values = [];
2190
+ if (property in propertyMap && typeof propertyMap[property] === "object") {
2191
+ values = Object.keys(propertyMap[property]);
2192
+ }
2193
+ return values.map(function(value){
2194
+ return {
2195
+ caption: value,
2196
+ snippet: value,
2197
+ meta: "property value",
2198
+ score: Number.MAX_VALUE
2199
+ };
2200
+ });
2201
+ };
2202
+
2203
+ }).call(CssCompletions.prototype);
2204
+
2205
+ exports.CssCompletions = CssCompletions;
2206
+ });
2207
+
2208
+ 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) {
2209
+ "use strict";
2210
+
2211
+ var oop = require("../../lib/oop");
2212
+ var Behaviour = require("../behaviour").Behaviour;
2213
+ var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
2214
+ var TokenIterator = require("../../token_iterator").TokenIterator;
2215
+
2216
+ var CssBehaviour = function () {
2217
+
2218
+ this.inherit(CstyleBehaviour);
2219
+
2220
+ this.add("colon", "insertion", function (state, action, editor, session, text) {
2221
+ if (text === ':') {
2222
+ var cursor = editor.getCursorPosition();
2223
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
2224
+ var token = iterator.getCurrentToken();
2225
+ if (token && token.value.match(/\s+/)) {
2226
+ token = iterator.stepBackward();
2227
+ }
2228
+ if (token && token.type === 'support.type') {
2229
+ var line = session.doc.getLine(cursor.row);
2230
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
2231
+ if (rightChar === ':') {
2232
+ return {
2233
+ text: '',
2234
+ selection: [1, 1]
2235
+ }
2236
+ }
2237
+ if (!line.substring(cursor.column).match(/^\s*;/)) {
2238
+ return {
2239
+ text: ':;',
2240
+ selection: [1, 1]
2241
+ }
2242
+ }
2243
+ }
2244
+ }
2245
+ });
2246
+
2247
+ this.add("colon", "deletion", function (state, action, editor, session, range) {
2248
+ var selected = session.doc.getTextRange(range);
2249
+ if (!range.isMultiLine() && selected === ':') {
2250
+ var cursor = editor.getCursorPosition();
2251
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
2252
+ var token = iterator.getCurrentToken();
2253
+ if (token && token.value.match(/\s+/)) {
2254
+ token = iterator.stepBackward();
2255
+ }
2256
+ if (token && token.type === 'support.type') {
2257
+ var line = session.doc.getLine(range.start.row);
2258
+ var rightChar = line.substring(range.end.column, range.end.column + 1);
2259
+ if (rightChar === ';') {
2260
+ range.end.column ++;
2261
+ return range;
2262
+ }
2263
+ }
2264
+ }
2265
+ });
2266
+
2267
+ this.add("semicolon", "insertion", function (state, action, editor, session, text) {
2268
+ if (text === ';') {
2269
+ var cursor = editor.getCursorPosition();
2270
+ var line = session.doc.getLine(cursor.row);
2271
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
2272
+ if (rightChar === ';') {
2273
+ return {
2274
+ text: '',
2275
+ selection: [1, 1]
2276
+ }
2277
+ }
2278
+ }
2279
+ });
2280
+
2281
+ }
2282
+ oop.inherits(CssBehaviour, CstyleBehaviour);
2283
+
2284
+ exports.CssBehaviour = CssBehaviour;
2285
+ });
2286
+
2287
+ 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/css_completions","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module) {
2288
+ "use strict";
2289
+
2290
+ var oop = require("../lib/oop");
2291
+ var TextMode = require("./text").Mode;
2292
+ var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
2293
+ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
2294
+ var WorkerClient = require("../worker/worker_client").WorkerClient;
2295
+ var CssCompletions = require("./css_completions").CssCompletions;
2296
+ var CssBehaviour = require("./behaviour/css").CssBehaviour;
2297
+ var CStyleFoldMode = require("./folding/cstyle").FoldMode;
2298
+
2299
+ var Mode = function() {
2300
+ this.HighlightRules = CssHighlightRules;
2301
+ this.$outdent = new MatchingBraceOutdent();
2302
+ this.$behaviour = new CssBehaviour();
2303
+ this.$completer = new CssCompletions();
2304
+ this.foldingRules = new CStyleFoldMode();
2305
+ };
2306
+ oop.inherits(Mode, TextMode);
2307
+
2308
+ (function() {
2309
+
2310
+ this.foldingRules = "cStyle";
2311
+ this.blockComment = {start: "/*", end: "*/"};
2312
+
2313
+ this.getNextLineIndent = function(state, line, tab) {
2314
+ var indent = this.$getIndent(line);
2315
+ var tokens = this.getTokenizer().getLineTokens(line, state).tokens;
2316
+ if (tokens.length && tokens[tokens.length-1].type == "comment") {
2317
+ return indent;
2318
+ }
2319
+
2320
+ var match = line.match(/^.*\{\s*$/);
2321
+ if (match) {
2322
+ indent += tab;
2323
+ }
2324
+
2325
+ return indent;
2326
+ };
2327
+
2328
+ this.checkOutdent = function(state, line, input) {
2329
+ return this.$outdent.checkOutdent(line, input);
2330
+ };
2331
+
2332
+ this.autoOutdent = function(state, doc, row) {
2333
+ this.$outdent.autoOutdent(doc, row);
2334
+ };
2335
+
2336
+ this.getCompletions = function(state, session, pos, prefix) {
2337
+ return this.$completer.getCompletions(state, session, pos, prefix);
2338
+ };
2339
+
2340
+ this.createWorker = function(session) {
2341
+ var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker");
2342
+ worker.attachToDocument(session.getDocument());
2343
+
2344
+ worker.on("annotate", function(e) {
2345
+ session.setAnnotations(e.data);
2346
+ });
2347
+
2348
+ worker.on("terminate", function() {
2349
+ session.clearAnnotations();
2350
+ });
2351
+
2352
+ return worker;
2353
+ };
2354
+
2355
+ this.$id = "ace/mode/css";
2356
+ }).call(Mode.prototype);
2357
+
2358
+ exports.Mode = Mode;
2359
+
2360
+ });
2361
+
2362
+ define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) {
2363
+ "use strict";
2364
+
2365
+ var oop = require("../../lib/oop");
2366
+ var Behaviour = require("../behaviour").Behaviour;
2367
+ var TokenIterator = require("../../token_iterator").TokenIterator;
2368
+ var lang = require("../../lib/lang");
2369
+
2370
+ function is(token, type) {
2371
+ return token.type.lastIndexOf(type + ".xml") > -1;
2372
+ }
2373
+
2374
+ var XmlBehaviour = function () {
2375
+
2376
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
2377
+ if (text == '"' || text == "'") {
2378
+ var quote = text;
2379
+ var selected = session.doc.getTextRange(editor.getSelectionRange());
2380
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
2381
+ return {
2382
+ text: quote + selected + quote,
2383
+ selection: false
2384
+ };
2385
+ }
2386
+
2387
+ var cursor = editor.getCursorPosition();
2388
+ var line = session.doc.getLine(cursor.row);
2389
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
2390
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
2391
+ var token = iterator.getCurrentToken();
2392
+
2393
+ if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
2394
+ return {
2395
+ text: "",
2396
+ selection: [1, 1]
2397
+ };
2398
+ }
2399
+
2400
+ if (!token)
2401
+ token = iterator.stepBackward();
2402
+
2403
+ if (!token)
2404
+ return;
2405
+
2406
+ while (is(token, "tag-whitespace") || is(token, "whitespace")) {
2407
+ token = iterator.stepBackward();
2408
+ }
2409
+ var rightSpace = !rightChar || rightChar.match(/\s/);
2410
+ if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
2411
+ return {
2412
+ text: quote + quote,
2413
+ selection: [1, 1]
2414
+ };
2415
+ }
2416
+ }
2417
+ });
2418
+
2419
+ this.add("string_dquotes", "deletion", function(state, action, editor, session, range) {
2420
+ var selected = session.doc.getTextRange(range);
2421
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
2422
+ var line = session.doc.getLine(range.start.row);
2423
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
2424
+ if (rightChar == selected) {
2425
+ range.end.column++;
2426
+ return range;
2427
+ }
2428
+ }
2429
+ });
2430
+
2431
+ this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
2432
+ if (text == '>') {
2433
+ var position = editor.getCursorPosition();
2434
+ var iterator = new TokenIterator(session, position.row, position.column);
2435
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
2436
+ if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
2437
+ return;
2438
+ if (is(token, "reference.attribute-value"))
2439
+ return;
2440
+ if (is(token, "attribute-value")) {
2441
+ var firstChar = token.value.charAt(0);
2442
+ if (firstChar == '"' || firstChar == "'") {
2443
+ var lastChar = token.value.charAt(token.value.length - 1);
2444
+ var tokenEnd = iterator.getCurrentTokenColumn() + token.value.length;
2445
+ if (tokenEnd > position.column || tokenEnd == position.column && firstChar != lastChar)
2446
+ return;
2447
+ }
2448
+ }
2449
+ while (!is(token, "tag-name")) {
2450
+ token = iterator.stepBackward();
2451
+ }
2452
+
2453
+ var tokenRow = iterator.getCurrentTokenRow();
2454
+ var tokenColumn = iterator.getCurrentTokenColumn();
2455
+ if (is(iterator.stepBackward(), "end-tag-open"))
2456
+ return;
2457
+
2458
+ var element = token.value;
2459
+ if (tokenRow == position.row)
2460
+ element = element.substring(0, position.column - tokenColumn);
2461
+
2462
+ if (this.voidElements.hasOwnProperty(element.toLowerCase()))
2463
+ return;
2464
+
2465
+ return {
2466
+ text: ">" + "</" + element + ">",
2467
+ selection: [1, 1]
2468
+ };
2469
+ }
2470
+ });
2471
+
2472
+ this.add("autoindent", "insertion", function (state, action, editor, session, text) {
2473
+ if (text == "\n") {
2474
+ var cursor = editor.getCursorPosition();
2475
+ var line = session.getLine(cursor.row);
2476
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
2477
+ var token = iterator.getCurrentToken();
2478
+
2479
+ if (token && token.type.indexOf("tag-close") !== -1) {
2480
+ if (token.value == "/>")
2481
+ return;
2482
+ while (token && token.type.indexOf("tag-name") === -1) {
2483
+ token = iterator.stepBackward();
2484
+ }
2485
+
2486
+ if (!token) {
2487
+ return;
2488
+ }
2489
+
2490
+ var tag = token.value;
2491
+ var row = iterator.getCurrentTokenRow();
2492
+ token = iterator.stepBackward();
2493
+ if (!token || token.type.indexOf("end-tag") !== -1) {
2494
+ return;
2495
+ }
2496
+
2497
+ if (this.voidElements && !this.voidElements[tag]) {
2498
+ var nextToken = session.getTokenAt(cursor.row, cursor.column+1);
2499
+ var line = session.getLine(row);
2500
+ var nextIndent = this.$getIndent(line);
2501
+ var indent = nextIndent + session.getTabString();
2502
+
2503
+ if (nextToken && nextToken.value === "</") {
2504
+ return {
2505
+ text: "\n" + indent + "\n" + nextIndent,
2506
+ selection: [1, indent.length, 1, indent.length]
2507
+ };
2508
+ } else {
2509
+ return {
2510
+ text: "\n" + indent
2511
+ };
2512
+ }
2513
+ }
2514
+ }
2515
+ }
2516
+ });
2517
+
2518
+ };
2519
+
2520
+ oop.inherits(XmlBehaviour, Behaviour);
2521
+
2522
+ exports.XmlBehaviour = XmlBehaviour;
2523
+ });
2524
+
2525
+ define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module) {
2526
+ "use strict";
2527
+
2528
+ var oop = require("../../lib/oop");
2529
+ var BaseFoldMode = require("./fold_mode").FoldMode;
2530
+
2531
+ var FoldMode = exports.FoldMode = function(defaultMode, subModes) {
2532
+ this.defaultMode = defaultMode;
2533
+ this.subModes = subModes;
2534
+ };
2535
+ oop.inherits(FoldMode, BaseFoldMode);
2536
+
2537
+ (function() {
2538
+
2539
+
2540
+ this.$getMode = function(state) {
2541
+ if (typeof state != "string")
2542
+ state = state[0];
2543
+ for (var key in this.subModes) {
2544
+ if (state.indexOf(key) === 0)
2545
+ return this.subModes[key];
2546
+ }
2547
+ return null;
2548
+ };
2549
+
2550
+ this.$tryMode = function(state, session, foldStyle, row) {
2551
+ var mode = this.$getMode(state);
2552
+ return (mode ? mode.getFoldWidget(session, foldStyle, row) : "");
2553
+ };
2554
+
2555
+ this.getFoldWidget = function(session, foldStyle, row) {
2556
+ return (
2557
+ this.$tryMode(session.getState(row-1), session, foldStyle, row) ||
2558
+ this.$tryMode(session.getState(row), session, foldStyle, row) ||
2559
+ this.defaultMode.getFoldWidget(session, foldStyle, row)
2560
+ );
2561
+ };
2562
+
2563
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
2564
+ var mode = this.$getMode(session.getState(row-1));
2565
+
2566
+ if (!mode || !mode.getFoldWidget(session, foldStyle, row))
2567
+ mode = this.$getMode(session.getState(row));
2568
+
2569
+ if (!mode || !mode.getFoldWidget(session, foldStyle, row))
2570
+ mode = this.defaultMode;
2571
+
2572
+ return mode.getFoldWidgetRange(session, foldStyle, row);
2573
+ };
2574
+
2575
+ }).call(FoldMode.prototype);
2576
+
2577
+ });
2578
+
2579
+ 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) {
2580
+ "use strict";
2581
+
2582
+ var oop = require("../../lib/oop");
2583
+ var lang = require("../../lib/lang");
2584
+ var Range = require("../../range").Range;
2585
+ var BaseFoldMode = require("./fold_mode").FoldMode;
2586
+ var TokenIterator = require("../../token_iterator").TokenIterator;
2587
+
2588
+ var FoldMode = exports.FoldMode = function(voidElements, optionalEndTags) {
2589
+ BaseFoldMode.call(this);
2590
+ this.voidElements = voidElements || {};
2591
+ this.optionalEndTags = oop.mixin({}, this.voidElements);
2592
+ if (optionalEndTags)
2593
+ oop.mixin(this.optionalEndTags, optionalEndTags);
2594
+
2595
+ };
2596
+ oop.inherits(FoldMode, BaseFoldMode);
2597
+
2598
+ var Tag = function() {
2599
+ this.tagName = "";
2600
+ this.closing = false;
2601
+ this.selfClosing = false;
2602
+ this.start = {row: 0, column: 0};
2603
+ this.end = {row: 0, column: 0};
2604
+ };
2605
+
2606
+ function is(token, type) {
2607
+ return token.type.lastIndexOf(type + ".xml") > -1;
2608
+ }
2609
+
2610
+ (function() {
2611
+
2612
+ this.getFoldWidget = function(session, foldStyle, row) {
2613
+ var tag = this._getFirstTagInLine(session, row);
2614
+
2615
+ if (!tag)
2616
+ return "";
2617
+
2618
+ if (tag.closing || (!tag.tagName && tag.selfClosing))
2619
+ return foldStyle == "markbeginend" ? "end" : "";
2620
+
2621
+ if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
2622
+ return "";
2623
+
2624
+ if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
2625
+ return "";
2626
+
2627
+ return "start";
2628
+ };
2629
+ this._getFirstTagInLine = function(session, row) {
2630
+ var tokens = session.getTokens(row);
2631
+ var tag = new Tag();
2632
+
2633
+ for (var i = 0; i < tokens.length; i++) {
2634
+ var token = tokens[i];
2635
+ if (is(token, "tag-open")) {
2636
+ tag.end.column = tag.start.column + token.value.length;
2637
+ tag.closing = is(token, "end-tag-open");
2638
+ token = tokens[++i];
2639
+ if (!token)
2640
+ return null;
2641
+ tag.tagName = token.value;
2642
+ tag.end.column += token.value.length;
2643
+ for (i++; i < tokens.length; i++) {
2644
+ token = tokens[i];
2645
+ tag.end.column += token.value.length;
2646
+ if (is(token, "tag-close")) {
2647
+ tag.selfClosing = token.value == '/>';
2648
+ break;
2649
+ }
2650
+ }
2651
+ return tag;
2652
+ } else if (is(token, "tag-close")) {
2653
+ tag.selfClosing = token.value == '/>';
2654
+ return tag;
2655
+ }
2656
+ tag.start.column += token.value.length;
2657
+ }
2658
+
2659
+ return null;
2660
+ };
2661
+
2662
+ this._findEndTagInLine = function(session, row, tagName, startColumn) {
2663
+ var tokens = session.getTokens(row);
2664
+ var column = 0;
2665
+ for (var i = 0; i < tokens.length; i++) {
2666
+ var token = tokens[i];
2667
+ column += token.value.length;
2668
+ if (column < startColumn)
2669
+ continue;
2670
+ if (is(token, "end-tag-open")) {
2671
+ token = tokens[i + 1];
2672
+ if (token && token.value == tagName)
2673
+ return true;
2674
+ }
2675
+ }
2676
+ return false;
2677
+ };
2678
+ this._readTagForward = function(iterator) {
2679
+ var token = iterator.getCurrentToken();
2680
+ if (!token)
2681
+ return null;
2682
+
2683
+ var tag = new Tag();
2684
+ do {
2685
+ if (is(token, "tag-open")) {
2686
+ tag.closing = is(token, "end-tag-open");
2687
+ tag.start.row = iterator.getCurrentTokenRow();
2688
+ tag.start.column = iterator.getCurrentTokenColumn();
2689
+ } else if (is(token, "tag-name")) {
2690
+ tag.tagName = token.value;
2691
+ } else if (is(token, "tag-close")) {
2692
+ tag.selfClosing = token.value == "/>";
2693
+ tag.end.row = iterator.getCurrentTokenRow();
2694
+ tag.end.column = iterator.getCurrentTokenColumn() + token.value.length;
2695
+ iterator.stepForward();
2696
+ return tag;
2697
+ }
2698
+ } while(token = iterator.stepForward());
2699
+
2700
+ return null;
2701
+ };
2702
+
2703
+ this._readTagBackward = function(iterator) {
2704
+ var token = iterator.getCurrentToken();
2705
+ if (!token)
2706
+ return null;
2707
+
2708
+ var tag = new Tag();
2709
+ do {
2710
+ if (is(token, "tag-open")) {
2711
+ tag.closing = is(token, "end-tag-open");
2712
+ tag.start.row = iterator.getCurrentTokenRow();
2713
+ tag.start.column = iterator.getCurrentTokenColumn();
2714
+ iterator.stepBackward();
2715
+ return tag;
2716
+ } else if (is(token, "tag-name")) {
2717
+ tag.tagName = token.value;
2718
+ } else if (is(token, "tag-close")) {
2719
+ tag.selfClosing = token.value == "/>";
2720
+ tag.end.row = iterator.getCurrentTokenRow();
2721
+ tag.end.column = iterator.getCurrentTokenColumn() + token.value.length;
2722
+ }
2723
+ } while(token = iterator.stepBackward());
2724
+
2725
+ return null;
2726
+ };
2727
+
2728
+ this._pop = function(stack, tag) {
2729
+ while (stack.length) {
2730
+
2731
+ var top = stack[stack.length-1];
2732
+ if (!tag || top.tagName == tag.tagName) {
2733
+ return stack.pop();
2734
+ }
2735
+ else if (this.optionalEndTags.hasOwnProperty(top.tagName)) {
2736
+ stack.pop();
2737
+ continue;
2738
+ } else {
2739
+ return null;
2740
+ }
2741
+ }
2742
+ };
2743
+
2744
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
2745
+ var firstTag = this._getFirstTagInLine(session, row);
2746
+
2747
+ if (!firstTag)
2748
+ return null;
2749
+
2750
+ var isBackward = firstTag.closing || firstTag.selfClosing;
2751
+ var stack = [];
2752
+ var tag;
2753
+
2754
+ if (!isBackward) {
2755
+ var iterator = new TokenIterator(session, row, firstTag.start.column);
2756
+ var start = {
2757
+ row: row,
2758
+ column: firstTag.start.column + firstTag.tagName.length + 2
2759
+ };
2760
+ if (firstTag.start.row == firstTag.end.row)
2761
+ start.column = firstTag.end.column;
2762
+ while (tag = this._readTagForward(iterator)) {
2763
+ if (tag.selfClosing) {
2764
+ if (!stack.length) {
2765
+ tag.start.column += tag.tagName.length + 2;
2766
+ tag.end.column -= 2;
2767
+ return Range.fromPoints(tag.start, tag.end);
2768
+ } else
2769
+ continue;
2770
+ }
2771
+
2772
+ if (tag.closing) {
2773
+ this._pop(stack, tag);
2774
+ if (stack.length == 0)
2775
+ return Range.fromPoints(start, tag.start);
2776
+ }
2777
+ else {
2778
+ stack.push(tag);
2779
+ }
2780
+ }
2781
+ }
2782
+ else {
2783
+ var iterator = new TokenIterator(session, row, firstTag.end.column);
2784
+ var end = {
2785
+ row: row,
2786
+ column: firstTag.start.column
2787
+ };
2788
+
2789
+ while (tag = this._readTagBackward(iterator)) {
2790
+ if (tag.selfClosing) {
2791
+ if (!stack.length) {
2792
+ tag.start.column += tag.tagName.length + 2;
2793
+ tag.end.column -= 2;
2794
+ return Range.fromPoints(tag.start, tag.end);
2795
+ } else
2796
+ continue;
2797
+ }
2798
+
2799
+ if (!tag.closing) {
2800
+ this._pop(stack, tag);
2801
+ if (stack.length == 0) {
2802
+ tag.start.column += tag.tagName.length + 2;
2803
+ if (tag.start.row == tag.end.row && tag.start.column < tag.end.column)
2804
+ tag.start.column = tag.end.column;
2805
+ return Range.fromPoints(tag.start, end);
2806
+ }
2807
+ }
2808
+ else {
2809
+ stack.push(tag);
2810
+ }
2811
+ }
2812
+ }
2813
+
2814
+ };
2815
+
2816
+ }).call(FoldMode.prototype);
2817
+
2818
+ });
2819
+
2820
+ 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) {
2821
+ "use strict";
2822
+
2823
+ var oop = require("../../lib/oop");
2824
+ var MixedFoldMode = require("./mixed").FoldMode;
2825
+ var XmlFoldMode = require("./xml").FoldMode;
2826
+ var CStyleFoldMode = require("./cstyle").FoldMode;
2827
+
2828
+ var FoldMode = exports.FoldMode = function(voidElements, optionalTags) {
2829
+ MixedFoldMode.call(this, new XmlFoldMode(voidElements, optionalTags), {
2830
+ "js-": new CStyleFoldMode(),
2831
+ "css-": new CStyleFoldMode()
2832
+ });
2833
+ };
2834
+
2835
+ oop.inherits(FoldMode, MixedFoldMode);
2836
+
2837
+ });
2838
+
2839
+ define("ace/mode/html_completions",["require","exports","module","ace/token_iterator"], function(require, exports, module) {
2840
+ "use strict";
2841
+
2842
+ var TokenIterator = require("../token_iterator").TokenIterator;
2843
+
2844
+ var commonAttributes = [
2845
+ "accesskey",
2846
+ "class",
2847
+ "contenteditable",
2848
+ "contextmenu",
2849
+ "dir",
2850
+ "draggable",
2851
+ "dropzone",
2852
+ "hidden",
2853
+ "id",
2854
+ "inert",
2855
+ "itemid",
2856
+ "itemprop",
2857
+ "itemref",
2858
+ "itemscope",
2859
+ "itemtype",
2860
+ "lang",
2861
+ "spellcheck",
2862
+ "style",
2863
+ "tabindex",
2864
+ "title",
2865
+ "translate"
2866
+ ];
2867
+
2868
+ var eventAttributes = [
2869
+ "onabort",
2870
+ "onblur",
2871
+ "oncancel",
2872
+ "oncanplay",
2873
+ "oncanplaythrough",
2874
+ "onchange",
2875
+ "onclick",
2876
+ "onclose",
2877
+ "oncontextmenu",
2878
+ "oncuechange",
2879
+ "ondblclick",
2880
+ "ondrag",
2881
+ "ondragend",
2882
+ "ondragenter",
2883
+ "ondragleave",
2884
+ "ondragover",
2885
+ "ondragstart",
2886
+ "ondrop",
2887
+ "ondurationchange",
2888
+ "onemptied",
2889
+ "onended",
2890
+ "onerror",
2891
+ "onfocus",
2892
+ "oninput",
2893
+ "oninvalid",
2894
+ "onkeydown",
2895
+ "onkeypress",
2896
+ "onkeyup",
2897
+ "onload",
2898
+ "onloadeddata",
2899
+ "onloadedmetadata",
2900
+ "onloadstart",
2901
+ "onmousedown",
2902
+ "onmousemove",
2903
+ "onmouseout",
2904
+ "onmouseover",
2905
+ "onmouseup",
2906
+ "onmousewheel",
2907
+ "onpause",
2908
+ "onplay",
2909
+ "onplaying",
2910
+ "onprogress",
2911
+ "onratechange",
2912
+ "onreset",
2913
+ "onscroll",
2914
+ "onseeked",
2915
+ "onseeking",
2916
+ "onselect",
2917
+ "onshow",
2918
+ "onstalled",
2919
+ "onsubmit",
2920
+ "onsuspend",
2921
+ "ontimeupdate",
2922
+ "onvolumechange",
2923
+ "onwaiting"
2924
+ ];
2925
+
2926
+ var globalAttributes = commonAttributes.concat(eventAttributes);
2927
+
2928
+ var attributeMap = {
2929
+ "html": {"manifest": 1},
2930
+ "head": {},
2931
+ "title": {},
2932
+ "base": {"href": 1, "target": 1},
2933
+ "link": {"href": 1, "hreflang": 1, "rel": {"stylesheet": 1, "icon": 1}, "media": {"all": 1, "screen": 1, "print": 1}, "type": {"text/css": 1, "image/png": 1, "image/jpeg": 1, "image/gif": 1}, "sizes": 1},
2934
+ "meta": {"http-equiv": {"content-type": 1}, "name": {"description": 1, "keywords": 1}, "content": {"text/html; charset=UTF-8": 1}, "charset": 1},
2935
+ "style": {"type": 1, "media": {"all": 1, "screen": 1, "print": 1}, "scoped": 1},
2936
+ "script": {"charset": 1, "type": {"text/javascript": 1}, "src": 1, "defer": 1, "async": 1},
2937
+ "noscript": {"href": 1},
2938
+ "body": {"onafterprint": 1, "onbeforeprint": 1, "onbeforeunload": 1, "onhashchange": 1, "onmessage": 1, "onoffline": 1, "onpopstate": 1, "onredo": 1, "onresize": 1, "onstorage": 1, "onundo": 1, "onunload": 1},
2939
+ "section": {},
2940
+ "nav": {},
2941
+ "article": {"pubdate": 1},
2942
+ "aside": {},
2943
+ "h1": {},
2944
+ "h2": {},
2945
+ "h3": {},
2946
+ "h4": {},
2947
+ "h5": {},
2948
+ "h6": {},
2949
+ "header": {},
2950
+ "footer": {},
2951
+ "address": {},
2952
+ "main": {},
2953
+ "p": {},
2954
+ "hr": {},
2955
+ "pre": {},
2956
+ "blockquote": {"cite": 1},
2957
+ "ol": {"start": 1, "reversed": 1},
2958
+ "ul": {},
2959
+ "li": {"value": 1},
2960
+ "dl": {},
2961
+ "dt": {},
2962
+ "dd": {},
2963
+ "figure": {},
2964
+ "figcaption": {},
2965
+ "div": {},
2966
+ "a": {"href": 1, "target": {"_blank": 1, "top": 1}, "ping": 1, "rel": {"nofollow": 1, "alternate": 1, "author": 1, "bookmark": 1, "help": 1, "license": 1, "next": 1, "noreferrer": 1, "prefetch": 1, "prev": 1, "search": 1, "tag": 1}, "media": 1, "hreflang": 1, "type": 1},
2967
+ "em": {},
2968
+ "strong": {},
2969
+ "small": {},
2970
+ "s": {},
2971
+ "cite": {},
2972
+ "q": {"cite": 1},
2973
+ "dfn": {},
2974
+ "abbr": {},
2975
+ "data": {},
2976
+ "time": {"datetime": 1},
2977
+ "code": {},
2978
+ "var": {},
2979
+ "samp": {},
2980
+ "kbd": {},
2981
+ "sub": {},
2982
+ "sup": {},
2983
+ "i": {},
2984
+ "b": {},
2985
+ "u": {},
2986
+ "mark": {},
2987
+ "ruby": {},
2988
+ "rt": {},
2989
+ "rp": {},
2990
+ "bdi": {},
2991
+ "bdo": {},
2992
+ "span": {},
2993
+ "br": {},
2994
+ "wbr": {},
2995
+ "ins": {"cite": 1, "datetime": 1},
2996
+ "del": {"cite": 1, "datetime": 1},
2997
+ "img": {"alt": 1, "src": 1, "height": 1, "width": 1, "usemap": 1, "ismap": 1},
2998
+ "iframe": {"name": 1, "src": 1, "height": 1, "width": 1, "sandbox": {"allow-same-origin": 1, "allow-top-navigation": 1, "allow-forms": 1, "allow-scripts": 1}, "seamless": {"seamless": 1}},
2999
+ "embed": {"src": 1, "height": 1, "width": 1, "type": 1},
3000
+ "object": {"param": 1, "data": 1, "type": 1, "height" : 1, "width": 1, "usemap": 1, "name": 1, "form": 1, "classid": 1},
3001
+ "param": {"name": 1, "value": 1},
3002
+ "video": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "width": 1, "height": 1, "poster": 1, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1}},
3003
+ "audio": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1 }},
3004
+ "source": {"src": 1, "type": 1, "media": 1},
3005
+ "track": {"kind": 1, "src": 1, "srclang": 1, "label": 1, "default": 1},
3006
+ "canvas": {"width": 1, "height": 1},
3007
+ "map": {"name": 1},
3008
+ "area": {"shape": 1, "coords": 1, "href": 1, "hreflang": 1, "alt": 1, "target": 1, "media": 1, "rel": 1, "ping": 1, "type": 1},
3009
+ "svg": {},
3010
+ "math": {},
3011
+ "table": {"summary": 1},
3012
+ "caption": {},
3013
+ "colgroup": {"span": 1},
3014
+ "col": {"span": 1},
3015
+ "tbody": {},
3016
+ "thead": {},
3017
+ "tfoot": {},
3018
+ "tr": {},
3019
+ "td": {"headers": 1, "rowspan": 1, "colspan": 1},
3020
+ "th": {"headers": 1, "rowspan": 1, "colspan": 1, "scope": 1},
3021
+ "form": {"accept-charset": 1, "action": 1, "autocomplete": 1, "enctype": {"multipart/form-data": 1, "application/x-www-form-urlencoded": 1}, "method": {"get": 1, "post": 1}, "name": 1, "novalidate": 1, "target": {"_blank": 1, "top": 1}},
3022
+ "fieldset": {"disabled": 1, "form": 1, "name": 1},
3023
+ "legend": {},
3024
+ "label": {"form": 1, "for": 1},
3025
+ "input": {
3026
+ "type": {"text": 1, "password": 1, "hidden": 1, "checkbox": 1, "submit": 1, "radio": 1, "file": 1, "button": 1, "reset": 1, "image": 31, "color": 1, "date": 1, "datetime": 1, "datetime-local": 1, "email": 1, "month": 1, "number": 1, "range": 1, "search": 1, "tel": 1, "time": 1, "url": 1, "week": 1},
3027
+ "accept": 1, "alt": 1, "autocomplete": {"on": 1, "off": 1}, "autofocus": {"autofocus": 1}, "checked": {"checked": 1}, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": {"application/x-www-form-urlencoded": 1, "multipart/form-data": 1, "text/plain": 1}, "formmethod": {"get": 1, "post": 1}, "formnovalidate": {"formnovalidate": 1}, "formtarget": {"_blank": 1, "_self": 1, "_parent": 1, "_top": 1}, "height": 1, "list": 1, "max": 1, "maxlength": 1, "min": 1, "multiple": {"multiple": 1}, "pattern": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "size": 1, "src": 1, "step": 1, "width": 1, "files": 1, "value": 1},
3028
+ "button": {"autofocus": 1, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": 1, "formmethod": 1, "formnovalidate": 1, "formtarget": 1, "name": 1, "value": 1, "type": {"button": 1, "submit": 1}},
3029
+ "select": {"autofocus": 1, "disabled": 1, "form": 1, "multiple": {"multiple": 1}, "name": 1, "size": 1, "readonly":{"readonly": 1}},
3030
+ "datalist": {},
3031
+ "optgroup": {"disabled": 1, "label": 1},
3032
+ "option": {"disabled": 1, "selected": 1, "label": 1, "value": 1},
3033
+ "textarea": {"autofocus": {"autofocus": 1}, "disabled": {"disabled": 1}, "form": 1, "maxlength": 1, "name": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "rows": 1, "cols": 1, "wrap": {"on": 1, "off": 1, "hard": 1, "soft": 1}},
3034
+ "keygen": {"autofocus": 1, "challenge": {"challenge": 1}, "disabled": {"disabled": 1}, "form": 1, "keytype": {"rsa": 1, "dsa": 1, "ec": 1}, "name": 1},
3035
+ "output": {"for": 1, "form": 1, "name": 1},
3036
+ "progress": {"value": 1, "max": 1},
3037
+ "meter": {"value": 1, "min": 1, "max": 1, "low": 1, "high": 1, "optimum": 1},
3038
+ "details": {"open": 1},
3039
+ "summary": {},
3040
+ "command": {"type": 1, "label": 1, "icon": 1, "disabled": 1, "checked": 1, "radiogroup": 1, "command": 1},
3041
+ "menu": {"type": 1, "label": 1},
3042
+ "dialog": {"open": 1}
3043
+ };
3044
+
3045
+ var elements = Object.keys(attributeMap);
3046
+
3047
+ function is(token, type) {
3048
+ return token.type.lastIndexOf(type + ".xml") > -1;
3049
+ }
3050
+
3051
+ function findTagName(session, pos) {
3052
+ var iterator = new TokenIterator(session, pos.row, pos.column);
3053
+ var token = iterator.getCurrentToken();
3054
+ while (token && !is(token, "tag-name")){
3055
+ token = iterator.stepBackward();
3056
+ }
3057
+ if (token)
3058
+ return token.value;
3059
+ }
3060
+
3061
+ function findAttributeName(session, pos) {
3062
+ var iterator = new TokenIterator(session, pos.row, pos.column);
3063
+ var token = iterator.getCurrentToken();
3064
+ while (token && !is(token, "attribute-name")){
3065
+ token = iterator.stepBackward();
3066
+ }
3067
+ if (token)
3068
+ return token.value;
3069
+ }
3070
+
3071
+ var HtmlCompletions = function() {
3072
+
3073
+ };
3074
+
3075
+ (function() {
3076
+
3077
+ this.getCompletions = function(state, session, pos, prefix) {
3078
+ var token = session.getTokenAt(pos.row, pos.column);
3079
+
3080
+ if (!token)
3081
+ return [];
3082
+ if (is(token, "tag-name") || is(token, "tag-open") || is(token, "end-tag-open"))
3083
+ return this.getTagCompletions(state, session, pos, prefix);
3084
+ if (is(token, "tag-whitespace") || is(token, "attribute-name"))
3085
+ return this.getAttributeCompletions(state, session, pos, prefix);
3086
+ if (is(token, "attribute-value"))
3087
+ return this.getAttributeValueCompletions(state, session, pos, prefix);
3088
+ var line = session.getLine(pos.row).substr(0, pos.column);
3089
+ if (/&[A-z]*$/i.test(line))
3090
+ return this.getHTMLEntityCompletions(state, session, pos, prefix);
3091
+
3092
+ return [];
3093
+ };
3094
+
3095
+ this.getTagCompletions = function(state, session, pos, prefix) {
3096
+ return elements.map(function(element){
3097
+ return {
3098
+ value: element,
3099
+ meta: "tag",
3100
+ score: Number.MAX_VALUE
3101
+ };
3102
+ });
3103
+ };
3104
+
3105
+ this.getAttributeCompletions = function(state, session, pos, prefix) {
3106
+ var tagName = findTagName(session, pos);
3107
+ if (!tagName)
3108
+ return [];
3109
+ var attributes = globalAttributes;
3110
+ if (tagName in attributeMap) {
3111
+ attributes = attributes.concat(Object.keys(attributeMap[tagName]));
3112
+ }
3113
+ return attributes.map(function(attribute){
3114
+ return {
3115
+ caption: attribute,
3116
+ snippet: attribute + '="$0"',
3117
+ meta: "attribute",
3118
+ score: Number.MAX_VALUE
3119
+ };
3120
+ });
3121
+ };
3122
+
3123
+ this.getAttributeValueCompletions = function(state, session, pos, prefix) {
3124
+ var tagName = findTagName(session, pos);
3125
+ var attributeName = findAttributeName(session, pos);
3126
+
3127
+ if (!tagName)
3128
+ return [];
3129
+ var values = [];
3130
+ if (tagName in attributeMap && attributeName in attributeMap[tagName] && typeof attributeMap[tagName][attributeName] === "object") {
3131
+ values = Object.keys(attributeMap[tagName][attributeName]);
3132
+ }
3133
+ return values.map(function(value){
3134
+ return {
3135
+ caption: value,
3136
+ snippet: value,
3137
+ meta: "attribute value",
3138
+ score: Number.MAX_VALUE
3139
+ };
3140
+ });
3141
+ };
3142
+
3143
+ this.getHTMLEntityCompletions = function(state, session, pos, prefix) {
3144
+ var values = ['&Aacute;', '&aacute;', '&Acirc;', '&acirc;', '&acute;', '&AElig;', '&aelig;', '&Agrave;', '&agrave;', '&alefsym;', '&Alpha;', '&alpha;', '&amp;', '&and;', '&ang;', '&Aring;', '&aring;', '&asymp;', '&Atilde;', '&atilde;', '&Auml;', '&auml;', '&bdquo;', '&Beta;', '&beta;', '&brvbar;', '&bull;', '&cap;', '&Ccedil;', '&ccedil;', '&cedil;', '&cent;', '&Chi;', '&chi;', '&circ;', '&clubs;', '&cong;', '&copy;', '&crarr;', '&cup;', '&curren;', '&Dagger;', '&dagger;', '&dArr;', '&darr;', '&deg;', '&Delta;', '&delta;', '&diams;', '&divide;', '&Eacute;', '&eacute;', '&Ecirc;', '&ecirc;', '&Egrave;', '&egrave;', '&empty;', '&emsp;', '&ensp;', '&Epsilon;', '&epsilon;', '&equiv;', '&Eta;', '&eta;', '&ETH;', '&eth;', '&Euml;', '&euml;', '&euro;', '&exist;', '&fnof;', '&forall;', '&frac12;', '&frac14;', '&frac34;', '&frasl;', '&Gamma;', '&gamma;', '&ge;', '&gt;', '&hArr;', '&harr;', '&hearts;', '&hellip;', '&Iacute;', '&iacute;', '&Icirc;', '&icirc;', '&iexcl;', '&Igrave;', '&igrave;', '&image;', '&infin;', '&int;', '&Iota;', '&iota;', '&iquest;', '&isin;', '&Iuml;', '&iuml;', '&Kappa;', '&kappa;', '&Lambda;', '&lambda;', '&lang;', '&laquo;', '&lArr;', '&larr;', '&lceil;', '&ldquo;', '&le;', '&lfloor;', '&lowast;', '&loz;', '&lrm;', '&lsaquo;', '&lsquo;', '&lt;', '&macr;', '&mdash;', '&micro;', '&middot;', '&minus;', '&Mu;', '&mu;', '&nabla;', '&nbsp;', '&ndash;', '&ne;', '&ni;', '&not;', '&notin;', '&nsub;', '&Ntilde;', '&ntilde;', '&Nu;', '&nu;', '&Oacute;', '&oacute;', '&Ocirc;', '&ocirc;', '&OElig;', '&oelig;', '&Ograve;', '&ograve;', '&oline;', '&Omega;', '&omega;', '&Omicron;', '&omicron;', '&oplus;', '&or;', '&ordf;', '&ordm;', '&Oslash;', '&oslash;', '&Otilde;', '&otilde;', '&otimes;', '&Ouml;', '&ouml;', '&para;', '&part;', '&permil;', '&perp;', '&Phi;', '&phi;', '&Pi;', '&pi;', '&piv;', '&plusmn;', '&pound;', '&Prime;', '&prime;', '&prod;', '&prop;', '&Psi;', '&psi;', '&quot;', '&radic;', '&rang;', '&raquo;', '&rArr;', '&rarr;', '&rceil;', '&rdquo;', '&real;', '&reg;', '&rfloor;', '&Rho;', '&rho;', '&rlm;', '&rsaquo;', '&rsquo;', '&sbquo;', '&Scaron;', '&scaron;', '&sdot;', '&sect;', '&shy;', '&Sigma;', '&sigma;', '&sigmaf;', '&sim;', '&spades;', '&sub;', '&sube;', '&sum;', '&sup;', '&sup1;', '&sup2;', '&sup3;', '&supe;', '&szlig;', '&Tau;', '&tau;', '&there4;', '&Theta;', '&theta;', '&thetasym;', '&thinsp;', '&THORN;', '&thorn;', '&tilde;', '&times;', '&trade;', '&Uacute;', '&uacute;', '&uArr;', '&uarr;', '&Ucirc;', '&ucirc;', '&Ugrave;', '&ugrave;', '&uml;', '&upsih;', '&Upsilon;', '&upsilon;', '&Uuml;', '&uuml;', '&weierp;', '&Xi;', '&xi;', '&Yacute;', '&yacute;', '&yen;', '&Yuml;', '&yuml;', '&Zeta;', '&zeta;', '&zwj;', '&zwnj;'];
3145
+
3146
+ return values.map(function(value){
3147
+ return {
3148
+ caption: value,
3149
+ snippet: value.substr(1),
3150
+ meta: "html entity",
3151
+ score: Number.MAX_VALUE
3152
+ };
3153
+ });
3154
+ };
3155
+
3156
+ }).call(HtmlCompletions.prototype);
3157
+
3158
+ exports.HtmlCompletions = HtmlCompletions;
3159
+ });
3160
+
3161
+ 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) {
3162
+ "use strict";
3163
+
3164
+ var oop = require("../lib/oop");
3165
+ var lang = require("../lib/lang");
3166
+ var TextMode = require("./text").Mode;
3167
+ var JavaScriptMode = require("./javascript").Mode;
3168
+ var CssMode = require("./css").Mode;
3169
+ var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
3170
+ var XmlBehaviour = require("./behaviour/xml").XmlBehaviour;
3171
+ var HtmlFoldMode = require("./folding/html").FoldMode;
3172
+ var HtmlCompletions = require("./html_completions").HtmlCompletions;
3173
+ var WorkerClient = require("../worker/worker_client").WorkerClient;
3174
+ var voidElements = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "menuitem", "param", "source", "track", "wbr"];
3175
+ var optionalEndTags = ["li", "dt", "dd", "p", "rt", "rp", "optgroup", "option", "colgroup", "td", "th"];
3176
+
3177
+ var Mode = function(options) {
3178
+ this.fragmentContext = options && options.fragmentContext;
3179
+ this.HighlightRules = HtmlHighlightRules;
3180
+ this.$behaviour = new XmlBehaviour();
3181
+ this.$completer = new HtmlCompletions();
3182
+
3183
+ this.createModeDelegates({
3184
+ "js-": JavaScriptMode,
3185
+ "css-": CssMode
3186
+ });
3187
+
3188
+ this.foldingRules = new HtmlFoldMode(this.voidElements, lang.arrayToMap(optionalEndTags));
3189
+ };
3190
+ oop.inherits(Mode, TextMode);
3191
+
3192
+ (function() {
3193
+
3194
+ this.blockComment = {start: "<!--", end: "-->"};
3195
+
3196
+ this.voidElements = lang.arrayToMap(voidElements);
3197
+
3198
+ this.getNextLineIndent = function(state, line, tab) {
3199
+ return this.$getIndent(line);
3200
+ };
3201
+
3202
+ this.checkOutdent = function(state, line, input) {
3203
+ return false;
3204
+ };
3205
+
3206
+ this.getCompletions = function(state, session, pos, prefix) {
3207
+ return this.$completer.getCompletions(state, session, pos, prefix);
3208
+ };
3209
+
3210
+ this.createWorker = function(session) {
3211
+ if (this.constructor != Mode)
3212
+ return;
3213
+ var worker = new WorkerClient(["ace"], "ace/mode/html_worker", "Worker");
3214
+ worker.attachToDocument(session.getDocument());
3215
+
3216
+ if (this.fragmentContext)
3217
+ worker.call("setOptions", [{context: this.fragmentContext}]);
3218
+
3219
+ worker.on("error", function(e) {
3220
+ session.setAnnotations(e.data);
3221
+ });
3222
+
3223
+ worker.on("terminate", function() {
3224
+ session.clearAnnotations();
3225
+ });
3226
+
3227
+ return worker;
3228
+ };
3229
+
3230
+ this.$id = "ace/mode/html";
3231
+ }).call(Mode.prototype);
3232
+
3233
+ exports.Mode = Mode;
3234
+ });
3235
+
3236
+ define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module) {
3237
+ "use strict";
3238
+
3239
+ var oop = require("../../lib/oop");
3240
+ var BaseFoldMode = require("./fold_mode").FoldMode;
3241
+ var Range = require("../../range").Range;
3242
+
3243
+ var FoldMode = exports.FoldMode = function() {};
3244
+ oop.inherits(FoldMode, BaseFoldMode);
3245
+
3246
+ (function() {
3247
+
3248
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
3249
+ var range = this.indentationBlock(session, row);
3250
+ if (range)
3251
+ return range;
3252
+
3253
+ var re = /\S/;
3254
+ var line = session.getLine(row);
3255
+ var startLevel = line.search(re);
3256
+ if (startLevel == -1 || line[startLevel] != "#")
3257
+ return;
3258
+
3259
+ var startColumn = line.length;
3260
+ var maxRow = session.getLength();
3261
+ var startRow = row;
3262
+ var endRow = row;
3263
+
3264
+ while (++row < maxRow) {
3265
+ line = session.getLine(row);
3266
+ var level = line.search(re);
3267
+
3268
+ if (level == -1)
3269
+ continue;
3270
+
3271
+ if (line[level] != "#")
3272
+ break;
3273
+
3274
+ endRow = row;
3275
+ }
3276
+
3277
+ if (endRow > startRow) {
3278
+ var endColumn = session.getLine(endRow).length;
3279
+ return new Range(startRow, startColumn, endRow, endColumn);
3280
+ }
3281
+ };
3282
+ this.getFoldWidget = function(session, foldStyle, row) {
3283
+ var line = session.getLine(row);
3284
+ var indent = line.search(/\S/);
3285
+ var next = session.getLine(row + 1);
3286
+ var prev = session.getLine(row - 1);
3287
+ var prevIndent = prev.search(/\S/);
3288
+ var nextIndent = next.search(/\S/);
3289
+
3290
+ if (indent == -1) {
3291
+ session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : "";
3292
+ return "";
3293
+ }
3294
+ if (prevIndent == -1) {
3295
+ if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") {
3296
+ session.foldWidgets[row - 1] = "";
3297
+ session.foldWidgets[row + 1] = "";
3298
+ return "start";
3299
+ }
3300
+ } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") {
3301
+ if (session.getLine(row - 2).search(/\S/) == -1) {
3302
+ session.foldWidgets[row - 1] = "start";
3303
+ session.foldWidgets[row + 1] = "";
3304
+ return "";
3305
+ }
3306
+ }
3307
+
3308
+ if (prevIndent!= -1 && prevIndent < indent)
3309
+ session.foldWidgets[row - 1] = "start";
3310
+ else
3311
+ session.foldWidgets[row - 1] = "";
3312
+
3313
+ if (indent < nextIndent)
3314
+ return "start";
3315
+ else
3316
+ return "";
3317
+ };
3318
+
3319
+ }).call(FoldMode.prototype);
3320
+
3321
+ });
3322
+
3323
+ define("ace/mode/elixir",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/elixir_highlight_rules","ace/mode/folding/coffee"], function(require, exports, module) {
3324
+ "use strict";
3325
+
3326
+ var oop = require("../lib/oop");
3327
+ var TextMode = require("./text").Mode;
3328
+ var ElixirHighlightRules = require("./elixir_highlight_rules").ElixirHighlightRules;
3329
+ var FoldMode = require("./folding/coffee").FoldMode;
3330
+
3331
+ var Mode = function() {
3332
+ this.HighlightRules = ElixirHighlightRules;
3333
+ this.foldingRules = new FoldMode();
3334
+ };
3335
+ oop.inherits(Mode, TextMode);
3336
+
3337
+ (function() {
3338
+ this.lineCommentStart = "#";
3339
+ this.$id = "ace/mode/elixir"
3340
+ }).call(Mode.prototype);
3341
+
3342
+ exports.Mode = Mode;
3343
+ });
3344
+
3345
+ define("ace/mode/html_elixir",["require","exports","module","ace/lib/oop","ace/mode/html_elixir_highlight_rules","ace/mode/html","ace/mode/javascript","ace/mode/css","ace/mode/elixir"], function(require, exports, module) {
3346
+ "use strict";
3347
+
3348
+ var oop = require("../lib/oop");
3349
+ var HtmlElixirHighlightRules = require("./html_elixir_highlight_rules").HtmlElixirHighlightRules;
3350
+ var HtmlMode = require("./html").Mode;
3351
+ var JavaScriptMode = require("./javascript").Mode;
3352
+ var CssMode = require("./css").Mode;
3353
+ var ElixirMode = require("./elixir").Mode;
3354
+
3355
+ var Mode = function() {
3356
+ HtmlMode.call(this);
3357
+ this.HighlightRules = HtmlElixirHighlightRules;
3358
+ this.createModeDelegates({
3359
+ "js-": JavaScriptMode,
3360
+ "css-": CssMode,
3361
+ "elixir-": ElixirMode
3362
+ });
3363
+ };
3364
+ oop.inherits(Mode, HtmlMode);
3365
+
3366
+ (function() {
3367
+
3368
+ this.$id = "ace/mode/html_elixir";
3369
+ }).call(Mode.prototype);
3370
+
3371
+ exports.Mode = Mode;
3372
+ });