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

Further generalize parse diagnostics functions #2753

Open
AppAppWorks opened this issue Jul 25, 2024 · 1 comment
Open

Further generalize parse diagnostics functions #2753

AppAppWorks opened this issue Jul 25, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@AppAppWorks
Copy link
Contributor

Description

#2731 has embarked on the generalization of parse diagnostics functions. It was driven by the necessity of manipulating a whole TypeSyntax (the thrown type) instead of discrete TokenSyntaxs which the functions were originally designed for.

The refactoring effort stopped at generalizing ParseDiagnosticsGenerator.exchangeTokens into ParseDiagnosticsGenerator.exchangeNodes that has relaxed the accepted input type from TokenSyntax to Syntax. However several implementations of ParserError such as EffectsSpecifierAfterArrow, and implementations of ParserFixIt such as MoveTokensAfterFixIt that constitute Diagnostic still expect TokenSyntax. More importantly, nodesDescriptionAndCommonParent, the common utility function responsible for rendering several messages in the diagnostic, expects a list of TokenSyntax as its input.

We should continue refactoring on these functions to further improve generality.

@AppAppWorks AppAppWorks added the enhancement New feature or request label Jul 25, 2024
@ahoppen
Copy link
Member

ahoppen commented Jul 25, 2024

Synced to Apple’s issue tracker as rdar://132444863

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

No branches or pull requests

2 participants