class Prism::ParseResult

Experimental RBS support (using type sampling data from the type_fusion project).

# sig/prism/parse_result.rbs

class Prism::ParseResult
  def initialize: (Prism::ProgramNode value, Array[Prism::InlineComment] comments, Array[Prism::MagicComment] magic_comments, nil data_loc, Array[] errors, Array[] warnings, Prism::Source source) -> void
end

encountered.
the AST, any comments that were encounters, and any errors that were
This represents the result of a call to ::parse or ::parse_file. It contains

def attach_comments!

Attach the list of comments to their respective locations in the tree.
def attach_comments!
  Comments.new(self).attach!
end

def deconstruct_keys(keys)

Implement the hash pattern matching interface for ParseResult.
def deconstruct_keys(keys)
  { value: value, comments: comments, magic_comments: magic_comments, data_loc: data_loc, errors: errors, warnings: warnings }
end

def failure?

not.
Returns true if there were errors during parsing and false if there were
def failure?
  !success?
end

def initialize(value, comments, magic_comments, data_loc, errors, warnings, source)

Experimental RBS support (using type sampling data from the type_fusion project).

def initialize: (Prism::ProgramNode value, (Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment | Prism::InlineComment) comments, (Prism::MagicComment | Prism::MagicComment | Prism::MagicComment | Prism::MagicComment | Prism::MagicComment | Prism::MagicComment | Prism::MagicComment) magic_comments, nil data_loc,  errors,  warnings, Prism::Source source) -> void

This signature was generated using 2 samples from 1 application.

Create a new parse result object with the given values.
def initialize(value, comments, magic_comments, data_loc, errors, warnings, source)
  @value = value
  @comments = comments
  @magic_comments = magic_comments
  @data_loc = data_loc
  @errors = errors
  @warnings = warnings
  @source = source
end

def mark_newlines!

Walk the tree and mark nodes that are on a new line.
def mark_newlines!
  value.accept(Newlines.new(Array.new(1 + source.offsets.size, false)))
end

def success?

were.
Returns true if there were no errors during parsing and false if there
def success?
  errors.empty?
end