mirror of
https://codeberg.org/ProgramSnail/lang_2023.git
synced 2025-12-09 16:38:45 +00:00
access syntax changed, sync with grammar, type_chack_visitor in progress
This commit is contained in:
parent
3d74b1383e
commit
6fc91aafa0
19 changed files with 110221 additions and 102967 deletions
|
|
@ -34,6 +34,12 @@ void LinkSymbolsVisitor::Visit(Partition* node) {
|
|||
}
|
||||
|
||||
void LinkSymbolsVisitor::Visit(Namespace* node) {
|
||||
node->type_id_ = namespace_visitor_.FindType({}, node->type);
|
||||
|
||||
if (node->name.has_value() && !node->type_id_.has_value()) {
|
||||
error_handling::HandleTypecheckError("Variable namespace type not found");
|
||||
}
|
||||
|
||||
namespace_visitor_.EnterNamespace(node->type);
|
||||
Visit(node->scope.get());
|
||||
namespace_visitor_.ExitNamespace();
|
||||
|
|
@ -203,6 +209,11 @@ void LinkSymbolsVisitor::Visit(ReferenceExpression* node) {
|
|||
Visit(node->expression.get());
|
||||
}
|
||||
|
||||
void LinkSymbolsVisitor::Visit(AccessExpression* node) {
|
||||
Visitor::Visit(node->name.get());
|
||||
Visitor::Visit(node->id);
|
||||
}
|
||||
|
||||
// Other Expressions
|
||||
|
||||
void LinkSymbolsVisitor::Visit(FunctionCallExpression* node) {
|
||||
|
|
@ -257,9 +268,9 @@ void LinkSymbolsVisitor::Visit(NameExpression* node) {
|
|||
for (auto& variable_namespace : node->namespaces) {
|
||||
Visitor::Visit(variable_namespace);
|
||||
}
|
||||
for (auto& expression : node->expressions) {
|
||||
Visitor::Visit(expression);
|
||||
}
|
||||
// for (auto& expression : node->expressions) {
|
||||
// Visit(expression);
|
||||
// }
|
||||
}
|
||||
|
||||
void LinkSymbolsVisitor::Visit(TupleName* node) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue