Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions lib/prism/lex_compat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -659,13 +659,14 @@ def result
IgnoreStateToken.new([[lineno, column], event, value, lex_state])
when :on_words_sep
# Ripper emits one token each per line.
lines = value.lines
lines[0...-1].each do |whitespace|
tokens << Token.new([[lineno, column], event, whitespace, lex_state])
lineno += 1
column = 0
value.each_line.with_index do |line, index|
if index > 0
lineno += 1
column = 0
end
tokens << Token.new([[lineno, column], event, line, lex_state])
end
Token.new([[lineno, column], event, lines.last, lex_state])
tokens.pop
when :on_regexp_end
# On regex end, Ripper scans and then sets end state, so the ripper
# lexed output is begin, when it should be end. prism sets lex state
Expand Down