-
Notifications
You must be signed in to change notification settings - Fork 790
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 namespaces and top level modules
- Loading branch information
1 parent
fd05137
commit d6c6d3c
Showing
29 changed files
with
255 additions
and
2 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
1 change: 1 addition & 0 deletions
1
tests/service/data/SyntaxTree/ModuleOrNamespace/Anon module 01.fs
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 @@ | ||
() |
12 changes: 12 additions & 0 deletions
12
tests/service/data/SyntaxTree/ModuleOrNamespace/Anon module 01.fs.bsl
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,12 @@ | ||
ImplFile | ||
(ParsedImplFileInput | ||
("/root/ModuleOrNamespace/Anon module 01.fs", false, | ||
QualifiedNameOfFile Anon module 01, [], [], | ||
[SynModuleOrNamespace | ||
([Anon module 01], false, AnonModule, | ||
[Expr (Const (Unit, (1,0--1,2)), (1,0--1,2))], PreXmlDocEmpty, [], | ||
None, (1,0--1,2), { LeadingKeyword = None })], (true, true), | ||
{ ConditionalDirectives = [] | ||
CodeComments = [] }, set [])) | ||
|
||
(1,0)-(1,2) parse warning The declarations in this file will be placed in an implicit module 'Anon module 01' based on the file name 'Anon module 01.fs'. However this is not a valid F# identifier, so the contents will not be accessible from other files. Consider renaming the file or adding a 'module' or 'namespace' declaration at the top of the file. |
1 change: 1 addition & 0 deletions
1
tests/service/data/SyntaxTree/ModuleOrNamespace/Anon module 02.fsx
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 @@ | ||
() |
10 changes: 10 additions & 0 deletions
10
tests/service/data/SyntaxTree/ModuleOrNamespace/Anon module 02.fsx.bsl
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,10 @@ | ||
ImplFile | ||
(ParsedImplFileInput | ||
("/root/ModuleOrNamespace/Anon module 02.fsx", true, | ||
QualifiedNameOfFile Anon module 02$fsx, [], [], | ||
[SynModuleOrNamespace | ||
([Anon module 02], false, AnonModule, | ||
[Expr (Const (Unit, (1,0--1,2)), (1,0--1,2))], PreXmlDocEmpty, [], | ||
None, (1,0--1,2), { LeadingKeyword = None })], (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 A. | ||
|
||
() |
12 changes: 12 additions & 0 deletions
12
tests/service/data/SyntaxTree/ModuleOrNamespace/Module 05.fs.bsl
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,12 @@ | ||
ImplFile | ||
(ParsedImplFileInput | ||
("/root/ModuleOrNamespace/Module 05.fs", false, QualifiedNameOfFile A, [], | ||
[], | ||
[SynModuleOrNamespace | ||
([A], false, NamedModule, [Expr (Const (Unit, (3,0--3,2)), (3,0--3,2))], | ||
PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, | ||
(1,0--3,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), | ||
{ ConditionalDirectives = [] | ||
CodeComments = [] }, set [])) | ||
|
||
(3,0)-(3,1) parse error Unexpected start of structured construct in definition |
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 | ||
|
||
() |
12 changes: 12 additions & 0 deletions
12
tests/service/data/SyntaxTree/ModuleOrNamespace/Module 06.fs.bsl
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,12 @@ | ||
ImplFile | ||
(ParsedImplFileInput | ||
("/root/ModuleOrNamespace/Module 06.fs", false, QualifiedNameOfFile , [], | ||
[], | ||
[SynModuleOrNamespace | ||
([], false, NamedModule, [Expr (Const (Unit, (3,0--3,2)), (3,0--3,2))], | ||
PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, | ||
(1,0--3,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), | ||
{ ConditionalDirectives = [] | ||
CodeComments = [] }, set [])) | ||
|
||
(3,0)-(3,1) parse error Unexpected start of structured construct in definition. Expected identifier, 'global' or other token. |
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 rec | ||
|
||
() |
12 changes: 12 additions & 0 deletions
12
tests/service/data/SyntaxTree/ModuleOrNamespace/Module 07.fs.bsl
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,12 @@ | ||
ImplFile | ||
(ParsedImplFileInput | ||
("/root/ModuleOrNamespace/Module 07.fs", false, QualifiedNameOfFile , [], | ||
[], | ||
[SynModuleOrNamespace | ||
([], true, NamedModule, [Expr (Const (Unit, (3,0--3,2)), (3,0--3,2))], | ||
PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, | ||
(1,0--3,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), | ||
{ ConditionalDirectives = [] | ||
CodeComments = [] }, set [])) | ||
|
||
(3,0)-(3,1) parse error Unexpected start of structured construct in definition. Expected identifier, 'global' or other token. |
7 changes: 7 additions & 0 deletions
7
tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 01.fs
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,7 @@ | ||
namespace Ns1 | ||
|
||
() | ||
|
||
namespace Ns2.Nested | ||
|
||
() |
14 changes: 14 additions & 0 deletions
14
tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 01.fs.bsl
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,14 @@ | ||
ImplFile | ||
(ParsedImplFileInput | ||
("/root/ModuleOrNamespace/Namespace 01.fs", false, | ||
QualifiedNameOfFile Namespace 01, [], [], | ||
[SynModuleOrNamespace | ||
([Ns1], false, DeclaredNamespace, | ||
[Expr (Const (Unit, (3,0--3,2)), (3,0--3,2))], PreXmlDocEmpty, [], | ||
None, (1,0--3,2), { LeadingKeyword = Namespace (1,0--1,9) }); | ||
SynModuleOrNamespace | ||
([Ns2; Nested], false, DeclaredNamespace, | ||
[Expr (Const (Unit, (7,0--7,2)), (7,0--7,2))], PreXmlDocEmpty, [], | ||
None, (5,0--7,2), { LeadingKeyword = Namespace (5,0--5,9) })], | ||
(true, true), { ConditionalDirectives = [] | ||
CodeComments = [] }, set [])) |
7 changes: 7 additions & 0 deletions
7
tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 02.fs
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,7 @@ | ||
namespace Ns1 | ||
|
||
() | ||
|
||
namespace | ||
|
||
() |
16 changes: 16 additions & 0 deletions
16
tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 02.fs.bsl
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,16 @@ | ||
ImplFile | ||
(ParsedImplFileInput | ||
("/root/ModuleOrNamespace/Namespace 02.fs", false, | ||
QualifiedNameOfFile Namespace 02, [], [], | ||
[SynModuleOrNamespace | ||
([Ns1], false, DeclaredNamespace, | ||
[Expr (Const (Unit, (3,0--3,2)), (3,0--3,2))], PreXmlDocEmpty, [], | ||
None, (1,0--3,2), { LeadingKeyword = Namespace (1,0--1,9) }); | ||
SynModuleOrNamespace | ||
([], false, DeclaredNamespace, | ||
[Expr (Const (Unit, (7,0--7,2)), (7,0--7,2))], PreXmlDocEmpty, [], | ||
None, (5,0--7,2), { LeadingKeyword = Namespace (5,0--5,9) })], | ||
(true, true), { ConditionalDirectives = [] | ||
CodeComments = [] }, set [])) | ||
|
||
(7,0)-(7,1) parse error Unexpected start of structured construct in implementation file. Expected identifier, 'global' or other token. |
7 changes: 7 additions & 0 deletions
7
tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 03.fs
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,7 @@ | ||
namespace Ns1 | ||
|
||
() | ||
|
||
namespace Ns2. | ||
|
||
() |
16 changes: 16 additions & 0 deletions
16
tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 03.fs.bsl
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,16 @@ | ||
ImplFile | ||
(ParsedImplFileInput | ||
("/root/ModuleOrNamespace/Namespace 03.fs", false, | ||
QualifiedNameOfFile Namespace 03, [], [], | ||
[SynModuleOrNamespace | ||
([Ns1], false, DeclaredNamespace, | ||
[Expr (Const (Unit, (3,0--3,2)), (3,0--3,2))], PreXmlDocEmpty, [], | ||
None, (1,0--3,2), { LeadingKeyword = Namespace (1,0--1,9) }); | ||
SynModuleOrNamespace | ||
([Ns2], false, DeclaredNamespace, | ||
[Expr (Const (Unit, (7,0--7,2)), (7,0--7,2))], PreXmlDocEmpty, [], | ||
None, (5,0--7,2), { LeadingKeyword = Namespace (5,0--5,9) })], | ||
(true, true), { ConditionalDirectives = [] | ||
CodeComments = [] }, set [])) | ||
|
||
(7,0)-(7,1) parse error Unexpected start of structured construct in implementation file |
7 changes: 7 additions & 0 deletions
7
tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 04.fs
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,7 @@ | ||
namespace Ns1 | ||
|
||
() | ||
|
||
namespace rec | ||
|
||
() |
16 changes: 16 additions & 0 deletions
16
tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 04.fs.bsl
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,16 @@ | ||
ImplFile | ||
(ParsedImplFileInput | ||
("/root/ModuleOrNamespace/Namespace 04.fs", false, | ||
QualifiedNameOfFile Namespace 04, [], [], | ||
[SynModuleOrNamespace | ||
([Ns1], false, DeclaredNamespace, | ||
[Expr (Const (Unit, (3,0--3,2)), (3,0--3,2))], PreXmlDocEmpty, [], | ||
None, (1,0--3,2), { LeadingKeyword = Namespace (1,0--1,9) }); | ||
SynModuleOrNamespace | ||
([], true, DeclaredNamespace, | ||
[Expr (Const (Unit, (7,0--7,2)), (7,0--7,2))], PreXmlDocEmpty, [], | ||
None, (5,0--7,2), { LeadingKeyword = Namespace (5,0--5,9) })], | ||
(true, true), { ConditionalDirectives = [] | ||
CodeComments = [] }, set [])) | ||
|
||
(7,0)-(7,1) parse error Unexpected start of structured construct in implementation file. Expected identifier, 'global' or other token. |
1 change: 1 addition & 0 deletions
1
tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 05.fs
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 @@ | ||
namespace |
9 changes: 9 additions & 0 deletions
9
tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 05.fs.bsl
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,9 @@ | ||
ImplFile | ||
(ParsedImplFileInput | ||
("/root/ModuleOrNamespace/Namespace 05.fs", false, | ||
QualifiedNameOfFile Namespace 05, [], [], | ||
[SynModuleOrNamespace | ||
([], false, DeclaredNamespace, [], PreXmlDocEmpty, [], None, (1,0--2,0), | ||
{ LeadingKeyword = Namespace (1,0--1,9) })], (true, true), | ||
{ ConditionalDirectives = [] | ||
CodeComments = [] }, set [])) |
3 changes: 3 additions & 0 deletions
3
tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 06.fs
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 @@ | ||
namespace | ||
|
||
() |
12 changes: 12 additions & 0 deletions
12
tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 06.fs.bsl
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,12 @@ | ||
ImplFile | ||
(ParsedImplFileInput | ||
("/root/ModuleOrNamespace/Namespace 06.fs", false, | ||
QualifiedNameOfFile Namespace 06, [], [], | ||
[SynModuleOrNamespace | ||
([], false, DeclaredNamespace, | ||
[Expr (Const (Unit, (3,0--3,2)), (3,0--3,2))], PreXmlDocEmpty, [], | ||
None, (1,0--3,2), { LeadingKeyword = Namespace (1,0--1,9) })], | ||
(true, true), { ConditionalDirectives = [] | ||
CodeComments = [] }, set [])) | ||
|
||
(3,0)-(3,1) parse error Unexpected start of structured construct in implementation file. Expected identifier, 'global' or other token. |
3 changes: 3 additions & 0 deletions
3
tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 07.fs
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 @@ | ||
namespace | ||
|
||
type T = int |
24 changes: 24 additions & 0 deletions
24
tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 07.fs.bsl
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/ModuleOrNamespace/Namespace 07.fs", false, | ||
QualifiedNameOfFile Namespace 07, [], [], | ||
[SynModuleOrNamespace | ||
([], false, DeclaredNamespace, | ||
[Types | ||
([SynTypeDefn | ||
(SynComponentInfo | ||
([], None, [], [T], | ||
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 })], (3,0--3,12))], PreXmlDocEmpty, [], | ||
None, (1,0--3,12), { LeadingKeyword = Namespace (1,0--1,9) })], | ||
(true, true), { ConditionalDirectives = [] | ||
CodeComments = [] }, set [])) | ||
|
||
(3,0)-(3,4) parse error Unexpected start of structured construct in implementation file. Expected identifier, 'global' or other token. |
1 change: 1 addition & 0 deletions
1
tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 08.fs
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 @@ | ||
namespace rec |
9 changes: 9 additions & 0 deletions
9
tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 08.fs.bsl
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,9 @@ | ||
ImplFile | ||
(ParsedImplFileInput | ||
("/root/ModuleOrNamespace/Namespace 08.fs", false, | ||
QualifiedNameOfFile Namespace 08, [], [], | ||
[SynModuleOrNamespace | ||
([], true, DeclaredNamespace, [], PreXmlDocEmpty, [], None, (1,0--2,0), | ||
{ LeadingKeyword = Namespace (1,0--1,9) })], (true, true), | ||
{ ConditionalDirectives = [] | ||
CodeComments = [] }, set [])) |
7 changes: 7 additions & 0 deletions
7
tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 09.fs
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,7 @@ | ||
namespace | ||
|
||
() | ||
|
||
namespace Ns2 | ||
|
||
() |
16 changes: 16 additions & 0 deletions
16
tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 09.fs.bsl
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,16 @@ | ||
ImplFile | ||
(ParsedImplFileInput | ||
("/root/ModuleOrNamespace/Namespace 09.fs", false, | ||
QualifiedNameOfFile Namespace 09, [], [], | ||
[SynModuleOrNamespace | ||
([], false, DeclaredNamespace, | ||
[Expr (Const (Unit, (3,0--3,2)), (3,0--3,2))], PreXmlDocEmpty, [], | ||
None, (1,0--3,2), { LeadingKeyword = Namespace (1,0--1,9) }); | ||
SynModuleOrNamespace | ||
([Ns2], false, DeclaredNamespace, | ||
[Expr (Const (Unit, (7,0--7,2)), (7,0--7,2))], PreXmlDocEmpty, [], | ||
None, (5,0--7,2), { LeadingKeyword = Namespace (5,0--5,9) })], | ||
(true, true), { ConditionalDirectives = [] | ||
CodeComments = [] }, set [])) | ||
|
||
(3,0)-(3,1) parse error Unexpected start of structured construct in implementation file. Expected identifier, 'global' or other token. |