mirror of
https://codeberg.org/ProgramSnail/lang_2023.git
synced 2025-12-06 06:58: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
|
|
@ -389,10 +389,10 @@ void PrintVisitor::Visit(ReferenceExpression* node) {
|
|||
out_ << "[ReferenceExpression ";
|
||||
for (auto& reference : node->references) {
|
||||
switch (reference) {
|
||||
case ReferenceType::Reference:
|
||||
case utils::ReferenceType::Reference:
|
||||
out_ << '~';
|
||||
break;
|
||||
case ReferenceType::UniqueReference:
|
||||
case utils::ReferenceType::UniqueReference:
|
||||
out_ << '@';
|
||||
break;
|
||||
}
|
||||
|
|
@ -402,6 +402,14 @@ void PrintVisitor::Visit(ReferenceExpression* node) {
|
|||
out_ << ')';
|
||||
}
|
||||
|
||||
void PrintVisitor::Visit(AccessExpression* node) {
|
||||
out_ << "[AccessExpression] (";
|
||||
Visit(node->name.get());
|
||||
out_ << ") : (";
|
||||
Visitor::Visit(node->id);
|
||||
out_ << ')';
|
||||
}
|
||||
|
||||
// Other Expressions
|
||||
|
||||
void PrintVisitor::Visit(FunctionCallExpression* node) {
|
||||
|
|
@ -499,7 +507,7 @@ void PrintVisitor::Visit(NameExpression* node) {
|
|||
out_ << '.';
|
||||
}
|
||||
for (size_t i = 0; i < node->expressions.size(); ++i) {
|
||||
Visitor::Visit(node->expressions[i]);
|
||||
Visit(&node->expressions[i]);
|
||||
if (i + 1 < node->expressions.size()) {
|
||||
out_ << '.';
|
||||
}
|
||||
|
|
@ -619,10 +627,10 @@ void PrintVisitor::Visit(ExtendedScopedAnyType* node) {
|
|||
out_ << "[ExtendedScopedAnyType ";
|
||||
for (auto& reference : node->references) {
|
||||
switch (reference) {
|
||||
case ReferenceType::Reference:
|
||||
case utils::ReferenceType::Reference:
|
||||
out_ << '~';
|
||||
break;
|
||||
case ReferenceType::UniqueReference:
|
||||
case utils::ReferenceType::UniqueReference:
|
||||
out_ << '@';
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue