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

Introduce the symbol collection context and a symbol collection step. #5661

Merged
merged 4 commits into from
Mar 11, 2024

Conversation

tritao
Copy link
Contributor

@tritao tritao commented Feb 26, 2024

Description

This PR introduces a new symbol collection step to the compiler pipeline, that is done after parsing but before type checking.

It collects identifiers for the top level entities in the AST and allows referencing through a parsed declaration id.

These will be used in a subsequent PR that introduces a new AST order resolving pass that runs before type checking, thus allowing us to get rid of the deferred monormophization "hack", simplifying some things and eliminating some bugs.

Checklist

  • I have linked to any relevant issues.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation where relevant (API docs, the reference, and the Sway book).
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added (or requested a maintainer to add) the necessary Breaking* or New Feature labels where relevant.
  • I have done my best to ensure that my PR adheres to the Fuel Labs Code Review Standards.
  • I have requested a review from the relevant team or maintainers.

@tritao tritao added enhancement New feature or request compiler General compiler. Should eventually become more specific as the issue is triaged compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen labels Feb 26, 2024
@tritao tritao self-assigned this Feb 26, 2024
@tritao tritao force-pushed the collection-context-analyze branch 4 times, most recently from 52a60c6 to abb5522 Compare March 3, 2024 23:34
@tritao tritao marked this pull request as ready for review March 4, 2024 09:14
@tritao tritao force-pushed the collection-context-analyze branch from abb5522 to dd3831e Compare March 9, 2024 20:00
@tritao tritao requested a review from a team March 9, 2024 20:01
@tritao
Copy link
Contributor Author

tritao commented Mar 9, 2024

Rebased to latest master.

Copy link
Contributor

@IGI-111 IGI-111 left a comment

Choose a reason for hiding this comment

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

LGTM, I appreciate that this is well commented

@IGI-111 IGI-111 requested a review from a team March 11, 2024 13:31
@tritao tritao enabled auto-merge (squash) March 11, 2024 13:38
@tritao tritao merged commit dc20ac2 into FuelLabs:master Mar 11, 2024
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen compiler General compiler. Should eventually become more specific as the issue is triaged enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants