Exception: AmberVM::Interpreter::ReturnData
- Defined in:
- lib/amber/interpreter.rb
Overview
This is an exception designed to handle the return statement. It is thrown for for the return and the value can be evaluated.
The catching is handled bythe AmberVM::Classes::Block
class.
Instance Attribute Summary collapse
-
#pos ⇒ Object
readonly
Returns the value of attribute pos.
-
#val ⇒ Object
readonly
Returns the value of attribute val.
Instance Method Summary collapse
-
#initialize(val, pos = nil) ⇒ ReturnData
constructor
The ReturnException is initialized wiht 1 to 2 parameters.
Constructor Details
#initialize(val, pos = nil) ⇒ ReturnData
The ReturnException is initialized wiht 1 to 2 parameters.
- val
-
The value that will be returned, aka the part after ‘return’.
- pos
-
The position within the source code of the definition - for deugging purpose.
1051 1052 1053 1054 1055 |
# File 'lib/amber/interpreter.rb', line 1051 def initialize val, pos = nil super() @val = val @pos = pos end |
Instance Attribute Details
#pos ⇒ Object (readonly)
Returns the value of attribute pos.
1043 1044 1045 |
# File 'lib/amber/interpreter.rb', line 1043 def pos @pos end |
#val ⇒ Object (readonly)
Returns the value of attribute val.
1042 1043 1044 |
# File 'lib/amber/interpreter.rb', line 1042 def val @val end |