for nmodule in nmodules do
self.info("Semantic analysis module {nmodule.location.file.filename}", 2)
+
+ var vannot = new AnnotationPhaseVisitor
+ vannot.enter_visit(nmodule)
+
for phase in phases do
if phase.disabled then continue
self.info(" phase: {phase}", 3)
self.check_errors
break
end
- var v = new AnnotationPhaseVisitor(phase)
- v.enter_visit(nmodule)
+ for na in vannot.annotations do
+ phase.process_annotated_node(na.parent.parent.as(not null), na)
+ end
if errcount != self.error_count then
self.check_errors
break
end
end
+# Collect all annotation
private class AnnotationPhaseVisitor
super Visitor
- var phase: Phase
-
- init(phase: Phase) do self.phase = phase
+ # The collected annotations
+ var annotations = new Array[AAnnotation]
redef fun visit(n)
do
n.visit_all(self)
- if n isa AAnnotation then phase.process_annotated_node(n.parent.parent.as(not null), n)
+ if n isa AAnnotation then annotations.add n
end
end