summaryrefslogtreecommitdiff
path: root/lib/prism
diff options
context:
space:
mode:
authorKevin Newton <kddnewton@gmail.com>2024-03-06 00:58:15 -0500
committergit <svn-admin@ruby-lang.org>2024-03-06 16:43:00 +0000
commit059f28eaace11054b1d3dad6f77c99906537bf89 (patch)
treeb333857f9b9d20fd405c0b3a861db42ae1f1e08a /lib/prism
parent1dae34f1c6fce7d86ad047af2e121c32d1287887 (diff)
[ruby/prism] Handle empty embedded expressions in ripper translation
https://github.com/ruby/prism/commit/99eca8b1d2
Diffstat (limited to 'lib/prism')
-rw-r--r--lib/prism/translation/ripper.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/prism/translation/ripper.rb b/lib/prism/translation/ripper.rb
index 2af5ec351b..d6c98ccf7b 100644
--- a/lib/prism/translation/ripper.rb
+++ b/lib/prism/translation/ripper.rb
@@ -1200,7 +1200,13 @@ module Prism
# "foo #{bar}"
# ^^^^^^
def visit_embedded_statements_node(node)
- statements = visit(node.statements)
+ statements =
+ if node.statements.nil?
+ bounds(node.location)
+ on_stmts_add(on_stmts_new, on_void_stmt)
+ else
+ visit(node.statements)
+ end
bounds(node.location)
on_string_embexpr(statements)