Merge branch pull/1851
This commit is contained in:
commit
052559778d
1 changed files with 22 additions and 1 deletions
|
|
@ -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*/;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue