-
Notifications
You must be signed in to change notification settings - Fork 90
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
Refactor resolution to use hierarchical namespaces #1312
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Benchmark for b6f90b0Click to view benchmark
|
Change in memory usage detected by benchmark. Memory Report for b7d20e7
|
Benchmark for b7d20e7Click to view benchmark
|
Change in memory usage detected by benchmark. Memory Report for 8609589
|
Benchmark for 8609589Click to view benchmark
|
Change in memory usage detected by benchmark. Memory Report for 40aaf8c
|
Benchmark for 40aaf8cClick to view benchmark
|
Change in memory usage detected by benchmark. Memory Report for a2d299a
|
Benchmark for a2d299aClick to view benchmark
|
Change in memory usage detected by benchmark. Memory Report for 26a4f5d
|
Change in memory usage detected by benchmark. Memory Report for 579157b
|
Change in memory usage detected by benchmark. Memory Report for 7bb5da8
|
Benchmark for 7bb5da8Click to view benchmark
|
Change in memory usage detected by benchmark. Memory Report for 4e9d46a
|
Benchmark for 4e9d46aClick to view benchmark
|
Change in memory usage detected by benchmark. Memory Report for 426d697
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces a feature called hierarchical namespaces, a module-like system that maintains backward compatibility. It is the foundational groundwork that will pave the way for:
Key changes include:
VecIdent
type introduction: This abstraction overVec<Ident>
represents the new namespaces in the AST. Alternate names could beDotIdent
orPath
.NamespaceId
usage: This replacesRc<str>
for namespace tracking.NamespaceTreeRoot
introduction: This tracks the namespace hierarchy.NamespaceTreeRoot
, and resolves the symbol in the candidate namespaces and scopes, following our shadowing rules and compile error hints.This PR maintains 100% backward compatibility with the existing resolution engine, preserving features like re-opening namespaces, shadowing semantics, merging namespaces via aliases, and absolute-path opens. It also introduces the ability to reference a function in a different namespace if its parent namespace is opened.
Additional notes:
ast
,fir
, andhir
to use shared generic types, reducing duplicateIdent
/etc types.open Microsoft.Quantum
. This will be addressed in future updates.