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

Revising the way attributes are desugared #2940

Merged
merged 13 commits into from
Aug 1, 2023
Merged

Revising the way attributes are desugared #2940

merged 13 commits into from
Aug 1, 2023

Conversation

nikswamy
Copy link
Collaborator

@nikswamy nikswamy commented May 21, 2023

In ToSyntax, the desugaring of attributes on declarations was quite convoluted.

In the previous workflow, we would desugar the attributes first, then desugar the rest of declaration, in many cases ignoring the attributes, push the desugared decls into the environment, and then finally add the attributes back. This leads to many unexpected behaviors, e.g., a decl in the environment may not have the same attributes as the actual fully desugared decl.

This PR revises the handling of decl attributes, aiming to ensure that the attributes are handled in all cases, and that the view of the attributes of a decl in the environment is the same as the attributes on the returned, desugared declaration.

This also supports the case where attributes which may not be literally present on a declaration are computed "on the fly", e.g., by a syntax extension.

@nikswamy nikswamy merged commit cfb0a1c into master Aug 1, 2023
1 check passed
@nikswamy nikswamy deleted the _nik_decl_attrs branch August 1, 2023 13:51
@nikswamy
Copy link
Collaborator Author

nikswamy commented Aug 1, 2023

Everest green too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant