class Myst::Interpreter

Defined in:

myst/interpreter.cr
myst/interpreter/kernel.cr
myst/interpreter/matcher.cr
myst/interpreter/native_lib/boolean.cr
myst/interpreter/native_lib/file_utils.cr
myst/interpreter/native_lib/float.cr
myst/interpreter/native_lib/integer.cr
myst/interpreter/native_lib/io.cr
myst/interpreter/native_lib/list.cr
myst/interpreter/native_lib/map.cr
myst/interpreter/native_lib/nil.cr
myst/interpreter/native_lib/string.cr
myst/interpreter/native_lib/symbol.cr
myst/interpreter/native_lib/time.cr
myst/interpreter/native_lib/top_level.cr
myst/interpreter/nodes/anonymous_function.cr
myst/interpreter/nodes/binary_ops.cr
myst/interpreter/nodes/call.cr
myst/interpreter/nodes/conditionals.cr
myst/interpreter/nodes/control_exprs.cr
myst/interpreter/nodes/def.cr
myst/interpreter/nodes/exception_handler.cr
myst/interpreter/nodes/expressions.cr
myst/interpreter/nodes/extend.cr
myst/interpreter/nodes/function_capture.cr
myst/interpreter/nodes/include.cr
myst/interpreter/nodes/instantiation.cr
myst/interpreter/nodes/interpolation.cr
myst/interpreter/nodes/literals.cr
myst/interpreter/nodes/loops.cr
myst/interpreter/nodes/magic_const.cr
myst/interpreter/nodes/match_assign.cr
myst/interpreter/nodes/module_def.cr
myst/interpreter/nodes/nop.cr
myst/interpreter/nodes/op_assign.cr
myst/interpreter/nodes/raise.cr
myst/interpreter/nodes/references.cr
myst/interpreter/nodes/require.cr
myst/interpreter/nodes/self.cr
myst/interpreter/nodes/simple_assign.cr
myst/interpreter/nodes/type_def.cr
myst/interpreter/nodes/unary_ops.cr
myst/interpreter/util.cr

Constructors

Macro Summary

Instance Method Summary

Constructor Detail

def self.new(input : IO = STDIN, output : IO = STDOUT, errput : IO = STDERR) #

[View source]

Macro Detail

macro __disallow_primitives(value, operation = nil) #

Primitive types have some restrictions on functionality. This method will raise an appropriate error if the given value is a primitive. If operation is given, it will be used as the error message.


[View source]

Instance Method Detail

def __scopeof(value : Value) : Scope #

Resolve the Scope for value. For primitives, this returns the instance scope of the Type for that value. For Instances, Types, and Modules, this just returns .scope for that value.


[View source]
def __typeof(value : Value) #

Resolve the TType object representing the type of value. For primitive types, these are always looked up in the Kernel. For Instances, the type is looked up from the type reference on the instance itself. For Types and Modules, the value itself is returned.


