-
Notifications
You must be signed in to change notification settings - Fork 829
Parser: Allow comma as named field separator #18881
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
Parser: Allow comma as named field separator #18881
Conversation
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.
Pull Request Overview
This PR adds support for using commas as separators in named field patterns for discriminated union cases and exception patterns in F#, alongside the existing semicolon separators. The feature is gated behind the Preview language version and maintains backward compatibility while making pattern syntax consistent with construction syntax.
Key changes:
- Parser modifications to accept both comma and semicolon separators in named field patterns
- New diagnostic for inconsistent separator usage within the same pattern
- Comprehensive test coverage for the new syntax
Reviewed Changes
Copilot reviewed 223 out of 223 changed files in this pull request and generated no comments.
File | Description |
---|---|
Multiple .bsl files | Updated syntax tree baseline files to reflect new separator representations in AST |
Multiple .fs test files | Added test cases covering comma-separated named field patterns and mixed separator error cases |
Comments suppressed due to low confidence (5)
…rfgp/fsharp into allow-comma-as-name-field-separator
…rfgp/fsharp into allow-comma-as-name-field-separator
# Conflicts: # tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl
3b95dad
to
a8fe750
Compare
Going to split this PR in small ones to make easier to review |
# Conflicts: # src/Compiler/Checking/CheckRecordSyntaxHelpers.fs # src/Compiler/Service/ServiceParseTreeWalk.fs # src/Compiler/SyntaxTree/SyntaxTree.fsi # src/Compiler/pars.fsy
Description
Implements: fsharp/fslang-design#818
Language suggestion: fsharp/fslang-suggestions#957
Checklist