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, #end_char, #format, #pretty_print, #start_char, #to_json, #to_mermaid
Constructor Details
#initialize(value:, location:) ⇒ RParen
Returns a new instance of RParen.
9755
9756
9757
9758
|
# File 'lib/syntax_tree/node.rb', line 9755
def initialize(value:, location:)
@value = value
@location = location
end
|
Instance Attribute Details
#value ⇒ Object
9753
9754
9755
|
# File 'lib/syntax_tree/node.rb', line 9753
def value
@value
end
|
Instance Method Details
#===(other) ⇒ Object
9781
9782
9783
|
# File 'lib/syntax_tree/node.rb', line 9781
def ===(other)
other.is_a?(RParen) && value === other.value
end
|
#accept(visitor) ⇒ Object
9760
9761
9762
|
# File 'lib/syntax_tree/node.rb', line 9760
def accept(visitor)
visitor.visit_rparen(self)
end
|
#child_nodes ⇒ Object
Also known as:
deconstruct
9764
9765
9766
|
# File 'lib/syntax_tree/node.rb', line 9764
def child_nodes
[]
end
|
#copy(value: nil, location: nil) ⇒ Object
9768
9769
9770
9771
9772
9773
|
# File 'lib/syntax_tree/node.rb', line 9768
def copy(value: nil, location: nil)
RParen.new(
value: value || self.value,
location: location || self.location
)
end
|
#deconstruct_keys(_keys) ⇒ Object
9777
9778
9779
|
# File 'lib/syntax_tree/node.rb', line 9777
def deconstruct_keys(_keys)
{ value: value, location: location }
end
|