Class: Loxxy::Ast::LoxReturnStmt
- Inherits:
-
LoxCompoundExpr
- Object
- LoxNode
- LoxCompoundExpr
- Loxxy::Ast::LoxReturnStmt
- Defined in:
- lib/loxxy/ast/lox_return_stmt.rb
Instance Attribute Summary
Attributes inherited from LoxCompoundExpr
Attributes inherited from LoxNode
Instance Method Summary collapse
-
#accept(visitor) ⇒ Object
Part of the 'visitee' role in Visitor design pattern.
-
#initialize(aPosition, anExpression) ⇒ LoxReturnStmt
constructor
A new instance of LoxReturnStmt.
Methods inherited from LoxNode
Constructor Details
#initialize(aPosition, anExpression) ⇒ LoxReturnStmt
Returns a new instance of LoxReturnStmt.
10 11 12 13 |
# File 'lib/loxxy/ast/lox_return_stmt.rb', line 10 def initialize(aPosition, anExpression) expr = anExpression || Datatype::Nil.instance super(aPosition, [expr]) end |
Instance Method Details
#accept(visitor) ⇒ Object
Part of the 'visitee' role in Visitor design pattern.
17 18 19 |
# File 'lib/loxxy/ast/lox_return_stmt.rb', line 17 def accept(visitor) visitor.visit_return_stmt(self) end |