Permalink
Browse files

merging in @fjakobs's heregex line number fix; closes #1374

  • Loading branch information...
1 parent abb11a7 commit 19520d8d35690cd12dab6ca5d09a17ec1a38aa46 @michaelficarra michaelficarra committed May 19, 2011
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/lexer.js
View
@@ -194,12 +194,14 @@
return script.length;
};
Lexer.prototype.regexToken = function() {
- var match, prev, regex, _ref2;
+ var length, match, prev, regex, _ref2;
if (this.chunk.charAt(0) !== '/') {
return 0;
}
if (match = HEREGEX.exec(this.chunk)) {
- return this.heregexToken(match);
+ length = this.heregexToken(match);
+ this.line += count(match[0], '\n');
+ return length;
}
prev = last(this.tokens);
if (prev && (_ref2 = prev[0], __indexOf.call((prev.spaced ? NOT_REGEX : NOT_SPACED_REGEX), _ref2) >= 0)) {

0 comments on commit 19520d8

Please sign in to comment.