diff options
author | ubq323 <ubq323@ubq323.website> | 2024-06-30 21:56:41 +0100 |
---|---|---|
committer | ubq323 <ubq323@ubq323.website> | 2024-06-30 21:57:58 +0100 |
commit | 567f2ebc2d467b5fc6fdff36c1c7c276fb80adf1 (patch) | |
tree | 7292c671d2f69cd89e8b80205178600d5e160e1c | |
parent | cc9a8ae5495550f2a2b1f6e66ffa60504ad03c1a (diff) |
fix parsing logic bug (for newer versions of packcc)
-rw-r--r-- | com.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -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); } |