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
Returns a new instance of RParen.
9642
9643
9644
9645
|
# File 'lib/syntax_tree/node.rb', line 9642
def initialize(value:, location:)
@value = value
@location = location
end
|
Instance Attribute Details
#value ⇒ Object
9640
9641
9642
|
# File 'lib/syntax_tree/node.rb', line 9640
def value
@value
end
|
Instance Method Details
#===(other) ⇒ Object
9668
9669
9670
|
# File 'lib/syntax_tree/node.rb', line 9668
def ===(other)
other.is_a?(RParen) && value === other.value
end
|
#accept(visitor) ⇒ Object
9647
9648
9649
|
# File 'lib/syntax_tree/node.rb', line 9647
def accept(visitor)
visitor.visit_rparen(self)
end
|
#child_nodes ⇒ Object
Also known as:
deconstruct
9651
9652
9653
|
# File 'lib/syntax_tree/node.rb', line 9651
def child_nodes
[]
end
|
#copy(value: nil, location: nil) ⇒ Object
9655
9656
9657
9658
9659
9660
|
# File 'lib/syntax_tree/node.rb', line 9655
def copy(value: nil, location: nil)
RParen.new(
value: value || self.value,
location: location || self.location
)
end
|
#deconstruct_keys(_keys) ⇒ Object
9664
9665
9666
|
# File 'lib/syntax_tree/node.rb', line 9664
def deconstruct_keys(_keys)
{ value: value, location: location }
end
|