mirror of
https://codeberg.org/ProgramSnail/lang_2023.git
synced 2025-12-06 06:58:45 +00:00
grammar refactoring: part of build_visitor fixed
This commit is contained in:
parent
2d2bb9ec65
commit
64653e6a6a
6 changed files with 245 additions and 404 deletions
|
|
@ -60,13 +60,17 @@ void PrintVisitor::Visit(Partition* node) {
|
|||
void PrintVisitor::Visit(Namespace* node) {
|
||||
out_ << "[Namespace] ";
|
||||
if (node->name.has_value()) {
|
||||
switch (node->modifier) {
|
||||
case Namespace::Const:
|
||||
out_ << "const ";
|
||||
break;
|
||||
case Namespace::Var:
|
||||
out_ << "var ";
|
||||
break;
|
||||
if (node->modifier.has_value()) {
|
||||
switch (node->modifier.value()) {
|
||||
case Namespace::Const:
|
||||
out_ << "const ";
|
||||
break;
|
||||
case Namespace::Var:
|
||||
out_ << "var ";
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
// error
|
||||
}
|
||||
Visit(&node->name.value());
|
||||
}
|
||||
|
|
@ -647,6 +651,10 @@ void PrintVisitor::Visit(TypeclassExpression* node) {
|
|||
|
||||
// Identifiers, constants, etc. -----------------
|
||||
|
||||
void PrintVisitor::Visit(ExtendedName* node) {
|
||||
out_ << "[ExtendedName " << node->name << "] ";
|
||||
}
|
||||
|
||||
void PrintVisitor::Visit(AnyIdentifier* node) { // std::string
|
||||
out_ << "[Identifier " << *node << "] ";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue