forked from dotnet/fsharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Parser: recover on unfinished 'as' patterns (dotnet#16404)
* Parser: recover on unfinished 'as' patterns * Baselines * More tests * More recovery * More tests * Remove unused rule * Baselines * Restore the rule * Update baseline * Update baseline
- Loading branch information
1 parent
3c531f2
commit e795c9b
Showing
32 changed files
with
400 additions
and
35 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module Module | ||
|
||
match Some 1 with | ||
| _ as _ -> () |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
ImplFile | ||
(ParsedImplFileInput | ||
("/root/Pattern/As 01.fs", false, QualifiedNameOfFile Module, [], [], | ||
[SynModuleOrNamespace | ||
([Module], false, NamedModule, | ||
[Expr | ||
(Match | ||
(Yes (3,0--3,17), | ||
App | ||
(NonAtomic, false, Ident Some, Const (Int32 1, (3,11--3,12)), | ||
(3,6--3,12)), | ||
[SynMatchClause | ||
(As (Wild (4,2--4,3), Wild (4,7--4,8), (4,2--4,8)), None, | ||
Const (Unit, (4,12--4,14)), (4,2--4,14), Yes, | ||
{ ArrowRange = Some (4,9--4,11) | ||
BarRange = Some (4,0--4,1) })], (3,0--4,14), | ||
{ MatchKeyword = (3,0--3,5) | ||
WithKeyword = (3,13--3,17) }), (3,0--4,14))], | ||
PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, | ||
(1,0--4,14), { LeadingKeyword = Module (1,0--1,6) })], (true, true), | ||
{ ConditionalDirectives = [] | ||
CodeComments = [] }, set [])) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module Module | ||
|
||
match Some 1 with | ||
| _ as -> () |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
ImplFile | ||
(ParsedImplFileInput | ||
("/root/Pattern/As 02.fs", false, QualifiedNameOfFile Module, [], [], | ||
[SynModuleOrNamespace | ||
([Module], false, NamedModule, | ||
[Expr | ||
(Match | ||
(Yes (3,0--3,17), | ||
App | ||
(NonAtomic, false, Ident Some, Const (Int32 1, (3,11--3,12)), | ||
(3,6--3,12)), | ||
[SynMatchClause | ||
(As (Wild (4,2--4,3), Wild (4,6--4,6), (4,2--4,6)), None, | ||
Const (Unit, (4,10--4,12)), (4,2--4,12), Yes, | ||
{ ArrowRange = Some (4,7--4,9) | ||
BarRange = Some (4,0--4,1) })], (3,0--4,12), | ||
{ MatchKeyword = (3,0--3,5) | ||
WithKeyword = (3,13--3,17) }), (3,0--4,12))], | ||
PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, | ||
(1,0--4,12), { LeadingKeyword = Module (1,0--1,6) })], (true, true), | ||
{ ConditionalDirectives = [] | ||
CodeComments = [] }, set [])) | ||
|
||
(4,7)-(4,9) parse error Unexpected symbol '->' in pattern |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module Module | ||
|
||
let _ as _ = () |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
ImplFile | ||
(ParsedImplFileInput | ||
("/root/Pattern/As 03.fs", false, QualifiedNameOfFile Module, [], [], | ||
[SynModuleOrNamespace | ||
([Module], false, NamedModule, | ||
[Let | ||
(false, | ||
[SynBinding | ||
(None, Normal, false, false, [], | ||
PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), | ||
SynValData | ||
(None, SynValInfo ([], SynArgInfo ([], false, None)), None), | ||
As (Wild (3,4--3,5), Wild (3,9--3,10), (3,4--3,10)), None, | ||
Const (Unit, (3,13--3,15)), (3,4--3,10), Yes (3,0--3,15), | ||
{ LeadingKeyword = Let (3,0--3,3) | ||
InlineKeyword = None | ||
EqualsRange = Some (3,11--3,12) })], (3,0--3,15))], | ||
PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, | ||
(1,0--3,15), { LeadingKeyword = Module (1,0--1,6) })], (true, true), | ||
{ ConditionalDirectives = [] | ||
CodeComments = [] }, set [])) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module Module | ||
|
||
let _ as = () |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
ImplFile | ||
(ParsedImplFileInput | ||
("/root/Pattern/As 04.fs", false, QualifiedNameOfFile Module, [], [], | ||
[SynModuleOrNamespace | ||
([Module], false, NamedModule, | ||
[Let | ||
(false, | ||
[SynBinding | ||
(None, Normal, false, false, [], | ||
PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), | ||
SynValData | ||
(None, SynValInfo ([], SynArgInfo ([], false, None)), None), | ||
As (Wild (3,4--3,5), Wild (3,8--3,8), (3,4--3,8)), None, | ||
Const (Unit, (3,11--3,13)), (3,4--3,8), Yes (3,0--3,13), | ||
{ LeadingKeyword = Let (3,0--3,3) | ||
InlineKeyword = None | ||
EqualsRange = Some (3,9--3,10) })], (3,0--3,13))], | ||
PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, | ||
(1,0--3,13), { LeadingKeyword = Module (1,0--1,6) })], (true, true), | ||
{ ConditionalDirectives = [] | ||
CodeComments = [] }, set [])) | ||
|
||
(3,6)-(3,8) parse error Expecting pattern |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module Module | ||
|
||
match Some 1 with | ||
| _ as |
Oops, something went wrong.