[View source]
def bool_eq(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def bool_not_eq(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def bool_to_s(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def callstack : Callstack #

[View source]
def callstack=(callstack : Callstack) #

[View source]
def create_kernel : TModule #

[View source]
def current_scope #

[View source]
def current_self #

[View source]
def errput : IO #

[View source]
def errput=(errput : IO) #

[View source]
def float_add(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def float_divide(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def float_eq(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def float_gt(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def float_gte(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def float_lt(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def float_lte(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def float_modulo(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def float_multiply(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def float_negate(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def float_not_eq(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def float_subtract(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def float_to_s(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def fs_utils_close(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def fs_utils_open(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def fs_utils_read(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def fs_utils_read_all(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def fs_utils_size(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def fs_utils_write(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def init_boolean(kernel : TModule) #

[View source]
def init_file_utils(kernel : TModule) #

[View source]
def init_float(kernel : TModule) #

[View source]
def init_integer(kernel : TModule) #

[View source]
def init_io(kernel : TModule) #

[View source]
def init_list(kernel : TModule) #

[View source]
def init_map(kernel : TModule) #

[View source]
def init_nil(kernel : TModule) #

[View source]
def init_string(kernel : TModule) #

[View source]
def init_symbol(kernel : TModule) #

[View source]
def init_time(kernel : TModule) #

[View source]
def init_top_level(kernel : TModule) #

[View source]
def input : IO #

[View source]
def input=(input : IO) #

[View source]
def int_add(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def int_divide(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def int_eq(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def int_gt(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def int_gte(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def int_lt(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def int_lte(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def int_modulo(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def int_multiply(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def int_negate(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def int_not_eq(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def int_subtract(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def int_to_s(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def io_gets(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def io_print(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def io_puts(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def kernel : TModule #

[View source]
def kernel=(kernel : TModule) #

[View source]
def list_access(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def list_access_assign(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def list_add(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def list_each(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def list_eq(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def list_minus(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def list_proper_subset(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def list_size(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def list_splat(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def list_subset(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def load_dirs #

The set of directories that should be considered when performing lookups with bare paths (not explicitly relative).


[View source]
def loaded_files : Hash(String, Bool) #

A Hash of entries indicating files that have already been loaded. Entries in this Hash should always be absolute paths to avoid ambiguity between relative paths that resolve to the same file.


[View source]
def loaded_files=(loaded_files : Hash(String, Bool)) #

A Hash of entries indicating files that have already been loaded. Entries in this Hash should always be absolute paths to avoid ambiguity between relative paths that resolve to the same file.


[View source]
def lookup(node) #

Lookup a value under the given name in the current scope or one of its ancestors. If the value is not found, a No variable or method RuntimeError will be raised.


[View source]
def map_add(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def map_each(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def map_proper_subset(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def map_size(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def map_subset(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def match(pattern : Node, value : Value) #

[View source]
def mt_exit(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def nil_eq(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def nil_not_eq(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def nil_to_s(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def output : IO #

[View source]
def output=(output : IO) #

[View source]
def pop_scope_override(to_size : Int) #

[View source]
def pop_scope_override #

[View source]
def pop_self(to_size : Int) #

[View source]
def pop_self #

[View source]
def push_scope_override(scope : Scope = Scope.new) #

[View source]
def push_self(new_self : Value) #

[View source]
def put_error(error : RuntimeError) #

[View source]
def raise_not_found(name, value) #

[View source]
def recursive_lookup(receiver, name) #

Attempt to lookup the given name recursively through the ancestry of the given receiver. This is mainly used for method lookup, where the simple #lookup method does not search deep enough for a value.

The method will return nil if no matching entry is found.


[View source]
def run(program) #

[View source]
def scope_override #

[View source]
def self_stack : Array(Value) #

[View source]
def self_stack=(self_stack : Array(Value)) #

[View source]
def stack : Array(Value) #

[View source]
def stack=(stack : Array(Value)) #

[View source]
def static_time_now(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def string_add(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def string_eq(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def string_multiply(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def string_not_eq(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def string_size(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def string_split(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def string_to_s(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def symbol_eq(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def symbol_not_eq(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def symbol_to_s(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def time_subtract(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def time_to_s(this : Value, __args : Array(Value), block : TFunctor | Nil) : Value #

[View source]
def visit(node : AnonymousFunction) #

[View source]
def visit(node : And) #

The result of either expression, in any case, will be the value that determined the result. i.e., in the expression true && false, the result will be false, while nil && false will result in nil.


[View source]
def visit(node : Or) #

[View source]
def visit(node : Call) #

[View source]
def visit(node : When) #

[View source]
def visit(node : Unless) #

[View source]
def visit(node : Return) #

[View source]
def visit(node : Break) #

[View source]
def visit(node : Next) #

[View source]
def visit(node : Def) #

[View source]
def visit(node : ExceptionHandler) #

[View source]
def visit(node : Expressions) #

[View source]
def visit(node : Extend) #

[View source]
def visit(node : FunctionCapture) #

[View source]
def visit(node : Include) #

[View source]
def visit(node : Instantiation) #

[View source]
def visit(node : ValueInterpolation) #

[View source]
def visit(node : ListLiteral) #

[View source]
def visit(node : MapLiteral) #

[View source]
def visit(node : InterpolatedStringLiteral) #

[View source]
def visit(node : Literal) #

[View source]
def visit(node : While) #

[View source]
def visit(node : Until) #

[View source]
def visit(node : MagicConst) #

[View source]
def visit(node : MatchAssign) #

[View source]
def visit(node : ModuleDef) #

[View source]
def visit(node : Nop) #

[View source]
def visit(node : OpAssign) #

[View source]
def visit(node : Raise) #

[View source]
def visit(node : Var) #

[View source]
def visit(node : IVar) #

[View source]
def visit(node : Const) #

[View source]
def visit(node : Underscore) #

[View source]
def visit(node : Require) #

[View source]
def visit(node : Self) #

[View source]
def visit(node : SimpleAssign) #

[View source]
def visit(node : TypeDef) #

[View source]
def visit(node : Negation) #

[View source]
def visit(node : Not) #

[View source]
def visit(node : Splat) #

[View source]
def visit(node : Node) #

[View source]
def visit_and_assign(node : OpAssign) #

[View source]
def visit_or_assign(node : OpAssign) #

[View source]
def warn(message : String, node : Node) #

[View source]
def warnings : Int32 #

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

[View source]