From 567f2ebc2d467b5fc6fdff36c1c7c276fb80adf1 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Sun, 30 Jun 2024 21:56:41 +0100 Subject: fix parsing logic bug (for newer versions of packcc) --- com.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/com.c b/com.c index 521adec..4b65ca3 100644 --- a/com.c +++ b/com.c @@ -569,12 +569,10 @@ int main(int argc, char **argv) { AstNode an; memset(&an, 0, sizeof an); pcc_context_t *parser = pcc_create(infile); - int rv; - do { - astnode_free(&an); - rv = pcc_parse(parser, &an); + while (pcc_parse(parser, &an)) { compile_node(&com, an, 0); - } while (rv != 0); + astnode_free(&an); + } pcc_destroy(parser); } -- cgit v1.2.3