class Cosmo::Resolver

Overview

This class is responsible for resolving declared/defined variables in the scope. I'm about 70% sure that it doesn't work as intended currently. lol

Included Modules

Defined in:

cosmo/runtime/resolver.cr

Constructors

Instance Method Summary

Instance methods inherited from module Cosmo::AST::Statement::Visitor(Nil)

visit_block_stmt(stmt : Block) : R visit_block_stmt, visit_break_stmt(stmt : Break) : R visit_break_stmt, visit_case_stmt(stmt : Case) : R visit_case_stmt, visit_class_def_stmt(stmt : ClassDef) : R visit_class_def_stmt, visit_every_stmt(stmt : Every) : R visit_every_stmt, visit_fn_def_stmt(stmt : FunctionDef) : R visit_fn_def_stmt, visit_if_stmt(stmt : If) : R visit_if_stmt, visit_next_stmt(stmt : Next) : R visit_next_stmt, visit_return_stmt(stmt : Return) : R visit_return_stmt, visit_single_expr_stmt(stmt : SingleExpression) : R visit_single_expr_stmt, visit_throw_stmt(stmt : Throw) : R visit_throw_stmt, visit_try_catch_stmt(stmt : TryCatch) : R visit_try_catch_stmt, visit_unless_stmt(stmt : Unless) : R visit_unless_stmt, visit_until_stmt(stmt : Until) : R visit_until_stmt, visit_use_stmt(stmt : Use) : R visit_use_stmt, visit_while_stmt(stmt : While) : R visit_while_stmt

Instance methods inherited from module Cosmo::AST::Expression::Visitor(Nil)

visit_binary_op_expr(expr : BinaryOp) : R visit_binary_op_expr, visit_cast_expr(expr : Cast) : R visit_cast_expr, visit_fn_call_expr(expr : FunctionCall) : R visit_fn_call_expr, visit_is_expr(expr : Is) : R visit_is_expr, visit_is_in_expr(expr : IsIn) : R visit_is_in_expr, visit_lambda_expr(expr : Lambda) : R visit_lambda_expr, visit_literal_expr(expr : Literal) : R visit_literal_expr, visit_multiple_assignment_expr(expr : MultipleAssignment) : R visit_multiple_assignment_expr, visit_property_assignment_expr(expr : PropertyAssignment) : R visit_property_assignment_expr, visit_range_literal_expr(expr : RangeLiteral) : R visit_range_literal_expr, visit_string_interpolation_expr(expr : StringInterpolation) : R visit_string_interpolation_expr, visit_table_literal_expr(expr : TableLiteral) : R visit_table_literal_expr, visit_ternary_op_expr(expr : TernaryOp) : R visit_ternary_op_expr, visit_this_expr(expr : This) : R visit_this_expr, visit_type_alias_expr(expr : TypeAlias) : R visit_type_alias_expr, visit_type_ref_expr(expr : TypeRef) : R visit_type_ref_expr, visit_unary_op_expr(expr : UnaryOp) : R visit_unary_op_expr, visit_var_assignment_expr(expr : VarAssignment) : R visit_var_assignment_expr, visit_var_declaration_expr(expr : VarDeclaration) : R visit_var_declaration_expr, visit_var_expr(expr : Var) : R visit_var_expr, visit_vector_literal_expr(expr : VectorLiteral) : R visit_vector_literal_expr

Constructor Detail

def self.new(interpreter : Interpreter) #

[View source]

Instance Method Detail

def resolve(statements : Expression::Base | Statement::Base | Array(Statement::Base)) : Nil #

[View source]
def start_time : Time::Span #

[View source]
def visit_access_expr(expr : Expression::Access) : Nil #

[View source]
def visit_binary_op_expr(expr : Expression::BinaryOp) : Nil #

[View source]
def visit_block_stmt(stmt : Statement::Block) : Nil #

[View source]
def visit_break_stmt(stmt : Statement::Break) : Nil #

[View source]
def visit_case_stmt(stmt : Statement::Case) : Nil #

[View source]
def visit_cast_expr(expr : Expression::Cast) : Nil #

[View source]
def visit_class_def_stmt(stmt : Statement::ClassDef) : Nil #
Description copied from module Cosmo::AST::Statement::Visitor(Nil)

abstract def visit_enum_def_stmt(stmt : EnumDef) : R


[View source]
def visit_compound_assignment_expr(expr : Expression::CompoundAssignment) : Nil #

[View source]
def visit_every_stmt(stmt : Statement::Every) : Nil #

[View source]
def visit_fn_call_expr(expr : Expression::FunctionCall) : Nil #

[View source]
def visit_fn_def_stmt(stmt : Statement::FunctionDef) : Nil #

[View source]
def visit_if_stmt(stmt : Statement::If) : Nil #

[View source]
def visit_index_expr(expr : Expression::Index) : Nil #

[View source]
def visit_is_expr(expr : Expression::Is) : Nil #

[View source]
def visit_is_in_expr(expr : Expression::IsIn) : Nil #

[View source]
def visit_lambda_expr(expr : Expression::Lambda) : Nil #

[View source]
def visit_literal_expr(expr : Expression::Literal) : Nil #

[View source]
def visit_multiple_assignment_expr(expr : Expression::MultipleAssignment) : Nil #

[View source]
def visit_multiple_declaration_expr(expr : Expression::MultipleDeclaration) : Nil #

[View source]
def visit_new_expr(expr : Expression::New) : Nil #

[View source]
def visit_next_stmt(stmt : Statement::Next) : Nil #

[View source]
def visit_property_assignment_expr(expr : Expression::PropertyAssignment) : Nil #

[View source]
def visit_range_literal_expr(expr : Expression::RangeLiteral) : Nil #

[View source]
def visit_return_stmt(stmt : Statement::Return) : Nil #

[View source]
def visit_single_expr_stmt(stmt : Statement::SingleExpression) : Nil #

[View source]
def visit_string_interpolation_expr(expr : Expression::StringInterpolation) : Nil #

[View source]
def visit_table_literal_expr(expr : Expression::TableLiteral) : Nil #

[View source]
def visit_ternary_op_expr(expr : Expression::TernaryOp) : Nil #

[View source]
def visit_this_expr(expr : Expression::This) : Nil #

[View source]
def visit_throw_stmt(stmt : Statement::Throw) : Nil #

[View source]
def visit_try_catch_stmt(stmt : Statement::TryCatch) : Nil #

[View source]
def visit_type_alias_expr(expr : Expression::TypeAlias) : Nil #

[View source]
def visit_type_ref_expr(expr : Expression::TypeRef) : Nil #

[View source]
def visit_unary_op_expr(expr : Expression::UnaryOp) : Nil #

[View source]
def visit_unless_stmt(stmt : Statement::Unless) : Nil #

[View source]
def visit_until_stmt(stmt : Statement::Until) : Nil #

[View source]
def visit_use_stmt(stmt : Statement::Use) : Nil #

[View source]
def visit_var_assignment_expr(expr : Expression::VarAssignment) : Nil #

[View source]
def visit_var_declaration_expr(expr : Expression::VarDeclaration) : Nil #

[View source]
def visit_var_expr(expr : Expression::Var) : Nil #

[View source]
def visit_vector_literal_expr(expr : Expression::VectorLiteral) : Nil #

[View source]
def visit_while_stmt(stmt : Statement::While) : Nil #

[View source]