class SyntaxTree::Program

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

# sig/syntax_tree/node.rbs

class SyntaxTree::Program < SyntaxTree::Node
  def accept: (Visitor visitor) -> untyped
  def child_nodes: () -> untyped
  def initialize: (statements: SyntaxTree::Statements, location: SyntaxTree::Location) -> void
end

Program represents the overall syntax tree.

def ===(other)

def ===(other)
  other.is_a?(Program) && statements === other.statements
end

def accept(visitor)

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

def accept: (Visitor visitor) -> untyped

This signature was generated using 1 sample from 1 application.

def accept(visitor)
  visitor.visit_program(self)
end

def child_nodes

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

def child_nodes: () -> untyped

This signature was generated using 1 sample from 1 application.

def child_nodes
  [statements]
end

def copy(statements: nil, location: nil)

def copy(statements: nil, location: nil)
  node =
    Program.new(
      statements: statements || self.statements,
      location: location || self.location
    )
  node.comments.concat(comments.map(&:copy))
  node
end

def deconstruct_keys(_keys)

def deconstruct_keys(_keys)
  { statements: statements, location: location, comments: comments }
end

def format(q)

def format(q)
  q.format(statements)
  # We're going to put a newline on the end so that it always has one unless
  # it ends with the special __END__ syntax. In that case we want to
  # replicate the text exactly so we will just let it be.
  q.breakable_force unless statements.body.last.is_a?(EndContent)
end

def initialize(statements:, location:)

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

def initialize: (statements: SyntaxTree::Statements, location: SyntaxTree::Location) -> void

This signature was generated using 1 sample from 1 application.

def initialize(statements:, location:)
  @statements = statements
  @location = location
  @comments = []
end