class SyntaxTree::Paren

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

# sig/syntax_tree/node.rbs

class SyntaxTree::Paren < SyntaxTree::Node
  def accept: (Visitor visitor) -> untyped
  def child_nodes: () -> untyped
  def initialize: (lparen: SyntaxTree::LParen, contents: SyntaxTree::Params, location: SyntaxTree::Location) -> void
end


(1 + 2)
be used.
program. In general parentheses can be used anywhere a Ruby expression can
Paren represents using balanced parentheses in a couple places in a Ruby

def ===(other)

def ===(other)
  other.is_a?(Paren) && lparen === other.lparen &&
    contents === other.contents
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 5 samples from 1 application.

def accept(visitor)
  visitor.visit_paren(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 5 samples from 1 application.

def child_nodes
  [lparen, contents]
end

def copy(lparen: nil, contents: nil, location: nil)

def copy(lparen: nil, contents: nil, location: nil)
  node =
    Paren.new(
      lparen: lparen || self.lparen,
      contents: contents || self.contents,
      location: location || self.location
    )
  node.comments.concat(comments.map(&:copy))
  node
end

def deconstruct_keys(_keys)

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

def format(q)

def format(q)
  contents = self.contents
  q.group do
    q.format(lparen)
    if contents && (!contents.is_a?(Params) || !contents.empty?)
      q.indent do
        q.breakable_empty
        q.format(contents)
      end
    end
    q.breakable_empty
    q.text(")")
  end
end

def initialize(lparen:, contents:, location:)

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

def initialize: (lparen: SyntaxTree::LParen, contents: SyntaxTree::Params, location: SyntaxTree::Location) -> void

This signature was generated using 3 samples from 1 application.

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