From: fennecdjay Date: Thu, 12 Nov 2020 18:28:44 +0000 (+0100) Subject: :art: Improve exp location X-Git-Tag: nightly~1155 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=1e55c1a12c0275467a71bf529638b15da4c0dadb;p=gwion.git :art: Improve exp location --- diff --git a/ast b/ast index 43c1eb04..668bf446 160000 --- a/ast +++ b/ast @@ -1 +1 @@ -Subproject commit 43c1eb04340b41b4ddb44deb0322d4e4f62a2969 +Subproject commit 668bf4463056cd0fb19e9f66c8ba60f9d5d8275b diff --git a/src/emit/emit.c b/src/emit/emit.c index 0888cf66..add8932d 100644 --- a/src/emit/emit.c +++ b/src/emit/emit.c @@ -1710,7 +1710,7 @@ ANN static m_bool emit_union_def(const Emitter emit, const Union_Def udef) { type_decl->flag = udef->flag; const Var_Decl var_decl = new_var_decl(emit->gwion->mp, udef->xid, NULL, loc_cpy(emit->gwion->mp, udef->pos)); const Var_Decl_List var_decl_list = new_var_decl_list(emit->gwion->mp, var_decl, NULL); - const Exp exp = new_exp_decl(emit->gwion->mp, type_decl, var_decl_list); + const Exp exp = new_exp_decl(emit->gwion->mp, type_decl, var_decl_list, loc_cpy(emit->gwion->mp, udef->pos)); exp->d.exp_decl.type = udef->value->type; var_decl->value = udef->value; const m_bool ret = emit_exp_decl(emit, &exp->d.exp_decl); diff --git a/src/import/import_udef.c b/src/import/import_udef.c index aaa603ff..8c58aa22 100644 --- a/src/import/import_udef.c +++ b/src/import/import_udef.c @@ -19,7 +19,7 @@ ANN Exp make_exp(const Gwi gwi, const m_str type, const m_str name) { DECL_OO(Type_Decl*, td, = gwi_str2decl(gwi, type)) const Var_Decl_List vlist = gwi_str2varlist(gwi, name); if(vlist) - return new_exp_decl(gwi->gwion->mp, td, vlist); + return new_exp_decl(gwi->gwion->mp, td, vlist, loc(gwi)); free_type_decl(gwi->gwion->mp, td); return NULL; } diff --git a/src/lib/object_op.c b/src/lib/object_op.c index 18545e9e..4b7f7111 100644 --- a/src/lib/object_op.c +++ b/src/lib/object_op.c @@ -407,7 +407,7 @@ ANN static inline Symbol dot_symbol(SymTable *st, const Value v) { ANN Exp symbol_owned_exp(const Gwion gwion, const Symbol *data) { const Value v = prim_self(data)->value; const Exp base = new_prim_id(gwion->mp, dot_symbol(gwion->st, v), loc_cpy(gwion->mp, prim_pos(data))); - const Exp dot = new_exp_dot(gwion->mp, base, *data); + const Exp dot = new_exp_dot(gwion->mp, base, *data, loc_cpy(gwion->mp, prim_pos(data))); const Type owner = v->from->owner_class; dot->d.exp_dot.t_base = dot->d.exp_dot.base->info->type = !GET_FLAG(v, static) ? owner : type_class(gwion, owner);