-
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.
* Broken List Parser * fix to main * Small chagnes to pattern match ListExpr * Todo add list with element implentation to Scope * Looping through elements of ListExpr in scope * Add todo message to LowerAst * compiler.unexpected in lowerAst * fix warnings and failing regression test * fix desugarExpr case, add newlines * remove unnecessary file * DesugarLists partial implementation * add dev hints * Desugaring Lists progress, no longer using foldapp * desugar lists with errors * Bypass matching on diff Exprs * Test cases passing * Added more meaningful tests to lists_sample * Fix warnings and style nits * fix imports Co-authored-by: EmilySillars <[email protected]>
- Loading branch information
1 parent
aec5e7d
commit 4d018c1
Showing
8 changed files
with
95 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
1 2 3 | ||
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,34 @@ | ||
type List | ||
Cons Int List | ||
Nil | ||
|
||
puts cout s = | ||
match s | ||
Cons c ss = | ||
after 1, cout <- c | ||
wait cout | ||
after 1, cout <- 32 | ||
wait cout | ||
puts cout ss | ||
Nil = () | ||
|
||
main cin cout = | ||
// check multi element list | ||
let multi_lst = [49,50,51] | ||
puts cout multi_lst | ||
after 1, cout <- 10 | ||
wait cout | ||
|
||
// check singleton list | ||
let single_lst = [49] | ||
puts cout single_lst | ||
|
||
after 1, cout <- 10 | ||
wait cout | ||
|
||
// check empty element list | ||
let empty_lst = [] | ||
puts cout empty_lst | ||
|
||
after 1, cout <- 10 | ||
wait cout |
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 @@ | ||
1 2 3 4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Checking if list ADTs work as intended | ||
// Tests underlying construction of lists | ||
|
||
type List | ||
Cons Int List | ||
Nil | ||
|
||
puts cout s = | ||
match s | ||
Cons c ss = | ||
after 1, cout <- c | ||
wait cout | ||
after 1, cout <- 32 | ||
wait cout | ||
puts cout ss | ||
Nil = () | ||
|
||
main cin cout = | ||
let lst = Cons 49 (Cons 50 (Cons 51 (Cons 52 (Cons 53 Nil)))) | ||
puts cout lst |
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