Class: Twostroke::AST::Label
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#statement ⇒ Object
Returns the value of attribute statement.
Attributes inherited from Base
Instance Method Summary collapse
- #collapse ⇒ Object
-
#initialize(*args) ⇒ Label
constructor
A new instance of Label.
- #walk(&bk) ⇒ Object
Constructor Details
#initialize(*args) ⇒ Label
Returns a new instance of Label.
5 6 7 8 |
# File 'lib/twostroke/ast/label.rb', line 5 def initialize(*args) @statements = [] super *args end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/twostroke/ast/label.rb', line 3 def name @name end |
#statement ⇒ Object
Returns the value of attribute statement.
3 4 5 |
# File 'lib/twostroke/ast/label.rb', line 3 def statement @statement end |
Instance Method Details
#collapse ⇒ Object
10 11 12 |
# File 'lib/twostroke/ast/label.rb', line 10 def collapse self.class.new name: name, statement: statement end |
#walk(&bk) ⇒ Object
14 15 16 17 18 |
# File 'lib/twostroke/ast/label.rb', line 14 def walk(&bk) if yield self statement.walk &bk end end |