-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update example code and add tests and parsee support for blocks (#406)
* Update example code to match parser sytax and add test tags * Parser changes to support planned features * Add tests for example code using test-each
- Loading branch information
Showing
13 changed files
with
227 additions
and
81 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,27 +1,28 @@ | ||
#!/usr/bin/env tako | ||
// test: all | ||
|
||
test() = { | ||
allocator = import("allocator") | ||
ptr = allocator.allocate(sizeof(Char[100])) | ||
if (ptr == nullptr) { | ||
ptr = allocator.allocate(sizeof(Char)*100) | ||
if(ptr == nullptr, { | ||
print("Success") | ||
exit(0) | ||
} else { | ||
}, { | ||
print("Failure") | ||
} | ||
}) | ||
} | ||
|
||
main() = { | ||
allocator = import("allocator") | ||
logger = import("logger") | ||
|
||
test_logger = logger.new_logger() | ||
with { | ||
with( | ||
allocator.allocate = allocator.report_oom, | ||
system.out = test_logger, | ||
system.error = test_logger, | ||
run = test | ||
} | ||
) | ||
|
||
print(test_logger) | ||
} |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#!/usr/bin/env tako | ||
// test: todo | ||
|
||
fib(n: T, {T: Nat}): T=if(n<=1, 1, fib(n-1)+fib(n-2)) | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#!/usr/bin/env tako | ||
// test: todo parse error | ||
|
||
Bounded = Enum | ||
.open() | ||
|
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 |
---|---|---|
@@ -1,4 +1,6 @@ | ||
#!/usr/bin/env tako | ||
// test: all | ||
|
||
1/*one*/+2/*two*/+3/*three*/ | ||
|
||
/* Comment | ||
|
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#!/usr/bin/env tako | ||
// test: todo parse | ||
|
||
main = { | ||
x3by2 = Vector.new([ | ||
|
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#!/usr/bin/env tako | ||
// test: todo type error fix parse error | ||
|
||
main() = { | ||
x3by2 = Vector.new([ | ||
|
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
Oops, something went wrong.