-
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 patterns and statements * start TypeAnnParser, reorganize the code into modules * experiment with createParserForwardedToRef in new JsonParser * cleanup ExprParser a bit * add another test
- Loading branch information
1 parent
108082b
commit e01ed02
Showing
10 changed files
with
531 additions
and
29 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
14 changes: 14 additions & 0 deletions
14
src/Escalier.Parser.Tests/snapshots/Tests.ParseFuncDef.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,14 @@ | ||
input: fn (x, y) { x } | ||
output: Success: { kind = | ||
Function | ||
(["x"; "y"], Block { span = { start = 0 | ||
stop = 0 } | ||
stmts = [{ span = { start = 12 | ||
stop = 14 } | ||
kind = Expr { kind = Identifer "x" | ||
span = { start = 12 | ||
stop = 14 } | ||
inferred_type = None } }] }) | ||
span = { start = 0 | ||
stop = 15 } | ||
inferred_type = None } |
17 changes: 17 additions & 0 deletions
17
src/Escalier.Parser.Tests/snapshots/Tests.ParseIntersectionType.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,17 @@ | ||
input: number & string & boolean | ||
output: Success: { kind = | ||
Intersection | ||
[{ kind = Keyword Number | ||
span = { start = 0 | ||
stop = 7 } | ||
inferred_type = None }; { kind = Keyword String | ||
span = { start = 9 | ||
stop = 16 } | ||
inferred_type = None }; | ||
{ kind = Keyword Boolean | ||
span = { start = 18 | ||
stop = 25 } | ||
inferred_type = None }] | ||
span = { start = 0 | ||
stop = 25 } | ||
inferred_type = None } |
28 changes: 28 additions & 0 deletions
28
src/Escalier.Parser.Tests/snapshots/Tests.ParseUnionAndIntersectionType.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,28 @@ | ||
input: A & B | C & D | ||
output: Success: { kind = | ||
Union | ||
[{ kind = | ||
Intersection [{ kind = TypeRef ("A", None) | ||
span = { start = 0 | ||
stop = 2 } | ||
inferred_type = None }; { kind = TypeRef ("B", None) | ||
span = { start = 4 | ||
stop = 6 } | ||
inferred_type = None }] | ||
span = { start = 0 | ||
stop = 6 } | ||
inferred_type = None }; | ||
{ kind = | ||
Intersection [{ kind = TypeRef ("C", None) | ||
span = { start = 8 | ||
stop = 10 } | ||
inferred_type = None }; { kind = TypeRef ("D", None) | ||
span = { start = 12 | ||
stop = 13 } | ||
inferred_type = None }] | ||
span = { start = 8 | ||
stop = 13 } | ||
inferred_type = None }] | ||
span = { start = 0 | ||
stop = 13 } | ||
inferred_type = None } |
17 changes: 17 additions & 0 deletions
17
src/Escalier.Parser.Tests/snapshots/Tests.ParseUnionType.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,17 @@ | ||
input: number | string | boolean | ||
output: Success: { kind = | ||
Union | ||
[{ kind = Keyword Number | ||
span = { start = 0 | ||
stop = 7 } | ||
inferred_type = None }; { kind = Keyword String | ||
span = { start = 9 | ||
stop = 16 } | ||
inferred_type = None }; | ||
{ kind = Keyword Boolean | ||
span = { start = 18 | ||
stop = 25 } | ||
inferred_type = None }] | ||
span = { start = 0 | ||
stop = 25 } | ||
inferred_type = None } |
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
Oops, something went wrong.