Skip to content

Commit

Permalink
Lexer should increase line count correctly in =begin..=end comments
Browse files Browse the repository at this point in the history
  • Loading branch information
adambeynon committed Oct 31, 2013
1 parent 4986f11 commit 77e8175
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/opal/parser/lexer.rb
Expand Up @@ -566,17 +566,20 @@ def yylex
if @lex_state == :expr_beg and !@space_seen
if scanner.scan(/begin/) and space?
scanner.scan(/(.*)/) # end of line
line_count = 0

while true
if scanner.eos?
raise "embedded document meets end of file"
end

if scanner.scan(/\=end/) and space?
@line += line_count
return next_token
end

if scanner.scan(/\n/)
line_count += 1
next
end

Expand Down

0 comments on commit 77e8175

Please sign in to comment.