Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📎 Move semantic model to scanner #5312

Open
arendjr opened this issue Mar 9, 2025 · 0 comments
Open

📎 Move semantic model to scanner #5312

arendjr opened this issue Mar 9, 2025 · 0 comments
Labels
A-Analyzer Area: analyzer A-Core Area: core S-Enhancement Status: Improve an existing feature

Comments

@arendjr
Copy link
Contributor

arendjr commented Mar 9, 2025

Description

Currently, our analyser operates in two phases: a syntax phase and a semantic phase. The idea is that rules that don't need the semantic model can operate in the syntax phase, while that same phase is also used for building the semantic model. Then a second pass is done where the semantic model can also be used.

However, we now have the scanner, which also does its own pass on the scanned files in order to build the dependency graph. This means we effectively have three passes now. What's more, to improve the dependency graph and allow for resolving imports to concrete declarations, we will need access to the semantic model in the scanner. The reason for this is that without semantic model, we cannot resolve the target for an export declared with export { foo }.

Of course, if we need to build the semantic model in the scanner, we would do best to persist it and run the analyser in a single phase afterwards.

@arendjr arendjr added A-Analyzer Area: analyzer A-Core Area: core S-Enhancement Status: Improve an existing feature labels Mar 9, 2025
@arendjr arendjr changed the title 📎 Move semantic analysis to scanner 📎 Move semantic model to scanner Mar 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Analyzer Area: analyzer A-Core Area: core S-Enhancement Status: Improve an existing feature
Projects
None yet
Development

No branches or pull requests

1 participant