mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
waypoint -- going to try to clean up regex_token
This commit is contained in:
14
lib/lexer.js
14
lib/lexer.js
@@ -175,13 +175,13 @@
|
||||
if (!(starts(this.chunk, '/'))) {
|
||||
return false;
|
||||
}
|
||||
if (include(NOT_REGEX, this.tag())) {
|
||||
return false;
|
||||
}
|
||||
if (!((regex = this.balanced_token(['/', '/'])))) {
|
||||
return false;
|
||||
}
|
||||
if (regex.length < 3 || regex.match(/^\/\s+|\n/)) {
|
||||
return false;
|
||||
}
|
||||
if (include(NOT_REGEX, this.tag())) {
|
||||
if (regex.length < 3 || regex.match(/^\/\s+/m)) {
|
||||
return false;
|
||||
}
|
||||
flags = ['i', 'm', 'g', 'y'];
|
||||
@@ -462,10 +462,10 @@
|
||||
i += 1;
|
||||
}
|
||||
if (levels.length) {
|
||||
if (!(delimited[0][0] === '/')) {
|
||||
throw new Error("SyntaxError: Unterminated " + (levels.pop()[0]) + " starting on line " + (this.line + 1));
|
||||
if (delimited[0][0] === '/') {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
throw new Error("SyntaxError: Unterminated " + (levels.pop()[0]) + " starting on line " + (this.line + 1));
|
||||
}
|
||||
if (i === 0) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user