class Prism::Translation::RubyParser

seattlerb/ruby_parser gem’s syntax tree.
This module is the entry-point for converting a prism syntax tree into the

def parse(source, filepath = "(string)")

gem's Sexp format.
Parse the given source and translate it into the seattlerb/ruby_parser
def parse(source, filepath = "(string)")
  translate(Prism.parse(source, filepath: filepath, partial_script: true), filepath)
end

def parse(source, filepath = "(string)")

gem's Sexp format.
Parse the given source and translate it into the seattlerb/ruby_parser
def parse(source, filepath = "(string)")
  new.parse(source, filepath)
end

def parse_file(filepath)

gem's Sexp format.
Parse the given file and translate it into the seattlerb/ruby_parser
def parse_file(filepath)
  translate(Prism.parse_file(filepath, partial_script: true), filepath)
end

def parse_file(filepath)

gem's Sexp format.
Parse the given file and translate it into the seattlerb/ruby_parser
def parse_file(filepath)
  new.parse_file(filepath)
end

def translate(result, filepath)

seattlerb/ruby_parser gem's Sexp format.
Translate the given parse result and filepath into the
def translate(result, filepath)
  if result.failure?
    error = result.errors.first
    raise ::RubyParser::SyntaxError, "#{filepath}:#{error.location.start_line} :: #{error.message}"
  end
  result.value.accept(Compiler.new(filepath))
end