From 306b64b519287de16e640976e4353deed62baea8 Mon Sep 17 00:00:00 2001 From: lemon Date: Sat, 8 Nov 2025 12:45:48 +0100 Subject: lex: fix single-line comment eating up preprocessor directive in next line --- c/lex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'c/lex.c') diff --git a/c/lex.c b/c/lex.c index 06457c5..eab9ce3 100644 --- a/c/lex.c +++ b/c/lex.c @@ -479,7 +479,7 @@ Begin: if (match(lx, '=')) RET(TKSETDIV); if (match(lx, '/')) { /* // comment */ - while (!lx->eof && !match(lx, '\n')) + while (!lx->eof && peek(lx, 0) != '\n') next(lx); goto Begin; } -- cgit v1.2.3