mirror of
https://codeberg.org/ProgramSnail/lang.git
synced 2025-12-05 22:48:43 +00:00
type check, some additions
This commit is contained in:
parent
8bce645431
commit
48c9e200be
2 changed files with 111 additions and 16 deletions
|
|
@ -1,46 +1,75 @@
|
|||
#pragma once
|
||||
|
||||
#include "expression_nodes.hpp"
|
||||
#include "name_tree.hpp"
|
||||
#include "type_nodes.hpp"
|
||||
|
||||
// IN PROGRESS
|
||||
|
||||
namespace type_check {
|
||||
|
||||
void type_check_expression(const nodes::Expression &expression);
|
||||
void type_check_expression(const nodes::Expression &expression,
|
||||
nodes::TypeStorage &type_storage,
|
||||
names::NameTree &name_tree);
|
||||
|
||||
// --- flow control
|
||||
|
||||
void type_check_case(const nodes::Match::Case &expression);
|
||||
void type_check_case(const nodes::Match::Case &expression,
|
||||
nodes::TypeStorage &type_storage,
|
||||
names::NameTree &name_tree);
|
||||
|
||||
void type_check_match(const nodes::Match &expression);
|
||||
void type_check_match(const nodes::Match &expression,
|
||||
nodes::TypeStorage &type_storage,
|
||||
names::NameTree &name_tree);
|
||||
|
||||
void type_check_condition(const nodes::Condition &expression);
|
||||
void type_check_condition(const nodes::Condition &expression,
|
||||
nodes::TypeStorage &type_storage,
|
||||
names::NameTree &name_tree);
|
||||
|
||||
void type_check_loop(const nodes::Loop &expression);
|
||||
void type_check_loop(const nodes::Loop &expression,
|
||||
nodes::TypeStorage &type_storage,
|
||||
names::NameTree &name_tree);
|
||||
|
||||
// --- containers
|
||||
|
||||
void type_check_container(const nodes::Container &expression);
|
||||
void type_check_container(const nodes::Container &expression,
|
||||
nodes::TypeStorage &type_storage,
|
||||
names::NameTree &name_tree);
|
||||
|
||||
// --- modifiers
|
||||
|
||||
void type_check_return(const nodes::Return &expression);
|
||||
void type_check_return(const nodes::Return &expression,
|
||||
nodes::TypeStorage &type_storage,
|
||||
names::NameTree &name_tree);
|
||||
|
||||
void type_check_name_definition(const nodes::NameDefinition &expression);
|
||||
void type_check_name_definition(const nodes::NameDefinition &expression,
|
||||
nodes::TypeStorage &type_storage,
|
||||
names::NameTree &name_tree);
|
||||
|
||||
void type_check_access(const nodes::Access &expression);
|
||||
void type_check_access(const nodes::Access &expression,
|
||||
nodes::TypeStorage &type_storage,
|
||||
names::NameTree &name_tree);
|
||||
|
||||
void type_check_loop_control(const nodes::LoopControl &expression);
|
||||
void type_check_loop_control(const nodes::LoopControl &expression,
|
||||
nodes::TypeStorage &type_storage,
|
||||
names::NameTree &name_tree);
|
||||
|
||||
void type_check_modifier_expression(
|
||||
const nodes::ModifierExpression &expression);
|
||||
void type_check_modifier_expression(const nodes::ModifierExpression &expression,
|
||||
nodes::TypeStorage &type_storage,
|
||||
names::NameTree &name_tree);
|
||||
|
||||
// --- other
|
||||
|
||||
void type_check_name_expression(const nodes::NameExpression &expression);
|
||||
void type_check_name_expression(const nodes::NameExpression &expression,
|
||||
nodes::TypeStorage &type_storage,
|
||||
names::NameTree &name_tree);
|
||||
|
||||
void type_check_constructor(const nodes::Constructor &expression);
|
||||
void type_check_constructor(const nodes::Constructor &expression,
|
||||
nodes::TypeStorage &type_storage,
|
||||
names::NameTree &name_tree);
|
||||
|
||||
void type_check_lambda(const nodes::Lambda &expression);
|
||||
void type_check_lambda(const nodes::Lambda &expression,
|
||||
nodes::TypeStorage &type_storage,
|
||||
names::NameTree &name_tree);
|
||||
|
||||
} // namespace type_check
|
||||
|
|
|
|||
|
|
@ -1,3 +1,69 @@
|
|||
#include "expression_type_check.hpp"
|
||||
|
||||
namespace type_check {} // namespace type_check
|
||||
namespace type_check {
|
||||
|
||||
void type_check_expression(const nodes::Expression &expression,
|
||||
nodes::TypeStorage &type_storage,
|
||||
names::NameTree &name_tree) {}
|
||||
|
||||
// --- flow control
|
||||
|
||||
void type_check_case(const nodes::Match::Case &expression,
|
||||
nodes::TypeStorage &type_storage,
|
||||
names::NameTree &name_tree) {}
|
||||
|
||||
void type_check_match(const nodes::Match &expression,
|
||||
nodes::TypeStorage &type_storage,
|
||||
names::NameTree &name_tree) {}
|
||||
|
||||
void type_check_condition(const nodes::Condition &expression,
|
||||
nodes::TypeStorage &type_storage,
|
||||
names::NameTree &name_tree) {}
|
||||
|
||||
void type_check_loop(const nodes::Loop &expression,
|
||||
nodes::TypeStorage &type_storage,
|
||||
names::NameTree &name_tree) {}
|
||||
|
||||
// --- containers
|
||||
|
||||
void type_check_container(const nodes::Container &expression,
|
||||
nodes::TypeStorage &type_storage,
|
||||
names::NameTree &name_tree) {}
|
||||
|
||||
// --- modifiers
|
||||
|
||||
void type_check_return(const nodes::Return &expression,
|
||||
nodes::TypeStorage &type_storage,
|
||||
names::NameTree &name_tree) {}
|
||||
|
||||
void type_check_name_definition(const nodes::NameDefinition &expression,
|
||||
nodes::TypeStorage &type_storage,
|
||||
names::NameTree &name_tree) {}
|
||||
|
||||
void type_check_access(const nodes::Access &expression,
|
||||
nodes::TypeStorage &type_storage,
|
||||
names::NameTree &name_tree) {}
|
||||
|
||||
void type_check_loop_control(const nodes::LoopControl &expression,
|
||||
nodes::TypeStorage &type_storage,
|
||||
names::NameTree &name_tree) {}
|
||||
|
||||
void type_check_modifier_expression(const nodes::ModifierExpression &expression,
|
||||
nodes::TypeStorage &type_storage,
|
||||
names::NameTree &name_tree) {}
|
||||
|
||||
// --- other
|
||||
|
||||
void type_check_name_expression(const nodes::NameExpression &expression,
|
||||
nodes::TypeStorage &type_storage,
|
||||
names::NameTree &name_tree) {}
|
||||
|
||||
void type_check_constructor(const nodes::Constructor &expression,
|
||||
nodes::TypeStorage &type_storage,
|
||||
names::NameTree &name_tree) {}
|
||||
|
||||
void type_check_lambda(const nodes::Lambda &expression,
|
||||
nodes::TypeStorage &type_storage,
|
||||
names::NameTree &name_tree) {}
|
||||
|
||||
} // namespace type_check
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue