Currently, we mix all syntax trees into a collection and when an import statement referencing the syntax tree we insert the tree into another collection. That's not very efficient.
Proposed Solution
I propose we search all global statements for imports in the BindGlobalScope method and then see if the file name referenced in the import corresponds to a syntax tree. If it does, we'll add it to the _importedTrees collection and allow it's child methods to be referenced. This will also illegalize import statements outside the global scope.
Background and Motivation
Currently, we mix all syntax trees into a collection and when an import statement referencing the syntax tree we insert the tree into another collection. That's not very efficient.
Proposed Solution
I propose we search all global statements for imports in the
BindGlobalScope
method and then see if the file name referenced in the import corresponds to a syntax tree. If it does, we'll add it to the_importedTrees
collection and allow it's child methods to be referenced. This will also illegalizeimport
statements outside the global scope.