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
@@ -54,6 +54,7 @@ define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/
54
54
  var oop = require("../lib/oop");
55
55
  var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
56
56
  var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
57
+ var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b";
57
58
 
58
59
  var JavaScriptHighlightRules = function(options) {
59
60
  var keywordMapper = this.createKeywordMapper({
@@ -83,7 +84,6 @@ var JavaScriptHighlightRules = function(options) {
83
84
  "constant.language.boolean": "true|false"
84
85
  }, "identifier");
85
86
  var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
86
- var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b";
87
87
 
88
88
  var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
89
89
  "u[0-9a-fA-F]{4}|" + // unicode
@@ -171,15 +171,6 @@ var JavaScriptHighlightRules = function(options) {
171
171
  token : "keyword",
172
172
  regex : "(?:" + kwBeforeRe + ")\\b",
173
173
  next : "start"
174
- }, {
175
- token : ["punctuation.operator", "support.function"],
176
- 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(?=\()/
177
- }, {
178
- token : ["punctuation.operator", "support.function.dom"],
179
- 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(?=\()/
180
- }, {
181
- token : ["punctuation.operator", "support.constant"],
182
- 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/
183
174
  }, {
184
175
  token : ["support.constant"],
185
176
  regex : /that\b/
@@ -189,9 +180,13 @@ var JavaScriptHighlightRules = function(options) {
189
180
  }, {
190
181
  token : keywordMapper,
191
182
  regex : identifierRe
183
+ }, {
184
+ token : "punctuation.operator",
185
+ regex : /[.](?![.])/,
186
+ next : "property"
192
187
  }, {
193
188
  token : "keyword.operator",
194
- regex : /--|\+\+|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|[!$%&*+\-~\/^]=?/,
189
+ regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|[!$%&*+\-~\/^]=?/,
195
190
  next : "start"
196
191
  }, {
197
192
  token : "punctuation.operator",
@@ -209,6 +204,38 @@ var JavaScriptHighlightRules = function(options) {
209
204
  regex: /^#!.*$/
210
205
  }
211
206
  ],
207
+ property: [{
208
+ token : "text",
209
+ regex : "\\s+"
210
+ }, {
211
+ token : [
212
+ "storage.type", "punctuation.operator", "entity.name.function", "text",
213
+ "keyword.operator", "text",
214
+ "storage.type", "text", "entity.name.function", "text", "paren.lparen"
215
+ ],
216
+ regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()",
217
+ next: "function_arguments"
218
+ }, {
219
+ token : "punctuation.operator",
220
+ regex : /[.](?![.])/
221
+ }, {
222
+ token : "support.function",
223
+ 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(?=\()/
224
+ }, {
225
+ token : "support.function.dom",
226
+ 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(?=\()/
227
+ }, {
228
+ token : "support.constant",
229
+ 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/
230
+ }, {
231
+ token : "identifier",
232
+ regex : identifierRe
233
+ }, {
234
+ regex: "",
235
+ token: "empty",
236
+ next: "no_regex"
237
+ }
238
+ ],
212
239
  "start": [
213
240
  DocCommentHighlightRules.getStartRule("doc-start"),
214
241
  {
@@ -363,7 +390,7 @@ var JavaScriptHighlightRules = function(options) {
363
390
  if (val == "}" && stack.length) {
364
391
  stack.shift();
365
392
  this.next = stack.shift();
366
- if (this.next.indexOf("string") != -1)
393
+ if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1)
367
394
  return "paren.quasi.end";
368
395
  }
369
396
  return val == "{" ? "paren.lparen" : "paren.rparen";
@@ -387,6 +414,9 @@ var JavaScriptHighlightRules = function(options) {
387
414
  defaultToken: "string.quasi"
388
415
  }]
389
416
  });
417
+
418
+ if (!options || !options.noJSX)
419
+ JSX.call(this);
390
420
  }
391
421
 
392
422
  this.embedRules(DocCommentHighlightRules, "doc-",
@@ -397,6 +427,105 @@ var JavaScriptHighlightRules = function(options) {
397
427
 
398
428
  oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
399
429
 
430
+ function JSX() {
431
+ var tagRegex = identifierRe.replace("\\d", "\\d\\-");
432
+ var jsxTag = {
433
+ onMatch : function(val, state, stack) {
434
+ var offset = val.charAt(1) == "/" ? 2 : 1;
435
+ if (offset == 1) {
436
+ if (state != this.nextState)
437
+ stack.unshift(this.next, this.nextState, 0);
438
+ else
439
+ stack.unshift(this.next);
440
+ stack[2]++;
441
+ } else if (offset == 2) {
442
+ if (state == this.nextState) {
443
+ stack[1]--;
444
+ if (!stack[1] || stack[1] < 0) {
445
+ stack.shift();
446
+ stack.shift();
447
+ }
448
+ }
449
+ }
450
+ return [{
451
+ type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml",
452
+ value: val.slice(0, offset)
453
+ }, {
454
+ type: "meta.tag.tag-name.xml",
455
+ value: val.substr(offset)
456
+ }];
457
+ },
458
+ regex : "</?" + tagRegex + "",
459
+ next: "jsxAttributes",
460
+ nextState: "jsx"
461
+ };
462
+ this.$rules.start.unshift(jsxTag);
463
+ var jsxJsRule = {
464
+ regex: "{",
465
+ token: "paren.quasi.start",
466
+ push: "start"
467
+ };
468
+ this.$rules.jsx = [
469
+ jsxJsRule,
470
+ jsxTag,
471
+ {include : "reference"},
472
+ {defaultToken: "string"}
473
+ ];
474
+ this.$rules.jsxAttributes = [{
475
+ token : "meta.tag.punctuation.tag-close.xml",
476
+ regex : "/?>",
477
+ onMatch : function(value, currentState, stack) {
478
+ if (currentState == stack[0])
479
+ stack.shift();
480
+ if (value.length == 2) {
481
+ if (stack[0] == this.nextState)
482
+ stack[1]--;
483
+ if (!stack[1] || stack[1] < 0) {
484
+ stack.splice(0, 2);
485
+ }
486
+ }
487
+ this.next = stack[0] || "start";
488
+ return [{type: this.token, value: value}];
489
+ },
490
+ nextState: "jsx"
491
+ },
492
+ jsxJsRule,
493
+ {
494
+ token : "entity.other.attribute-name.xml",
495
+ regex : tagRegex
496
+ }, {
497
+ token : "keyword.operator.attribute-equals.xml",
498
+ regex : "="
499
+ }, {
500
+ token : "text.tag-whitespace.xml",
501
+ regex : "\\s+"
502
+ }, {
503
+ token : "string.attribute-value.xml",
504
+ regex : "'",
505
+ stateName : "jsx_attr_q",
506
+ push : [
507
+ {token : "string.attribute-value.xml", regex: "'", next: "pop"},
508
+ jsxJsRule,
509
+ {include : "reference"},
510
+ {defaultToken : "string.attribute-value.xml"}
511
+ ]
512
+ }, {
513
+ token : "string.attribute-value.xml",
514
+ regex : '"',
515
+ stateName : "jsx_attr_qq",
516
+ push : [
517
+ jsxJsRule,
518
+ {token : "string.attribute-value.xml", regex: '"', next: "pop"},
519
+ {include : "reference"},
520
+ {defaultToken : "string.attribute-value.xml"}
521
+ ]
522
+ }];
523
+ this.$rules.reference = [{
524
+ token : "constant.language.escape.reference.xml",
525
+ regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
526
+ }];
527
+ }
528
+
400
529
  exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
401
530
  });
402
531
 
@@ -680,8 +809,8 @@ var CstyleBehaviour = function() {
680
809
  if (leftChar == "\\" && token && /escape/.test(token.type))
681
810
  return null;
682
811
 
683
- var stringBefore = token && /string/.test(token.type);
684
- var stringAfter = !rightToken || /string/.test(rightToken.type);
812
+ var stringBefore = token && /string|escape/.test(token.type);
813
+ var stringAfter = !rightToken || /string|escape/.test(rightToken.type);
685
814
 
686
815
  var pair;
687
816
  if (rightChar == quote) {
@@ -822,7 +951,7 @@ oop.inherits(FoldMode, BaseFoldMode);
822
951
  this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
823
952
  this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;
824
953
  this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
825
- this.startRegionRe = /^\s*(\/\*|\/\/)#region\b/;
954
+ this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
826
955
  this._getFoldWidgetBase = this.getFoldWidget;
827
956
  this.getFoldWidget = function(session, foldStyle, row) {
828
957
  var line = session.getLine(row);
@@ -910,13 +1039,12 @@ oop.inherits(FoldMode, BaseFoldMode);
910
1039
 
911
1040
  return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
912
1041
  };
913
-
914
1042
  this.getCommentRegionBlock = function(session, line, row) {
915
1043
  var startColumn = line.search(/\s*$/);
916
1044
  var maxRow = session.getLength();
917
1045
  var startRow = row;
918
1046
 
919
- var re = /^\s*(?:\/\*|\/\/)#(end)?region\b/;
1047
+ var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
920
1048
  var depth = 1;
921
1049
  while (++row < maxRow) {
922
1050
  line = session.getLine(row);
@@ -346,8 +346,8 @@ var CstyleBehaviour = function() {
346
346
  if (leftChar == "\\" && token && /escape/.test(token.type))
347
347
  return null;
348
348
 
349
- var stringBefore = token && /string/.test(token.type);
350
- var stringAfter = !rightToken || /string/.test(rightToken.type);
349
+ var stringBefore = token && /string|escape/.test(token.type);
350
+ var stringAfter = !rightToken || /string|escape/.test(rightToken.type);
351
351
 
352
352
  var pair;
353
353
  if (rightChar == quote) {
@@ -488,7 +488,7 @@ oop.inherits(FoldMode, BaseFoldMode);
488
488
  this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
489
489
  this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;
490
490
  this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
491
- this.startRegionRe = /^\s*(\/\*|\/\/)#region\b/;
491
+ this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
492
492
  this._getFoldWidgetBase = this.getFoldWidget;
493
493
  this.getFoldWidget = function(session, foldStyle, row) {
494
494
  var line = session.getLine(row);
@@ -576,13 +576,12 @@ oop.inherits(FoldMode, BaseFoldMode);
576
576
 
577
577
  return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
578
578
  };
579
-
580
579
  this.getCommentRegionBlock = function(session, line, row) {
581
580
  var startColumn = line.search(/\s*$/);
582
581
  var maxRow = session.getLength();
583
582
  var startRow = row;
584
583
 
585
- var re = /^\s*(?:\/\*|\/\/)#(end)?region\b/;
584
+ var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
586
585
  var depth = 1;
587
586
  while (++row < maxRow) {
588
587
  line = session.getLine(row);
@@ -2309,8 +2309,8 @@ var CstyleBehaviour = function() {
2309
2309
  if (leftChar == "\\" && token && /escape/.test(token.type))
2310
2310
  return null;
2311
2311
 
2312
- var stringBefore = token && /string/.test(token.type);
2313
- var stringAfter = !rightToken || /string/.test(rightToken.type);
2312
+ var stringBefore = token && /string|escape/.test(token.type);
2313
+ var stringAfter = !rightToken || /string|escape/.test(rightToken.type);
2314
2314
 
2315
2315
  var pair;
2316
2316
  if (rightChar == quote) {
@@ -2678,7 +2678,7 @@ oop.inherits(FoldMode, BaseFoldMode);
2678
2678
  this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
2679
2679
  this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;
2680
2680
  this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
2681
- this.startRegionRe = /^\s*(\/\*|\/\/)#region\b/;
2681
+ this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
2682
2682
  this._getFoldWidgetBase = this.getFoldWidget;
2683
2683
  this.getFoldWidget = function(session, foldStyle, row) {
2684
2684
  var line = session.getLine(row);
@@ -2766,13 +2766,12 @@ oop.inherits(FoldMode, BaseFoldMode);
2766
2766
 
2767
2767
  return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
2768
2768
  };
2769
-
2770
2769
  this.getCommentRegionBlock = function(session, line, row) {
2771
2770
  var startColumn = line.search(/\s*$/);
2772
2771
  var maxRow = session.getLength();
2773
2772
  var startRow = row;
2774
2773
 
2775
- var re = /^\s*(?:\/\*|\/\/)#(end)?region\b/;
2774
+ var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
2776
2775
  var depth = 1;
2777
2776
  while (++row < maxRow) {
2778
2777
  line = session.getLine(row);
@@ -198,6 +198,7 @@ define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/
198
198
  var oop = require("../lib/oop");
199
199
  var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
200
200
  var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
201
+ var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b";
201
202
 
202
203
  var JavaScriptHighlightRules = function(options) {
203
204
  var keywordMapper = this.createKeywordMapper({
@@ -227,7 +228,6 @@ var JavaScriptHighlightRules = function(options) {
227
228
  "constant.language.boolean": "true|false"
228
229
  }, "identifier");
229
230
  var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
230
- var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b";
231
231
 
232
232
  var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
233
233
  "u[0-9a-fA-F]{4}|" + // unicode
@@ -315,15 +315,6 @@ var JavaScriptHighlightRules = function(options) {
315
315
  token : "keyword",
316
316
  regex : "(?:" + kwBeforeRe + ")\\b",
317
317
  next : "start"
318
- }, {
319
- token : ["punctuation.operator", "support.function"],
320
- 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(?=\()/
321
- }, {
322
- token : ["punctuation.operator", "support.function.dom"],
323
- 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(?=\()/
324
- }, {
325
- token : ["punctuation.operator", "support.constant"],
326
- 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/
327
318
  }, {
328
319
  token : ["support.constant"],
329
320
  regex : /that\b/
@@ -333,9 +324,13 @@ var JavaScriptHighlightRules = function(options) {
333
324
  }, {
334
325
  token : keywordMapper,
335
326
  regex : identifierRe
327
+ }, {
328
+ token : "punctuation.operator",
329
+ regex : /[.](?![.])/,
330
+ next : "property"
336
331
  }, {
337
332
  token : "keyword.operator",
338
- regex : /--|\+\+|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|[!$%&*+\-~\/^]=?/,
333
+ regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|[!$%&*+\-~\/^]=?/,
339
334
  next : "start"
340
335
  }, {
341
336
  token : "punctuation.operator",
@@ -353,6 +348,38 @@ var JavaScriptHighlightRules = function(options) {
353
348
  regex: /^#!.*$/
354
349
  }
355
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
+ ],
356
383
  "start": [
357
384
  DocCommentHighlightRules.getStartRule("doc-start"),
358
385
  {
@@ -507,7 +534,7 @@ var JavaScriptHighlightRules = function(options) {
507
534
  if (val == "}" && stack.length) {
508
535
  stack.shift();
509
536
  this.next = stack.shift();
510
- if (this.next.indexOf("string") != -1)
537
+ if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1)
511
538
  return "paren.quasi.end";
512
539
  }
513
540
  return val == "{" ? "paren.lparen" : "paren.rparen";
@@ -531,6 +558,9 @@ var JavaScriptHighlightRules = function(options) {
531
558
  defaultToken: "string.quasi"
532
559
  }]
533
560
  });
561
+
562
+ if (!options || !options.noJSX)
563
+ JSX.call(this);
534
564
  }
535
565
 
536
566
  this.embedRules(DocCommentHighlightRules, "doc-",
@@ -541,6 +571,105 @@ var JavaScriptHighlightRules = function(options) {
541
571
 
542
572
  oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
543
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
+
544
673
  exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
545
674
  });
546
675
 
@@ -551,8 +680,7 @@ var oop = require("../lib/oop");
551
680
  var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
552
681
 
553
682
  var XmlHighlightRules = function(normalize) {
554
-
555
- var tagRegex = "[a-zA-Z][-_a-zA-Z0-9]*";
683
+ var tagRegex = "[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*";
556
684
 
557
685
  this.$rules = {
558
686
  start : [
@@ -794,7 +922,7 @@ var HtmlHighlightRules = function() {
794
922
  include : "tag_whitespace"
795
923
  }, {
796
924
  token : "entity.other.attribute-name.xml",
797
- regex : "[-_a-zA-Z0-9:]+"
925
+ regex : "[-_a-zA-Z0-9:.]+"
798
926
  }, {
799
927
  token : "keyword.operator.attribute-equals.xml",
800
928
  regex : "=",
@@ -818,7 +946,7 @@ var HtmlHighlightRules = function() {
818
946
  return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml",
819
947
  "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"];
820
948
  },
821
- regex : "(</?)([-_a-zA-Z0-9:]+)",
949
+ regex : "(</?)([-_a-zA-Z0-9:.]+)",
822
950
  next: "tag_stuff"
823
951
  }],
824
952
  tag_stuff: [
@@ -828,7 +956,7 @@ var HtmlHighlightRules = function() {
828
956
  });
829
957
 
830
958
  this.embedTagRules(CssHighlightRules, "css-", "style");
831
- this.embedTagRules(JavaScriptHighlightRules, "js-", "script");
959
+ this.embedTagRules(new JavaScriptHighlightRules({noJSX: true}).getRules(), "js-", "script");
832
960
 
833
961
  if (this.constructor === HtmlHighlightRules)
834
962
  this.normalizeRules();
@@ -983,7 +1111,7 @@ var JspHighlightRules = function() {
983
1111
  push : "jsp-dcomment"
984
1112
  }, {
985
1113
  token : "meta.tag", // jsp open tag
986
- regex : "<%@?|<%=?|<jsp:[^>]+>",
1114
+ regex : "<%@?|<%=?|<%!?|<jsp:[^>]+>",
987
1115
  push : "jsp-start"
988
1116
  }
989
1117
  ];
@@ -1303,8 +1431,8 @@ var CstyleBehaviour = function() {
1303
1431
  if (leftChar == "\\" && token && /escape/.test(token.type))
1304
1432
  return null;
1305
1433
 
1306
- var stringBefore = token && /string/.test(token.type);
1307
- var stringAfter = !rightToken || /string/.test(rightToken.type);
1434
+ var stringBefore = token && /string|escape/.test(token.type);
1435
+ var stringAfter = !rightToken || /string|escape/.test(rightToken.type);
1308
1436
 
1309
1437
  var pair;
1310
1438
  if (rightChar == quote) {
@@ -1445,7 +1573,7 @@ oop.inherits(FoldMode, BaseFoldMode);
1445
1573
  this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
1446
1574
  this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;
1447
1575
  this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
1448
- this.startRegionRe = /^\s*(\/\*|\/\/)#region\b/;
1576
+ this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
1449
1577
  this._getFoldWidgetBase = this.getFoldWidget;
1450
1578
  this.getFoldWidget = function(session, foldStyle, row) {
1451
1579
  var line = session.getLine(row);
@@ -1533,13 +1661,12 @@ oop.inherits(FoldMode, BaseFoldMode);
1533
1661
 
1534
1662
  return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
1535
1663
  };
1536
-
1537
1664
  this.getCommentRegionBlock = function(session, line, row) {
1538
1665
  var startColumn = line.search(/\s*$/);
1539
1666
  var maxRow = session.getLength();
1540
1667
  var startRow = row;
1541
1668
 
1542
- var re = /^\s*(?:\/\*|\/\/)#(end)?region\b/;
1669
+ var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
1543
1670
  var depth = 1;
1544
1671
  while (++row < maxRow) {
1545
1672
  line = session.getLine(row);