-
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.
Parse ineaxct object type annotation syntax (#321)
- Loading branch information
1 parent
757888e
commit e08d0aa
Showing
16 changed files
with
190 additions
and
24 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
47 changes: 47 additions & 0 deletions
47
src/Escalier.Parser.Tests/snapshots/Tests.ParseInexactObjectTypes.verified.txt
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,47 @@ | ||
input: | ||
type Obj = { | ||
msg: string, | ||
flag: boolean, | ||
... | ||
}; | ||
|
||
output: Ok | ||
{ Items = | ||
[Stmt | ||
{ Kind = | ||
Decl | ||
{ Kind = | ||
TypeDecl | ||
{ Name = "Obj" | ||
TypeAnn = | ||
{ Kind = | ||
Object | ||
{ Elems = | ||
[Property | ||
{ Name = String "msg" | ||
TypeAnn = { Kind = Keyword String | ||
Span = { Start = (Ln: 3, Col: 12) | ||
Stop = (Ln: 3, Col: 18) } | ||
InferredType = None } | ||
Optional = false | ||
Readonly = false | ||
Static = false }; | ||
Property | ||
{ Name = String "flag" | ||
TypeAnn = { Kind = Keyword Boolean | ||
Span = { Start = (Ln: 4, Col: 13) | ||
Stop = (Ln: 4, Col: 20) } | ||
InferredType = None } | ||
Optional = false | ||
Readonly = false | ||
Static = false }] | ||
Immutable = false | ||
Exact = false } | ||
Span = { Start = (Ln: 2, Col: 16) | ||
Stop = (Ln: 6, Col: 6) } | ||
InferredType = None } | ||
TypeParams = None } | ||
Span = { Start = (Ln: 2, Col: 5) | ||
Stop = (Ln: 7, Col: 5) } } | ||
Span = { Start = (Ln: 2, Col: 5) | ||
Stop = (Ln: 7, Col: 5) } }] } |
47 changes: 47 additions & 0 deletions
47
src/Escalier.Parser.Tests/snapshots/Tests.ParseInexactRecordTypes.verified.txt
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,47 @@ | ||
input: | ||
type Rec = #{ | ||
msg: string, | ||
flag: boolean, | ||
... | ||
}; | ||
|
||
output: Ok | ||
{ Items = | ||
[Stmt | ||
{ Kind = | ||
Decl | ||
{ Kind = | ||
TypeDecl | ||
{ Name = "Rec" | ||
TypeAnn = | ||
{ Kind = | ||
Object | ||
{ Elems = | ||
[Property | ||
{ Name = String "msg" | ||
TypeAnn = { Kind = Keyword String | ||
Span = { Start = (Ln: 3, Col: 12) | ||
Stop = (Ln: 3, Col: 18) } | ||
InferredType = None } | ||
Optional = false | ||
Readonly = false | ||
Static = false }; | ||
Property | ||
{ Name = String "flag" | ||
TypeAnn = { Kind = Keyword Boolean | ||
Span = { Start = (Ln: 4, Col: 13) | ||
Stop = (Ln: 4, Col: 20) } | ||
InferredType = None } | ||
Optional = false | ||
Readonly = false | ||
Static = false }] | ||
Immutable = true | ||
Exact = false } | ||
Span = { Start = (Ln: 2, Col: 16) | ||
Stop = (Ln: 6, Col: 6) } | ||
InferredType = None } | ||
TypeParams = None } | ||
Span = { Start = (Ln: 2, Col: 5) | ||
Stop = (Ln: 7, Col: 5) } } | ||
Span = { Start = (Ln: 2, Col: 5) | ||
Stop = (Ln: 7, Col: 5) } }] } |
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