Class: SyntaxTree::RParen
- Inherits:
-
Node
- Object
- Node
- SyntaxTree::RParen
show all
- Defined in:
- lib/syntax_tree/node.rb
Overview
RParen represents the use of a right parenthesis, i.e., ).
Instance Attribute Summary collapse
Attributes inherited from Node
#location
Instance Method Summary
collapse
Methods inherited from Node
#construct_keys, #format, #pretty_print, #to_json
Constructor Details
#initialize(value:, location:) ⇒ RParen
9616
9617
9618
9619
|
# File 'lib/syntax_tree/node.rb', line 9616
def initialize(value:, location:)
@value = value
@location = location
end
|
Instance Attribute Details
#value ⇒ Object
9614
9615
9616
|
# File 'lib/syntax_tree/node.rb', line 9614
def value
@value
end
|
Instance Method Details
#===(other) ⇒ Object
9642
9643
9644
|
# File 'lib/syntax_tree/node.rb', line 9642
def ===(other)
other.is_a?(RParen) && value === other.value
end
|
#accept(visitor) ⇒ Object
9621
9622
9623
|
# File 'lib/syntax_tree/node.rb', line 9621
def accept(visitor)
visitor.visit_rparen(self)
end
|
#child_nodes ⇒ Object
Also known as:
deconstruct
9625
9626
9627
|
# File 'lib/syntax_tree/node.rb', line 9625
def child_nodes
[]
end
|
#copy(value: nil, location: nil) ⇒ Object
9629
9630
9631
9632
9633
9634
|
# File 'lib/syntax_tree/node.rb', line 9629
def copy(value: nil, location: nil)
RParen.new(
value: value || self.value,
location: location || self.location
)
end
|
#deconstruct_keys(_keys) ⇒ Object
9638
9639
9640
|
# File 'lib/syntax_tree/node.rb', line 9638
def deconstruct_keys(_keys)
{ value: value, location: location }
end
|