From c57a24b9fe37e233e7ec0e2e65405738d9c09c6e Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Sun, 27 Sep 2026 11:23:17 +0200 Subject: Reuse container visiting logic --- boot/materialization.cc | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'boot/materialization.cc') 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; - } } -- cgit v1.2.3