Class: NilNode

Inherits:
LiteralNode show all
Defined in:
lib/toylang/ast/nodes.rb,
lib/toylang/interpreter/evaluation.rb

Instance Attribute Summary

Attributes inherited from LiteralNode

#value

Instance Method Summary collapse

Constructor Details

#initializeNilNode

Returns a new instance of NilNode.



28
29
30
# File 'lib/toylang/ast/nodes.rb', line 28

def initialize
  super(nil)
end

Instance Method Details

#eval(_context) ⇒ Object



45
46
47
# File 'lib/toylang/interpreter/evaluation.rb', line 45

def eval(_context)
  Runtime['nil']
end