class Axal::Interpreter

Defined in:

lang/interpreter.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new #

[View source]

Instance Method Detail

def assign_function_args_to_params(stack_frame) #

[View source]
def assign_function_args_to_params_for_chained_call(stack_frame, param1) #

[View source]
def convert_x_to_js(item : X, rt) : X #

[View source]
def env : Hash(String, AST::Expression | X) #

[View source]
def fetch_ext_code_replacement_value(param) #

[View source]
def fetch_function_definition(fn_name : String) #

[View source]
def interpret(ast : Nil | Axal::AST::Program) #

[View source]
def interpret_array_list(array : AST::ArrayList) : X #

[View source]
def interpret_binary_operator(binary_op) #

ameba:disable Metrics/CyclomaticComplexity


[View source]
def interpret_boolean(boolean) #

[View source]
def interpret_chained_function_call(fn_call : AST::FunctionCall, param1) #

[View source]
def interpret_conditional(conditional) #

TODO Empty blocks are accepted both for the IF and for the ELSE. For the IF, the parser returns a block with an empty collection of expressions. For the else, no block is constructed. The evaluation is already resulting in nil, which is the desired behavior. It would be better, however, if the parser also returned a block with no expressions for an ELSE with an empty block, as is the case in an IF with an empty block. Investigate this nuance of the parser in the future.


[View source]
def interpret_describe_definition(desc_def) #

[View source]
def interpret_duktape(value : Duktape::JSPrimitive) #

[View source]
def interpret_duktape_array(value : Array(Duktape::JSPrimitive)) : X #

[View source]
def interpret_duktape_hash(value : Hash(String, Duktape::JSPrimitive)) : X #

[View source]
def interpret_external_code(external_code) : X #

find variables in the external code and fetch from local or global


[View source]
def interpret_fetch(url) #

[View source]
def interpret_function_call(fn_call : AST::FunctionCall) #

[View source]
def interpret_function_chain(chain : AST::FunctionChain) #

[View source]
def interpret_function_definition(fn_def) #

[View source]
def interpret_identifier(identifier) #

[View source]
def interpret_it_definition(it_def) #

[View source]
def interpret_json(json : AST::Json) #

[View source]
def interpret_module_definition(mod_def) #

[View source]
def interpret_nested_json(json : AST::Json) #

[View source]
def interpret_nil(nil_node) #

[View source]
def interpret_node(node) #

ameba:disable Metrics/CyclomaticComplexity


[View source]
def interpret_nodes(nodes) #

[View source]
def interpret_number(number) : Float64 #

[View source]
def interpret_repetition(repetition) #

[View source]
def interpret_return(ret) #

[View source]
def interpret_string(string) #

[View source]
def interpret_unary_operator(unary_op) #

[View source]
def interpret_var_binding(var_binding) #

[View source]
def output : Array(String) #

[View source]
def output=(output : Array(String)) #

[View source]
def println(fn_call) #

[View source]
def println_chained(result) #

Built in functions


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

[View source]
def replace_external_code_variables(external_code, rt) #

[View source]
def return_detected?(node) #

[View source]
def test_output : Hash(String, Array(TestResult)) #

[View source]
def test_output=(test_output : Hash(String, Array(TestResult))) #

[View source]
def unwind_call_stack : Int32 #

[View source]
def unwind_call_stack=(unwind_call_stack : Int32) #

[View source]