diff --git a/lib/ast_to_prism/parser.rb b/lib/ast_to_prism/parser.rb index 82eaf54..088b437 100644 --- a/lib/ast_to_prism/parser.rb +++ b/lib/ast_to_prism/parser.rb @@ -1022,21 +1022,23 @@ def convert_node(node, block: nil) not_expected(node) when :BREAK nd_stts, = node.children + loc, keyword_loc = node.locations Prism::BreakNode.new( source, # source convert_stts(nd_stts), # arguments - location(node), # keyword_loc - location(node) # location + location(keyword_loc), # keyword_loc + location(loc) # location ) when :NEXT nd_stts, = node.children + loc, keyword_loc = node.locations Prism::NextNode.new( source, # source convert_stts(nd_stts), # arguments - null_location, # keyword_loc - location(node) # location + location(keyword_loc), # keyword_loc + location(loc) # location ) when :RETURN nd_stts, = node.children @@ -1050,9 +1052,12 @@ def convert_node(node, block: nil) location(node) # location ) when :REDO + loc, keyword_loc = node.locations + Prism::RedoNode.new( - source, # source - location(node) # location + source, # source + location(keyword_loc), # keyword_loc + location(loc) # location ) when :RETRY Prism::RetryNode.new(