From 56220732526db9edbe49f3ad86b13bed750f4f71 Mon Sep 17 00:00:00 2001 From: Max Wash Date: Sun, 24 Nov 2024 16:12:49 +0000 Subject: [PATCH] frontend: repl: print and destroy ast nodes after parsing --- frontend/cmd/repl.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/frontend/cmd/repl.c b/frontend/cmd/repl.c index 7d789aa..b51c81c 100644 --- a/frontend/cmd/repl.c +++ b/frontend/cmd/repl.c @@ -108,6 +108,18 @@ static int repl_full() skip_line(lex); continue; } + + if (!ivy_parser_node_complete(parser)) { + continue; + } + + struct ivy_ast_node *node = ivy_parser_dequeue_node(parser); + if (!node) { + continue; + } + + ivy_ast_node_print(node); + ivy_ast_node_destroy(node); } ivy_parser_destroy(parser);