-
Notifications
You must be signed in to change notification settings - Fork 831
Parser: recover on unfinished type declarations
#15410
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
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
82c833d
Parser: recover on unfinished 'type' declarations
auduchinok 22cfda2
Fantomas
auduchinok 5f5d452
Recover
auduchinok 10237d4
Revert error text change
auduchinok 9bccc25
Update baseline
auduchinok 04e91bf
Update test/baseline
auduchinok 12dd475
Update surface area
auduchinok 6050b2e
Fix checker
auduchinok 22062da
Convert test to syntax tree
auduchinok 898cd80
Update baseline
auduchinok 91c6d48
More test updates
auduchinok File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| module Module | ||
|
|
||
| type T = | ||
| interface I with | ||
|
|
||
| let _ = () |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| ImplFile | ||
| (ParsedImplFileInput | ||
| ("/root/Member/Interface 06.fs", false, QualifiedNameOfFile Module, [], [], | ||
| [SynModuleOrNamespace | ||
| ([Module], false, NamedModule, | ||
| [Types | ||
| ([SynTypeDefn | ||
| (SynComponentInfo | ||
| ([], None, [], [T], | ||
| PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), | ||
| false, None, (3,5--3,6)), | ||
| ObjectModel | ||
| (Unspecified, | ||
| [Interface | ||
| (LongIdent (SynLongIdent ([I], [], [None])), | ||
| Some (4,16--4,20), Some [], (4,4--4,20)); | ||
| LetBindings | ||
| ([SynBinding | ||
| (None, Normal, false, false, [], | ||
| PreXmlDoc ((6,4), FSharp.Compiler.Xml.XmlDocCollector), | ||
| SynValData | ||
| (None, | ||
| SynValInfo ([], SynArgInfo ([], false, None)), | ||
| None), Wild (6,8--6,9), None, | ||
| Const (Unit, (6,12--6,14)), (6,8--6,9), | ||
| Yes (6,4--6,14), | ||
| { LeadingKeyword = Let (6,4--6,7) | ||
| InlineKeyword = None | ||
| EqualsRange = Some (6,10--6,11) })], false, false, | ||
| (6,4--6,14))], (4,4--6,14)), [], None, (3,5--6,14), | ||
| { LeadingKeyword = Type (3,0--3,4) | ||
| EqualsRange = Some (3,7--3,8) | ||
| WithKeyword = None })], (3,0--6,14))], | ||
| PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, | ||
| (1,0--6,14), { LeadingKeyword = Module (1,0--1,6) })], (true, true), | ||
| { ConditionalDirectives = [] | ||
| CodeComments = [] }, set [])) | ||
|
|
||
| (6,4)-(6,14) parse error Possible incorrect indentation: this token is offside of context started at position (4:5). Try indenting this token further or using standard formatting conventions. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| module Module | ||
|
|
||
| type T = | ||
| interface I | ||
|
|
||
| member this.P = 1 |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| ImplFile | ||
| (ParsedImplFileInput | ||
| ("/root/Member/Interface 07.fs", false, QualifiedNameOfFile Module, [], [], | ||
| [SynModuleOrNamespace | ||
| ([Module], false, NamedModule, | ||
| [Types | ||
| ([SynTypeDefn | ||
| (SynComponentInfo | ||
| ([], None, [], [T], | ||
| PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), | ||
| false, None, (3,5--3,6)), | ||
| ObjectModel | ||
| (Unspecified, | ||
| [Interface | ||
| (LongIdent (SynLongIdent ([I], [], [None])), None, None, | ||
| (4,4--4,15)); | ||
| Member | ||
| (SynBinding | ||
| (None, Normal, false, false, [], | ||
| PreXmlDoc ((6,4), FSharp.Compiler.Xml.XmlDocCollector), | ||
| SynValData | ||
| (Some { IsInstance = true | ||
| IsDispatchSlot = false | ||
| IsOverrideOrExplicitImpl = false | ||
| IsFinal = false | ||
| GetterOrSetterIsCompilerGenerated = false | ||
| MemberKind = Member }, | ||
| SynValInfo | ||
| ([[SynArgInfo ([], false, None)]; []], | ||
| SynArgInfo ([], false, None)), None), | ||
| LongIdent | ||
| (SynLongIdent | ||
| ([this; P], [(6,15--6,16)], [None; None]), None, | ||
| None, Pats [], None, (6,11--6,17)), None, | ||
| Const (Int32 1, (6,20--6,21)), (6,11--6,17), | ||
| NoneAtInvisible, | ||
| { LeadingKeyword = Member (6,4--6,10) | ||
| InlineKeyword = None | ||
| EqualsRange = Some (6,18--6,19) }), (6,4--6,21))], | ||
| (4,4--6,21)), [], None, (3,5--6,21), | ||
| { LeadingKeyword = Type (3,0--3,4) | ||
| EqualsRange = Some (3,7--3,8) | ||
| WithKeyword = None })], (3,0--6,21))], | ||
| PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, | ||
| (1,0--6,21), { LeadingKeyword = Module (1,0--1,6) })], (true, true), | ||
| { ConditionalDirectives = [] | ||
| CodeComments = [] }, set [])) |
5 changes: 0 additions & 5 deletions
5
...ce/data/SyntaxTree/SignatureType/SynTypeDefnSigShouldContainsTheRangeOfTheWithKeyword.fsi
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| namespace X | ||
|
|
||
| type Foo with | ||
| member Meh: unit -> unit |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| module Module | ||
|
|
||
| type A = int | ||
|
|
||
| and | ||
|
|
||
| and C = int |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| ImplFile | ||
| (ParsedImplFileInput | ||
| ("/root/Type/And 01.fs", false, QualifiedNameOfFile Module, [], [], | ||
| [SynModuleOrNamespace | ||
| ([Module], false, NamedModule, | ||
| [Types | ||
| ([SynTypeDefn | ||
| (SynComponentInfo | ||
| ([], None, [], [A], | ||
| PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), | ||
| false, None, (3,5--3,6)), | ||
| Simple | ||
| (TypeAbbrev | ||
| (Ok, LongIdent (SynLongIdent ([int], [], [None])), | ||
| (3,9--3,12)), (3,9--3,12)), [], None, (3,5--3,12), | ||
| { LeadingKeyword = Type (3,0--3,4) | ||
| EqualsRange = Some (3,7--3,8) | ||
| WithKeyword = None }); | ||
| SynTypeDefn | ||
| (SynComponentInfo | ||
| ([], None, [], [], | ||
| PreXmlDoc ((7,0), FSharp.Compiler.Xml.XmlDocCollector), | ||
| false, None, (7,0--7,3)), | ||
| Simple (None (7,0--7,3), (7,0--7,3)), [], None, (7,0--7,3), | ||
| { LeadingKeyword = And (5,0--5,3) | ||
| EqualsRange = None | ||
| WithKeyword = None }); | ||
| SynTypeDefn | ||
| (SynComponentInfo | ||
| ([], None, [], [C], | ||
| PreXmlDoc ((7,4), FSharp.Compiler.Xml.XmlDocCollector), | ||
| false, None, (7,4--7,5)), | ||
| Simple | ||
| (TypeAbbrev | ||
| (Ok, LongIdent (SynLongIdent ([int], [], [None])), | ||
| (7,8--7,11)), (7,8--7,11)), [], None, (7,4--7,11), | ||
| { LeadingKeyword = And (7,0--7,3) | ||
| EqualsRange = Some (7,6--7,7) | ||
| WithKeyword = None })], (3,0--7,11))], | ||
| PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, | ||
| (1,0--7,11), { LeadingKeyword = Module (1,0--1,6) })], (true, true), | ||
| { ConditionalDirectives = [] | ||
| CodeComments = [] }, set [])) | ||
|
|
||
| (7,0)-(7,3) parse error Unexpected keyword 'and' in type name |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| module Module | ||
|
|
||
| type A = int | ||
|
|
||
| and B | ||
|
|
||
| and C = int |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.