Parser: Allow comma as named field separator#18881
Closed
edgarfgp wants to merge 61 commits intodotnet:mainfrom
Closed
Parser: Allow comma as named field separator#18881edgarfgp wants to merge 61 commits intodotnet:mainfrom
edgarfgp wants to merge 61 commits intodotnet:mainfrom
Conversation
There was a problem hiding this comment.
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
2 tasks
Contributor
Author
|
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Implements: fsharp/fslang-design#818
Language suggestion: fsharp/fslang-suggestions#957
Checklist