-
-
Notifications
You must be signed in to change notification settings - Fork 753
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c8fe1c2
commit 9e947f5
Showing
11 changed files
with
355 additions
and
10 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
23 changes: 23 additions & 0 deletions
23
...ots/gleam_core__parse__tests__echo_followed_by_expression_ends_where_expression_ends.snap
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 @@ | ||
--- | ||
source: compiler-core/src/parse/tests.rs | ||
expression: echo wibble | ||
--- | ||
[ | ||
Expression( | ||
Echo { | ||
location: SrcSpan { | ||
start: 0, | ||
end: 11, | ||
}, | ||
expression: Some( | ||
Var { | ||
location: SrcSpan { | ||
start: 5, | ||
end: 11, | ||
}, | ||
name: "wibble", | ||
}, | ||
), | ||
}, | ||
), | ||
] |
37 changes: 37 additions & 0 deletions
37
...src/parse/snapshots/gleam_core__parse__tests__echo_has_greater_precedence_than_binop.snap
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,37 @@ | ||
--- | ||
source: compiler-core/src/parse/tests.rs | ||
expression: echo 1 + 1 | ||
--- | ||
[ | ||
Expression( | ||
BinOp { | ||
location: SrcSpan { | ||
start: 0, | ||
end: 10, | ||
}, | ||
name: AddInt, | ||
left: Echo { | ||
location: SrcSpan { | ||
start: 0, | ||
end: 6, | ||
}, | ||
expression: Some( | ||
Int { | ||
location: SrcSpan { | ||
start: 5, | ||
end: 6, | ||
}, | ||
value: "1", | ||
}, | ||
), | ||
}, | ||
right: Int { | ||
location: SrcSpan { | ||
start: 9, | ||
end: 10, | ||
}, | ||
value: "1", | ||
}, | ||
}, | ||
), | ||
] |
34 changes: 34 additions & 0 deletions
34
compiler-core/src/parse/snapshots/gleam_core__parse__tests__echo_in_a_pipeline.snap
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,34 @@ | ||
--- | ||
source: compiler-core/src/parse/tests.rs | ||
expression: "[] |> echo |> wibble" | ||
--- | ||
[ | ||
Expression( | ||
PipeLine { | ||
expressions: [ | ||
List { | ||
location: SrcSpan { | ||
start: 0, | ||
end: 2, | ||
}, | ||
elements: [], | ||
tail: None, | ||
}, | ||
Echo { | ||
location: SrcSpan { | ||
start: 6, | ||
end: 10, | ||
}, | ||
expression: None, | ||
}, | ||
Var { | ||
location: SrcSpan { | ||
start: 14, | ||
end: 20, | ||
}, | ||
name: "wibble", | ||
}, | ||
], | ||
}, | ||
), | ||
] |
42 changes: 42 additions & 0 deletions
42
...se/snapshots/gleam_core__parse__tests__echo_in_a_pipeline_with_an_expression_ater_it.snap
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,42 @@ | ||
--- | ||
source: compiler-core/src/parse/tests.rs | ||
expression: "[] |> echo fun |> wibble" | ||
--- | ||
[ | ||
Expression( | ||
PipeLine { | ||
expressions: [ | ||
List { | ||
location: SrcSpan { | ||
start: 0, | ||
end: 2, | ||
}, | ||
elements: [], | ||
tail: None, | ||
}, | ||
Echo { | ||
location: SrcSpan { | ||
start: 6, | ||
end: 14, | ||
}, | ||
expression: Some( | ||
Var { | ||
location: SrcSpan { | ||
start: 11, | ||
end: 14, | ||
}, | ||
name: "fun", | ||
}, | ||
), | ||
}, | ||
Var { | ||
location: SrcSpan { | ||
start: 18, | ||
end: 24, | ||
}, | ||
name: "wibble", | ||
}, | ||
], | ||
}, | ||
), | ||
] |
47 changes: 47 additions & 0 deletions
47
compiler-core/src/parse/snapshots/gleam_core__parse__tests__echo_with_block.snap
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 @@ | ||
--- | ||
source: compiler-core/src/parse/tests.rs | ||
expression: "echo { 1 + 1 }" | ||
--- | ||
[ | ||
Expression( | ||
Echo { | ||
location: SrcSpan { | ||
start: 0, | ||
end: 14, | ||
}, | ||
expression: Some( | ||
Block { | ||
location: SrcSpan { | ||
start: 5, | ||
end: 14, | ||
}, | ||
statements: [ | ||
Expression( | ||
BinOp { | ||
location: SrcSpan { | ||
start: 7, | ||
end: 12, | ||
}, | ||
name: AddInt, | ||
left: Int { | ||
location: SrcSpan { | ||
start: 7, | ||
end: 8, | ||
}, | ||
value: "1", | ||
}, | ||
right: Int { | ||
location: SrcSpan { | ||
start: 11, | ||
end: 12, | ||
}, | ||
value: "1", | ||
}, | ||
}, | ||
), | ||
], | ||
}, | ||
), | ||
}, | ||
), | ||
] |
15 changes: 15 additions & 0 deletions
15
...core/src/parse/snapshots/gleam_core__parse__tests__echo_with_no_expressions_after_it.snap
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,15 @@ | ||
--- | ||
source: compiler-core/src/parse/tests.rs | ||
expression: echo | ||
--- | ||
[ | ||
Expression( | ||
Echo { | ||
location: SrcSpan { | ||
start: 0, | ||
end: 4, | ||
}, | ||
expression: None, | ||
}, | ||
), | ||
] |
31 changes: 31 additions & 0 deletions
31
compiler-core/src/parse/snapshots/gleam_core__parse__tests__echo_with_panic.snap
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,31 @@ | ||
--- | ||
source: compiler-core/src/parse/tests.rs | ||
expression: "echo panic as \"a\"" | ||
--- | ||
[ | ||
Expression( | ||
Echo { | ||
location: SrcSpan { | ||
start: 0, | ||
end: 17, | ||
}, | ||
expression: Some( | ||
Panic { | ||
location: SrcSpan { | ||
start: 5, | ||
end: 17, | ||
}, | ||
message: Some( | ||
String { | ||
location: SrcSpan { | ||
start: 14, | ||
end: 17, | ||
}, | ||
value: "a", | ||
}, | ||
), | ||
}, | ||
), | ||
}, | ||
), | ||
] |
31 changes: 31 additions & 0 deletions
31
compiler-core/src/parse/snapshots/gleam_core__parse__tests__panic_with_echo.snap
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,31 @@ | ||
--- | ||
source: compiler-core/src/parse/tests.rs | ||
expression: "panic as echo \"string\"" | ||
--- | ||
[ | ||
Expression( | ||
Panic { | ||
location: SrcSpan { | ||
start: 0, | ||
end: 22, | ||
}, | ||
message: Some( | ||
Echo { | ||
location: SrcSpan { | ||
start: 9, | ||
end: 22, | ||
}, | ||
expression: Some( | ||
String { | ||
location: SrcSpan { | ||
start: 14, | ||
end: 22, | ||
}, | ||
value: "string", | ||
}, | ||
), | ||
}, | ||
), | ||
}, | ||
), | ||
] |
39 changes: 39 additions & 0 deletions
39
compiler-core/src/parse/snapshots/gleam_core__parse__tests__repeated_echos.snap
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,39 @@ | ||
--- | ||
source: compiler-core/src/parse/tests.rs | ||
expression: echo echo echo 1 | ||
--- | ||
[ | ||
Expression( | ||
Echo { | ||
location: SrcSpan { | ||
start: 0, | ||
end: 16, | ||
}, | ||
expression: Some( | ||
Echo { | ||
location: SrcSpan { | ||
start: 5, | ||
end: 16, | ||
}, | ||
expression: Some( | ||
Echo { | ||
location: SrcSpan { | ||
start: 10, | ||
end: 16, | ||
}, | ||
expression: Some( | ||
Int { | ||
location: SrcSpan { | ||
start: 15, | ||
end: 16, | ||
}, | ||
value: "1", | ||
}, | ||
), | ||
}, | ||
), | ||
}, | ||
), | ||
}, | ||
), | ||
] |
Oops, something went wrong.