-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test file for #644 (fixed with previous commit?)
- Loading branch information
Showing
2 changed files
with
30 additions
and
0 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,29 @@ | ||
// Issue: https://github.com/koka-lang/koka/issues/644 | ||
fun main() | ||
println("Compiled") | ||
|
||
type token | ||
Int | ||
|
||
value struct token-iter<h> | ||
chars: vector<char> | ||
idx: ref<h, int> | ||
|
||
fun token-iter/next(token-iter: token-iter<h>): <div, read<h>, write<h>> maybe<(int, token)> | ||
// Strange code below to work around issues with early returns in Koka 3.1.2. | ||
// (https://github.com/koka-lang/koka/discussions/643) | ||
|
||
// Skip whitespace | ||
val next-char0 = | ||
match Nothing | ||
Just((_idx, _c)) -> | ||
if True then | ||
return token-iter.next | ||
else | ||
Nothing | ||
Nothing -> Nothing | ||
val tmp = match next-char0 | ||
Nothing -> return Nothing | ||
Just(c) -> c | ||
val (_char-idx, _char) = tmp | ||
Nothing |
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 @@ | ||
Compiled |