diff options
| author | Eugen Wissner <belka@caraus.de> | 2026-09-27 11:23:17 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2026-09-27 11:23:17 +0200 |
| commit | c57a24b9fe37e233e7ec0e2e65405738d9c09c6e (patch) | |
| tree | 99b5f4dc22d27d8159c3ba76f2cf3a455ed37fb6 /boot/materialization.cc | |
| parent | d048b633dd02014f8bff1b512ce4d5ae2b8b7903 (diff) | |
| download | elna-c57a24b9fe37e233e7ec0e2e65405738d9c09c6e.tar.gz | |
Reuse container visiting logic
Diffstat (limited to 'boot/materialization.cc')
| -rw-r--r-- | boot/materialization.cc | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/boot/materialization.cc b/boot/materialization.cc index 0ca81aa..6eea0d1 100644 --- a/boot/materialization.cc +++ b/boot/materialization.cc @@ -48,6 +48,19 @@ namespace elna::boot { } + void materialization_visitor::visit(unit *unit) + { + visit_all(this, unit->imports); + visit_all(this, unit->declarations); + + this->in_global_scope = false; + if (unit->entry_point.has_value()) + { + visit_all(this, unit->entry_point.value()); + } + this->in_global_scope = true; + } + void materialization_visitor::visit(procedure_declaration *declaration) { this->in_global_scope = false; @@ -144,11 +157,4 @@ namespace elna::boot materialization_error::kind::real_overflow); } } - - void materialization_visitor::visit_entry_point(unit *unit) - { - this->in_global_scope = false; - walking_visitor::visit_entry_point(unit); - this->in_global_scope = true; - } } |
