class Prism::ParseResult
This is a result specific to the parse and parse_file methods.
This is a result specific to the parse and parse_file methods.
Attributes
The syntax tree that was parsed from the source code.
The syntax tree that was parsed from the source code.
Public Class Methods
(ProgramNode value, Array[MagicComment] magic_comments, Location? data_loc, Array[ParseError] errors, Array[ParseWarning] warnings, bool continuable, Source source) → void
Source
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/lib/prism/parse_result.rb, line 1027 def initialize(value, magic_comments, data_loc, errors, warnings, continuable, source) @value = value super(magic_comments, data_loc, errors, warnings, continuable, source) end
Create a new parse result object with the given values.
Create a new parse result object with the given values.
: (ProgramNode value, Array magic_comments, Location? data_loc, Array errors, Array warnings, bool continuable, Source source) -> void
Prism::Result::new
Public Instance Methods
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/sig/generated/prism/parse_result.rbs, line 738
def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped]
Implement the hash pattern matching interface for ParseResult.
: (Array? keys) -> Hash[Symbol, untyped]
() → String
Source
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/lib/prism/parse_result.rb, line 1051 def errors_format Errors.new(self).format end
Returns a string representation of the syntax tree with the errors displayed inline.
Returns a string representation of the syntax tree with the errors displayed inline.
: () -> String
() → void
Source
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/lib/prism/parse_result.rb, line 1043 def mark_newlines! value.accept(Newlines.new(source.offsets.size)) # steep:ignore end
Walk the tree and mark nodes that are on a new line, loosely emulating the behavior of CRuby’s :line tracepoint event.
Walk the tree and mark nodes that are on a new line, loosely emulating the behavior of CRuby’s :line tracepoint event.
: () -> void