Skip to content

Commit

Permalink
fixes #1442: javascript literals should increase line count when they
Browse files Browse the repository at this point in the history
contain newlines
  • Loading branch information
michaelficarra committed Jun 17, 2011
1 parent dfcff3f commit a1f1afe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/lexer.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/lexer.coffee
Expand Up @@ -181,7 +181,9 @@ exports.Lexer = class Lexer
# Matches JavaScript interpolated directly into the source via backticks.
jsToken: ->
return 0 unless @chunk.charAt(0) is '`' and match = JSTOKEN.exec @chunk
@token 'JS', (script = match[0]).slice 1, -1
script = match[0]
@line += count script, '\n'
@token 'JS', script[1...-1]
script.length

# Matches regular expression literals. Lexing regular expressions is difficult
Expand Down

0 comments on commit a1f1afe

Please sign in to comment.