mirror of
https://codeberg.org/ProgramSnail/lang_2023.git
synced 2025-12-29 10:18:46 +00:00
started to develop build_visitor
This commit is contained in:
parent
195c536620
commit
d1cd6d4b83
9 changed files with 879 additions and 28 deletions
|
|
@ -62,6 +62,11 @@ void PrintVisitor::Visit(Partition* node) {
|
|||
void PrintVisitor::Visit(Namespace* node) {
|
||||
out_ << "<Namespace> ";
|
||||
if (std::holds_alternative<std::unique_ptr<DefinedAnnotatedName>>(node->name)) {
|
||||
if (node->is_const) {
|
||||
out_ << "const ";
|
||||
} else {
|
||||
out_ << "var ";
|
||||
}
|
||||
Visit(std::get<std::unique_ptr<DefinedAnnotatedName>>(node->name).get());
|
||||
} else if (std::holds_alternative<std::unique_ptr<DefinedType>>(node->name)) {
|
||||
Visit(std::get<std::unique_ptr<DefinedType>>(node->name).get());
|
||||
|
|
@ -342,6 +347,17 @@ void PrintVisitor::Visit(ScopedStatement* node) {
|
|||
out_ << " ) </Scoped>";
|
||||
}
|
||||
|
||||
void PrintVisitor::Visit(LoopControlExpression& node) { // enum
|
||||
switch (node) {
|
||||
case LoopControlExpression::Break:
|
||||
out_ << "<Break/>\n";
|
||||
break;
|
||||
case LoopControlExpression::Continue:
|
||||
out_ << "<Continue/>\n";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Operators
|
||||
|
||||
void PrintVisitor::Visit(BinaryOperatorExpression* node) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue