Skip to content
Merged
Show file tree
Hide file tree
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
9 changes: 7 additions & 2 deletions lib/prism/translation/ripper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ module Translation
# - on_comma
# - on_ignored_nl
# - on_ignored_sp
# - on_label_end
# - on_nl
# - on_operator_ambiguous
# - on_semicolon
Expand Down Expand Up @@ -3633,7 +3632,13 @@ def visit_string_node(node)
end

result = yield
return result if assoc
if assoc
if node.closing != ":"
bounds(node.closing_loc)
on_label_end(node.closing)
end
return result
end

if is_heredoc
bounds(node.closing_loc)
Expand Down
4 changes: 2 additions & 2 deletions test/prism/ruby/ripper_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,11 @@ def test_lex_ignored_missing_heredoc_end
end
end

UNSUPPORTED_EVENTS = %i[comma ignored_nl label_end nl semicolon sp ignored_sp]
UNSUPPORTED_EVENTS = %i[comma ignored_nl nl semicolon sp ignored_sp]
# Events that are currently not emitted
SUPPORTED_EVENTS = Translation::Ripper::EVENTS - UNSUPPORTED_EVENTS
# Events that assert against their line/column
CHECK_LOCATION_EVENTS = %i[kw op lbrace rbrace lbracket rbracket lparen rparen words_sep]
CHECK_LOCATION_EVENTS = %i[kw op lbrace rbrace lbracket rbracket lparen rparen words_sep label_end]

module Events
attr_reader :events
Expand Down