frontend: repl: disable post-order ast printing
This commit is contained in:
@@ -57,17 +57,20 @@ static enum ivy_status add_node_to_codegen(
|
|||||||
static int repl_eval_node(struct repl *repl, struct ivy_ast_node *node)
|
static int repl_eval_node(struct repl *repl, struct ivy_ast_node *node)
|
||||||
{
|
{
|
||||||
struct ivy_ast_node_iterator it = {0};
|
struct ivy_ast_node_iterator it = {0};
|
||||||
struct print_ast_node_args args = {
|
|
||||||
.indent = true,
|
|
||||||
.postorder = false,
|
|
||||||
};
|
|
||||||
|
|
||||||
if (repl->r_show_ast) {
|
if (repl->r_show_ast) {
|
||||||
|
struct print_ast_node_args args = {
|
||||||
|
.indent = true,
|
||||||
|
.postorder = false,
|
||||||
|
};
|
||||||
|
|
||||||
ivy_ast_node_iterate(node, &it, print_ast_node, &args);
|
ivy_ast_node_iterate(node, &it, print_ast_node, &args);
|
||||||
|
#if 0
|
||||||
printf("------\n");
|
printf("------\n");
|
||||||
args.indent = false;
|
args.indent = false;
|
||||||
args.postorder = true;
|
args.postorder = true;
|
||||||
ivy_ast_node_iterate(node, &it, print_ast_node, &args);
|
ivy_ast_node_iterate(node, &it, print_ast_node, &args);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!repl->r_show_ir) {
|
if (!repl->r_show_ir) {
|
||||||
@@ -203,8 +206,6 @@ int repl(const b_command *cmd, const b_arglist *args, const b_array *_)
|
|||||||
repl->r_show_ir
|
repl->r_show_ir
|
||||||
= b_arglist_get_count(args, OPT_SHOW_IR, B_COMMAND_INVALID_ID) > 0;
|
= b_arglist_get_count(args, OPT_SHOW_IR, B_COMMAND_INVALID_ID) > 0;
|
||||||
|
|
||||||
ivy_codegen_start_module(repl->r_codegen);
|
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
struct ivy_token *tok = ivy_lexer_read(repl->r_lex);
|
struct ivy_token *tok = ivy_lexer_read(repl->r_lex);
|
||||||
status = ivy_lexer_get_status(repl->r_lex);
|
status = ivy_lexer_get_status(repl->r_lex);
|
||||||
@@ -237,7 +238,13 @@ int repl(const b_command *cmd, const b_arglist *args, const b_array *_)
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct ivy_ast_node *unit = ivy_parser_root_node(repl->r_parse);
|
struct ivy_ast_node *unit = ivy_parser_root_node(repl->r_parse);
|
||||||
|
struct mie_module *mod = NULL;
|
||||||
|
|
||||||
|
ivy_codegen_start_module(repl->r_codegen);
|
||||||
repl_eval_node(repl, unit);
|
repl_eval_node(repl, unit);
|
||||||
|
ivy_codegen_end_module(repl->r_codegen, &mod);
|
||||||
|
|
||||||
|
mie_value_destroy(MIE_VALUE(mod));
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
while ((child = ivy_parser_dequeue_node(repl->r_parse))) {
|
while ((child = ivy_parser_dequeue_node(repl->r_parse))) {
|
||||||
|
|||||||
Reference in New Issue
Block a user