diff options
Diffstat (limited to 'yy/main.c')
-rw-r--r-- | yy/main.c | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -56,16 +56,23 @@ int main(int argc, char **argv) return -1; } - struct kalmia_t result; + struct kai_tag_t *document; yyscan_t scanner; kalmialex_init(&scanner); kalmiaset_in(in, scanner); - kalmiaparse(scanner, &result); + int result = kalmiaparse(scanner, &document); kalmialex_destroy(scanner); + fclose(in); - print_tag("", result.tag); - print_level(1, result.tag->children); + if (result != 0) { + return result; + } + + print_tag("", document); + print_level(1, document->children); + + kai_tag_destroy(document); return 0; } |