fixing regex-interpolation-sans-flags issue.

This commit is contained in:
Jeremy Ashkenas
2010-07-21 10:32:36 -07:00
parent 7e225688cb
commit ff88482034
3 changed files with 8 additions and 3 deletions

View File

@@ -171,7 +171,8 @@ exports.Lexer: class Lexer
str: str.replace REGEX_ESCAPE, (escaped) -> '\\' + escaped
@tokens: @tokens.concat [['(', '('], ['NEW', 'new'], ['IDENTIFIER', 'RegExp'], ['CALL_START', '(']]
@interpolateString "\"$str\"", yes
@tokens: @tokens.concat [[',', ','], ['STRING', "\"$flags\""], [')', ')'], [')', ')']]
@tokens.splice @tokens.length, 0, [',', ','], ['STRING', "\"$flags\""] if flags
@tokens.splice @tokens.length, 0, [')', ')'], [')', ')']
else
@token 'REGEX', regex
@i: + regex.length