Class: Riml::ScopeNode
- Inherits:
-
Object
- Object
- Riml::ScopeNode
- Defined in:
- lib/riml/nodes.rb
Instance Attribute Summary collapse
- #argument_variable_names ⇒ Object
- #for_node_variable_names ⇒ Object
-
#function ⇒ Object
(also: #function?)
Returns the value of attribute function.
Instance Method Summary collapse
- #merge(other) ⇒ Object
- #merge!(other) ⇒ Object
- #merge_parent_function(other) ⇒ Object
- #merge_parent_function!(other) ⇒ Object
Instance Attribute Details
#argument_variable_names ⇒ Object
724 725 726 |
# File 'lib/riml/nodes.rb', line 724 def argument_variable_names @argument_variable_names ||= Set.new end |
#for_node_variable_names ⇒ Object
720 721 722 |
# File 'lib/riml/nodes.rb', line 720 def for_node_variable_names @for_node_variable_names ||= Set.new end |
#function ⇒ Object Also known as: function?
Returns the value of attribute function.
718 719 720 |
# File 'lib/riml/nodes.rb', line 718 def function @function end |
Instance Method Details
#merge(other) ⇒ Object
730 731 732 |
# File 'lib/riml/nodes.rb', line 730 def merge(other) dup.merge! other end |
#merge!(other) ⇒ Object
738 739 740 741 742 743 744 745 746 |
# File 'lib/riml/nodes.rb', line 738 def merge!(other) unless other.is_a?(ScopeNode) raise ArgumentError, "other must be ScopeNode, is #{other.class}" end self.for_node_variable_names += other.for_node_variable_names self.argument_variable_names -= for_node_variable_names self.function = other.function self end |
#merge_parent_function(other) ⇒ Object
734 735 736 |
# File 'lib/riml/nodes.rb', line 734 def merge_parent_function(other) dup.merge_parent_function!(other) end |
#merge_parent_function!(other) ⇒ Object
748 749 750 751 752 753 754 755 |
# File 'lib/riml/nodes.rb', line 748 def merge_parent_function!(other) unless other.is_a?(ScopeNode) raise ArgumentError, "other must be ScopeNode, is #{other.class}" end self.for_node_variable_names += other.for_node_variable_names self.function = other.function self end |