instance method
Prism::Translation::RubyParser#translate
translate(result, filepath)
lib/prism/translation/ruby_parser.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/prism/translation/ruby_parser.rb, line 1953
def translate(result, filepath)
if result.failure?
error = result.errors.first
raise ::RubyParser::SyntaxError, "#{filepath}:#{error.location.start_line} :: #{error.message}"
end
result.attach_comments!
result.value.accept(Compiler.new(filepath))
end
Translate the given parse result and filepath into the seattlerb/ruby_parser gem’s Sexp format.