-
Notifications
You must be signed in to change notification settings - Fork 830
Parser: parse primary ctor params as normal patterns #16425
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
Conversation
|
This is ready. 🎉 |
psfinaki
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing parser code? I don't believe you :D Haven't ever seen this happening.
psfinaki
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks awesome!
be480d6 to
3a29716
Compare
3a29716 to
d40c986
Compare
|
This is ready again (after resolving the upstream conflicts) 🙂 |
✅ No release notes required |
Co-authored-by: Florian Verdonck <[email protected]>
nojaf
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
Prior to this PR the compiler had two way of parsing patterns:
matchexpressions,letbindings, member declarations, and so on)The idea of the 'simple' patterns was to limit what patterns are allowed in the primary constructors. These are parsed by special parser rules that allow parsing a limited subset of the patterns. Using separate rules poses several issues:
Simple patterns are also used internally during checking of various
match/let/function/funexpressions in some cases, and the parsed patterns are converted into 'simple' ones along the way.This PR removes the special pattern parsing in primary constructors:
as _arg1or a similar pattern during conversion)This fixes parsing/analysis for cases like this:
It also fixes issues that prevented further analysis of a type declaration: