visitProgramElement method
Implementation
@override
List<Library> visitProgramElement(ProgramElement programElement) {
final library = Library((builder) {
for (final import in programElement.imports) {
final [element] = import.accept(this) as List<Directive>;
builder.directives.add(element);
}
for (final declaration in programElement.declarations) {
final elements = declaration.accept(this);
if (elements != null) {
builder.body.addAll(elements);
}
}
});
return [library];
}