aboutsummaryrefslogtreecommitdiff
path: root/bootstrap
diff options
context:
space:
mode:
Diffstat (limited to 'bootstrap')
-rw-r--r--bootstrap/parse.c5
-rw-r--r--bootstrap/test2.cff2
2 files changed, 6 insertions, 1 deletions
diff --git a/bootstrap/parse.c b/bootstrap/parse.c
index 3e14dc3..706bfb5 100644
--- a/bootstrap/parse.c
+++ b/bootstrap/parse.c
@@ -136,9 +136,12 @@ aishsep(char c) {
static int
readtilhsep(struct parser *P, char *buf, int n, bool dot) {
int i = 0;
+ bool (*pred)(char) = aishsep;
u8 c;
- while (!aishsep((c = chrpeek(P))) || (dot && c == '.')) {
+ while (!pred((c = chrpeek(P))) || (dot && c == '.')) {
chr(P);
+ if (!aissep(c))
+ pred = aissep;
if (i >= n - 1)
return -1;
buf[i++] = c;
diff --git a/bootstrap/test2.cff b/bootstrap/test2.cff
index ec5fcb0..83e12fe 100644
--- a/bootstrap/test2.cff
+++ b/bootstrap/test2.cff
@@ -42,9 +42,11 @@ extern fn main() void {
case Int i;
i;
case Flo *f;
+ let x f32 = *f;
}
let t = v.#tag;
let i = v.Int;
+ ! v.#tag++;
#:outer for let i = 0; i++ < 10; {
printf("%d\n", i);