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

[red-knot] refactor CFG outside of symbol table #11746

Merged
merged 1 commit into from
Jun 5, 2024
Merged

[red-knot] refactor CFG outside of symbol table #11746

merged 1 commit into from
Jun 5, 2024

Conversation

carljm
Copy link
Contributor

@carljm carljm commented Jun 5, 2024

Summary

Separate SymbolTable and FlowGraph into their own modules, and make both submodules of red_knot::semantic module. Also move types module into semantic.

red_knot::semantic::SemanticIndexer builds a SemanticIndex (consisting of the symbol table and flow graph). The symbol_table query is now semantic_index, and SymbolTablesStorage is SemanticIndexStorage.

Both SymbolTable and FlowGraph are immutable, and constructed using a separate builder.

Fixes #11657.

Test Plan

Refactor; existing tests pass.

@carljm carljm added the red-knot Multi-file analysis & type inference label Jun 5, 2024
@carljm carljm requested a review from MichaReiser as a code owner June 5, 2024 00:43
Copy link
Contributor

github-actions bot commented Jun 5, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Copy link
Member

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this. I like this a lot. It makes the symbol module much more approachable.

@carljm carljm merged commit 895eb3e into main Jun 5, 2024
20 checks passed
@carljm carljm deleted the cjm/refactor branch June 5, 2024 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
red-knot Multi-file analysis & type inference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[red-knot] symbol table should not own the flow graph
2 participants