From bc32ed90d6eaaca6406998961c50c5f5d5ca5260 Mon Sep 17 00:00:00 2001 From: lemon Date: Mon, 8 Aug 2022 09:19:07 +0200 Subject: lexing fix --- bootstrap/parse.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'bootstrap/parse.c') 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; -- cgit v1.2.3