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

5.2 support: Raw identifiers (by changing the Parsetree) #2620

Closed
wants to merge 5 commits into from

Conversation

Julow
Copy link
Collaborator

@Julow Julow commented Nov 18, 2024

Retry of #2619 by keeping the original syntax of identifiers in the parsetree.

Strings in the Parsetree are replaced by the new ident type, which represent the different kinds of identifiers: \#raw, ( >>= ), [], true.
This removes the need to guess whether an identifier needs parentheses and greatly simplifies the support of raw identifiers. Changes in Fmt_ast were mostly type-directed.

Most strings in the extended Parsetree are replaced by the 'ident' type,
which represents the original syntax used to write the identifier.

The new representation can differentiate regular identifiers from
parenthesed operators (`( >>= )`), raw identifiers (`\#foo`) and
constructors (`[]`, `true`).
This is mostly a type-directed refactoring.
@Julow
Copy link
Collaborator Author

Julow commented Nov 19, 2024

The changes to the parser can be avoided entirely: #2621
I'll close this as the other approach avoids divergence in the vendored parser.

@Julow Julow closed this Nov 19, 2024
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