Merge branch pull/1851

This commit is contained in:
nightwing 2014-04-11 20:47:20 +04:00
commit 052559778d

View file

@ -49,7 +49,28 @@ oop.inherits(Mode, TextMode);
(function() {
var indenter = /(?:[({[=:]|[-=]>|\b(?:else|switch|try|catch(?:\s*[$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]*)?|finally))\s*$/;
/*:
[({[=:] # Opening parentheses or brackets
|[-=]> # OR single or double arrow
|\b(?: # OR one of these words:
else # else
|try # OR try
|(?:swi|ca)tch # OR catch, optionally followed by:
(?:\s*[$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]*)? # a variable
|finally # OR finally
))\s*$ # all as the last thing on a line (allowing trailing space)
| # ---- OR ---- :
^\s* # a line starting with optional space
(else\b\s*)? # followed by an optional "else"
(?: # followed by one of the following:
if # if
|for # OR for
|while # OR while
|loop # OR loop
)\b # (as a word)
(?!.*\bthen\b) # ... but NOT followed by "then" on the line
*/
var indenter = /(?:[({[=:]|[-=]>|\b(?:else|try|(?:swi|ca)tch(?:\s+[$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]*)?|finally))\s*$|^\s*(else\b\s*)?(?:if|for|while|loop)\b(?!.*\bthen\b)/;
var commentLine = /^(\s*)#/;
var hereComment = /^\s*###(?!#)/;
var indentation = /^\s*/;