frontend: remove references to old mie api
This commit is contained in:
@@ -8,8 +8,6 @@
|
||||
#include <ivy/lang/codegen.h>
|
||||
#include <ivy/lang/lex.h>
|
||||
#include <mie/ctx.h>
|
||||
#include <mie/ir/convert.h>
|
||||
#include <mie/ir/value.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -27,7 +25,10 @@ struct repl {
|
||||
struct ivy_lexer *r_lex;
|
||||
struct ivy_parser *r_parse;
|
||||
struct ivy_codegen *r_codegen;
|
||||
|
||||
#if 0
|
||||
struct mie_ir_converter *r_converter;
|
||||
#endif
|
||||
};
|
||||
|
||||
static void skip_line(struct ivy_lexer *lex)
|
||||
@@ -89,17 +90,21 @@ static int repl_eval_node(struct repl *repl, struct ivy_ast_node *node)
|
||||
ivy_codegen_push_eof(repl->r_codegen);
|
||||
|
||||
struct mie_module *mod = ivy_codegen_get_current_module(repl->r_codegen);
|
||||
#if 0
|
||||
mie_ir_converter_set_src_value(repl->r_converter, MIE_VALUE(mod));
|
||||
mie_ir_converter_process(repl->r_converter);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void repl_destroy(struct repl *repl)
|
||||
{
|
||||
#if 0
|
||||
if (repl->r_converter) {
|
||||
mie_ir_converter_destroy(repl->r_converter);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (repl->r_codegen) {
|
||||
ivy_codegen_destroy(repl->r_codegen);
|
||||
@@ -117,9 +122,11 @@ static void repl_destroy(struct repl *repl)
|
||||
line_ed_destroy(repl->r_ed);
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (repl->r_mie) {
|
||||
mie_ctx_destroy(repl->r_mie);
|
||||
}
|
||||
#endif
|
||||
|
||||
free(repl);
|
||||
}
|
||||
@@ -167,6 +174,7 @@ static enum ivy_status repl_create(struct repl **out)
|
||||
return status;
|
||||
}
|
||||
|
||||
#if 0
|
||||
repl->r_converter
|
||||
= mie_ir_converter_create(repl->r_mie, MIE_IR_MEM, MIE_IR_TEXT);
|
||||
if (!repl->r_converter) {
|
||||
@@ -175,6 +183,7 @@ static enum ivy_status repl_create(struct repl **out)
|
||||
}
|
||||
|
||||
mie_ir_converter_set_dest_file(repl->r_converter, stdout);
|
||||
#endif
|
||||
|
||||
*out = repl;
|
||||
return IVY_OK;
|
||||
@@ -217,7 +226,8 @@ int repl(const fx_command *cmd, const fx_arglist *args, const fx_array *_)
|
||||
args, OPT_SHOW_AST_NODES, FX_COMMAND_INVALID_ID)
|
||||
> 0;
|
||||
repl->r_show_ir
|
||||
= fx_arglist_get_count(args, OPT_SHOW_IR, FX_COMMAND_INVALID_ID) > 0;
|
||||
= fx_arglist_get_count(args, OPT_SHOW_IR, FX_COMMAND_INVALID_ID)
|
||||
> 0;
|
||||
|
||||
while (true) {
|
||||
struct ivy_token *tok = ivy_lexer_read(repl->r_lex);
|
||||
@@ -228,8 +238,8 @@ int repl(const fx_command *cmd, const fx_arglist *args, const fx_array *_)
|
||||
|
||||
if (status != IVY_OK) {
|
||||
fx_err("lex error (%s)",
|
||||
ivy_status_to_string(
|
||||
ivy_lexer_get_status(repl->r_lex)));
|
||||
ivy_status_to_string(
|
||||
ivy_lexer_get_status(repl->r_lex)));
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -257,7 +267,7 @@ int repl(const fx_command *cmd, const fx_arglist *args, const fx_array *_)
|
||||
repl_eval_node(repl, unit);
|
||||
ivy_codegen_end_module(repl->r_codegen, &mod);
|
||||
|
||||
mie_value_destroy(MIE_VALUE(mod));
|
||||
// mie_value_destroy(MIE_VALUE(mod));
|
||||
|
||||
#if 0
|
||||
while ((child = ivy_parser_dequeue_node(repl->r_parse))) {
|
||||
@@ -271,7 +281,7 @@ int repl(const fx_command *cmd, const fx_arglist *args, const fx_array *_)
|
||||
return 0;
|
||||
}
|
||||
|
||||
B_COMMAND(CMD_REPL, CMD_ROOT)
|
||||
FX_COMMAND(CMD_REPL, CMD_ROOT)
|
||||
{
|
||||
FX_COMMAND_NAME("shell");
|
||||
FX_COMMAND_SHORT_NAME('S');
|
||||
|
||||
Reference in New Issue
Block a user