75 auto with_saved_scope(
auto&& callback) {
77 auto saved_scope =
scope;
91 template <
typename T>
void statement([[maybe_unused]] T& stat) {
92 throw std::runtime_error(
"Type walker stubbed on statement "s + stat.kind_name());
95 template <
typename T>
void expression([[maybe_unused]] T& expr) {
96 throw std::runtime_error(
"Type walker stubbed on expression "s + expr.kind_name());
The Compiler the the primary top-level type during compilation. A single instance is created during t...
All nodes in the AST tree of the program inherit from this class.
Expressions have an associated value and type.
Statements make up most things in source code.
A type annotation. This (ast::Type) is distinct from the actual type of a value (ty::Type).
A "qualified" type, with a non-stackable qualifier, i.e. mut.
OptionalAnyBase< Expr > OptionalExpr
void make_implicit_conversion(ast::OptionalExpr &expr, optional< ty::Type > target_ty)
A helper template to walk the Abstract Syntax Tree (AST), utilizing the Curiously Recurring Template ...
A common base between declarations in the compiler: Fn, Struct and Const. Its value may also be absen...
A function declaration in the compiler.
A struct declaration in the compiler.
A function call or operator.
A construction of a struct or cast of a primitive.
Determine the type information of AST nodes. This makes up most of the "semantic" phase of the compil...
auto make_dup(ast::AnyExpr &expr) -> Fn *
std::queue< DeclLike > decl_queue
void body_statement(ast::Stmt &)
void body_expression(ast::Expr &)
vector< ASTWithName > closured
vector< scope_t > enclosing_scopes
TypeWalker(Compiler &compiler)
bool in_depth
Whether or not to compile the bodies of methods. Initially, on the parameter types of methods are tra...