waypoint -- going to try to clean up regex_token

This commit is contained in:
Jeremy Ashkenas
2010-03-08 20:57:28 -05:00
parent 3291bd2a4a
commit 3396dce2bb
3 changed files with 13 additions and 13 deletions

View File

@@ -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;