class YARP::StringConcatNode

Represents the use of compile-time string concatenation.

"foo" "bar"
^^^^^^^^^^^

Attributes

left[R]

attr_reader left: Node

right[R]

attr_reader right: Node

Public Class Methods

new(left, right, location) click to toggle source

def initialize: (left: Node, right: Node, location: Location) -> void

# File yarp/node.rb, line 9921
def initialize(left, right, location)
  @left = left
  @right = right
  @location = location
end

Public Instance Methods

accept(visitor) click to toggle source

def accept: (visitor: Visitor) -> void

# File yarp/node.rb, line 9928
def accept(visitor)
  visitor.visit_string_concat_node(self)
end
child_nodes() click to toggle source

def child_nodes: () -> Array[nil | Node]

# File yarp/node.rb, line 9933
def child_nodes
  [left, right]
end
Also aliased as: deconstruct
comment_targets() click to toggle source

def comment_targets: () -> Array[Node | Location]

# File yarp/node.rb, line 9938
def comment_targets
  [left, right]
end
copy(**params) click to toggle source

def copy: (**params) -> StringConcatNode

# File yarp/node.rb, line 9943
def copy(**params)
  StringConcatNode.new(
    params.fetch(:left) { left },
    params.fetch(:right) { right },
    params.fetch(:location) { location },
  )
end
deconstruct()

def deconstruct: () -> Array[nil | Node]

Alias for: child_nodes
deconstruct_keys(keys) click to toggle source

def deconstruct_keys: (keys: Array) -> Hash[Symbol, nil | Node | Array | String | Token | Array | Location]

# File yarp/node.rb, line 9955
def deconstruct_keys(keys)
  { left: left, right: right, location: location }
end
inspect(inspector = NodeInspector.new) click to toggle source
# File yarp/node.rb, line 9959
def inspect(inspector = NodeInspector.new)
  inspector << inspector.header(self)
  inspector << "├── left:\n"
  inspector << inspector.child_node(left, "│   ")
  inspector << "└── right:\n"
  inspector << inspector.child_node(right, "    ")
  inspector.to_str
end