fixes #1724 for heregexen

TODO: DRY up that regex handling code so we don't have a duplicate test/error
This commit is contained in:
Michael Ficarra
2011-09-22 04:39:13 -04:00
parent f4c1b20ec2
commit 52dd348289
3 changed files with 7 additions and 0 deletions

View File

@@ -209,6 +209,7 @@ exports.Lexer = class Lexer
[heregex, body, flags] = match
if 0 > body.indexOf '#{'
re = body.replace(HEREGEX_OMIT, '').replace(/\//g, '\\/')
if re.match /^\*/ then @error 'regular expressions cannot begin with `*`'
@token 'REGEX', "/#{ re or '(?:)' }/#{flags}"
return heregex.length
@token 'IDENTIFIER', 'RegExp'