-
Notifications
You must be signed in to change notification settings - Fork 457
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve error messages of branching cases
- Loading branch information
Showing
10 changed files
with
78 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
def is_even(n): | ||
if n % 2 == 0: | ||
return 1 | ||
else: | ||
return 0 | ||
|
||
def get_even_sum_under_if(this_number): | ||
bend current = 0: | ||
when current < this_number: | ||
new_num = fork(current + is_even(current)) | ||
|
||
return new_num | ||
|
||
def main(): | ||
return get_even_sum_under_if(1000) |
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 @@ | ||
def main: | ||
fold [] with x = 1: | ||
|
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,4 @@ | ||
def main: | ||
if 1 == 1: | ||
return "true" | ||
|
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 @@ | ||
def main: | ||
match []: | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
source: tests/golden_tests.rs | ||
input_file: tests/golden_tests/parse_file/bend_missing_else.bend | ||
--- | ||
[4m[1m[31mErrors:[0m | ||
In tests/golden_tests/parse_file/bend_missing_else.bend : | ||
[1m- expected:[0m else | ||
[1m- detected:[0m | ||
[0m 14 | [4m[31md[0mef main():[0m |
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 @@ | ||
--- | ||
source: tests/golden_tests.rs | ||
input_file: tests/golden_tests/parse_file/fold_missing_case.bend | ||
--- | ||
[4m[1m[31mErrors:[0m | ||
In tests/golden_tests/parse_file/fold_missing_case.bend : | ||
[1m- expected:[0m case | ||
[1m- detected:[0m end of input | ||
[0m 4 | [4m[31m [0m |
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 @@ | ||
--- | ||
source: tests/golden_tests.rs | ||
input_file: tests/golden_tests/parse_file/if_missing_else.bend | ||
--- | ||
[4m[1m[31mErrors:[0m | ||
In tests/golden_tests/parse_file/if_missing_else.bend : | ||
[1m- expected:[0m else or elif | ||
[1m- detected:[0m end of input | ||
[0m 5 | [4m[31m [0m |
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 @@ | ||
--- | ||
source: tests/golden_tests.rs | ||
input_file: tests/golden_tests/parse_file/match_missing_case.bend | ||
--- | ||
[4m[1m[31mErrors:[0m | ||
In tests/golden_tests/parse_file/match_missing_case.bend : | ||
[1m- expected:[0m case | ||
[1m- detected:[0m end of input | ||
[0m 4 | [4m[31m [0m |