class Evaluator::Evaluator

Defined in:

evaluator/evaluator.cr

Constant Summary

FALSE = PheltObject::Boolean.new(false)
NULL = PheltObject::Null.new
TRUE = PheltObject::Boolean.new(true)

Constructors

Instance Method Summary

Constructor Detail

def self.new(program : AST::Program, env : PheltObject::Environment = PheltObject::Environment.new) #

[View source]

Instance Method Detail

def apply_function(function : PheltObject::Function | PheltObject::Builtin, args : Array(PheltObject::Object), env : PheltObject::Environment) #

[View source]
def bool_to_boolean(value) #

[View source]

[View source]
def env=(env : PheltObject::Environment) #

[View source]
def error(error : String) #

[View source]
def error?(value) #

[View source]

[View source]
def eval(node : Nil) #

[View source]
def eval #

[View source]
def eval_array_index_expression(array : PheltObject::Array, index : PheltObject::Integer) #

[View source]
def eval_assignment_infix_expression(operator : String, left : AST::Expression, right : PheltObject::Object, env : PheltObject::Environment) #

[View source]
def eval_bang_operator_expression(right : PheltObject::Object) #

[View source]
def eval_block_statement(block : AST::BlockStatement, env : PheltObject::Environment) #

[View source]
def eval_broad_assignment_infix_expression(operator : String, left : AST::Expression, right : PheltObject::Object, env : PheltObject::Environment) #

[View source]
def eval_do(body : AST::BlockStatement, env : PheltObject::Environment) #

[View source]
def eval_expressions(expressions : Array(AST::Expression), env : PheltObject::Environment) #

[View source]
def eval_for(node : AST::ForExpression, env : PheltObject::Environment) #

[View source]
def eval_hash_index_expression(hash : PheltObject::Hash, index : PheltObject::Hashable) #

[View source]
def eval_hash_literal(node : AST::HashLiteral, env : PheltObject::Environment) #

[View source]
def eval_identifier(node : AST::Identifier, env : PheltObject::Environment) #

[View source]
def eval_if_expression(expression : AST::IfExpression, env : PheltObject::Environment) #

[View source]
def eval_indecrement_infix_expression(operator : String, left : AST::Expression, env : PheltObject::Environment) #

[View source]
def eval_indecrement_prefix_operator_expression(node : AST::PrefixExpression, right : PheltObject::Object, env : PheltObject::Environment) #

[View source]
def eval_index_expression(left, index : PheltObject::Object) #

[View source]
def eval_infix_expression(operator : String, left : PheltObject::Object, right : PheltObject::Object) #

[View source]
def eval_internal_object_access(object : PheltObject::Object, index : PheltObject::String, env : PheltObject::Environment, args : Array(PheltObject::Object) | Nil) #

[View source]
def eval_minus_prefix_operator_expression(right : PheltObject::Object) #

[View source]
def eval_number_assignment_infix_expression(operator : String, left : AST::Expression, right : PheltObject::Number, env : PheltObject::Environment) #

[View source]
def eval_number_infix_expression(operator : String, left : PheltObject::Number, right : PheltObject::Number) #

[View source]
def eval_object_access_expression(object : PheltObject::Object, index : PheltObject::String, env : PheltObject::Environment, args : Array(PheltObject::Object) | Nil = nil) #

[View source]
def eval_prefix_expression(node : AST::PrefixExpression, right : PheltObject::Object, env : PheltObject::Environment) #

[View source]
def eval_program(statements : Array(AST::Statement), env : PheltObject::Environment) #

[View source]
def eval_string_assignment_infix_expression(operator : String, left : AST::Expression, right : PheltObject::String, env : PheltObject::Environment) #

[View source]
def eval_string_index_expression(string : PheltObject::String, index : PheltObject::Integer) #

[View source]
def eval_string_infix_expression(operator : String, left : PheltObject::String, right : PheltObject::String) #

[View source]
def eval_while(node : AST::WhileExpression, env : PheltObject::Environment) #

[View source]
def extend_function_env(function : PheltObject::Function, args : Array(PheltObject::Object)) #

[View source]
def load_objects_env #

[View source]
def program : AST::Program #

[View source]
def program=(program : AST::Program) #

[View source]
def truthy?(object : PheltObject::Object) #

[View source]
def unwrap_return_value(object : PheltObject::Object) #

[View source]