From 21e608c26f908fcaf81bde53fa7c2e817a7c1ace Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Thu, 12 Nov 2020 19:09:11 +0100 Subject: [PATCH] :art: Improve stmt location --- ast | 2 +- src/import/import_item.c | 2 +- src/lib/lib_func.c | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ast b/ast index d494e153..43c1eb04 160000 --- a/ast +++ b/ast @@ -1 +1 @@ -Subproject commit d494e153638e663c6d8bddbf7751be53c57464e7 +Subproject commit 43c1eb04340b41b4ddb44deb0322d4e4f62a2969 diff --git a/src/import/import_item.c b/src/import/import_item.c index 25bcb7cf..de57a59f 100644 --- a/src/import/import_item.c +++ b/src/import/import_item.c @@ -19,7 +19,7 @@ ANN m_int gwi_item_ini(const Gwi gwi, const restrict m_str type, const restrict ANN static m_int gwi_item_tmpl(const Gwi gwi) { const MemPool mp = gwi->gwion->mp; - const Stmt stmt = new_stmt_exp(mp, ae_stmt_exp, gwi->ck->exp); + const Stmt stmt = new_stmt_exp(mp, ae_stmt_exp, gwi->ck->exp, loc(gwi)); const Stmt_List slist = new_stmt_list(mp, stmt, NULL); Section* section = new_section_stmt_list(mp, slist); const Ast body = new_ast(mp, section, NULL); diff --git a/src/lib/lib_func.c b/src/lib/lib_func.c index 3528e854..4f33ccef 100644 --- a/src/lib/lib_func.c +++ b/src/lib/lib_func.c @@ -282,9 +282,11 @@ static OP_EMIT(opem_fptr_impl) { ANN Type check_exp_unary_spork(const Env env, const Stmt code); ANN static void fork_exp(const Env env, const Exp_Unary* unary) { - const Stmt stmt = new_stmt_exp(env->gwion->mp, ae_stmt_exp, unary->exp); + const Stmt stmt = new_stmt_exp(env->gwion->mp, ae_stmt_exp, unary->exp, + loc_cpy(env->gwion->mp, unary->exp->pos)); const Stmt_List list = new_stmt_list(env->gwion->mp, stmt, NULL); - const Stmt code = new_stmt_code(env->gwion->mp, list); + const Stmt code = new_stmt_code(env->gwion->mp, list, + loc_cpy(env->gwion->mp, unary->exp->pos)); ((Exp_Unary*)unary)->exp = NULL; ((Exp_Unary*)unary)->code = code; } -- 2.43.0