aboutsummaryrefslogtreecommitdiff
path: root/bootstrap/parse.c
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2022-08-08 09:19:07 +0200
committerlemon <lsof@mailbox.org>2022-08-08 09:19:17 +0200
commitbc32ed90d6eaaca6406998961c50c5f5d5ca5260 (patch)
treee50939f376d63e8266aff0daeec01db6e087a97a /bootstrap/parse.c
parentf8a8add7d0e74d20304b3194e836752a9986ddc3 (diff)
lexing fix
Diffstat (limited to 'bootstrap/parse.c')
-rw-r--r--bootstrap/parse.c5
1 files changed, 4 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;