summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--com.c8
1 files 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);
}