From: Jérémie Astor Date: Sat, 30 Nov 2019 23:37:14 +0000 (+0100) Subject: :art: Range improvment and testing X-Git-Tag: nightly~2070^2~13 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=46cb425c65060a0b4c40b46ddadae30068e35ee3;p=gwion.git :art: Range improvment and testing --- diff --git a/src/emit/emit.c b/src/emit/emit.c index f5448f18..9fbf6d67 100644 --- a/src/emit/emit.c +++ b/src/emit/emit.c @@ -396,13 +396,15 @@ ANN static m_bool emit_prim_array(const Emitter emit, const Array_Sub *data) { return GW_OK; } +ANN static inline m_bool emit_exp_pop_next(const Emitter emit, Exp e, const m_bool addref); + ANN static m_bool emit_range(const Emitter emit, Range *range) { if(range->start) - CHECK_OB(emit_exp(emit, range->start, 0)) + CHECK_OB(emit_exp_pop_next(emit, range->start, 0)) else regpushi(emit, 0); if(range->end) - CHECK_OB(emit_exp(emit, range->end, 0)) + CHECK_OB(emit_exp_pop_next(emit, range->end, 0)) else regpushi(emit, -1); return GW_OK; diff --git a/tests/range/range_no_match.gw b/tests/range/range_no_match.gw index 091c0104..e151a033 100644 --- a/tests/range/range_no_match.gw +++ b/tests/range/range_no_match.gw @@ -1,2 +1,2 @@ #! [contains] range types do not match -[1:1,2]; +[1:me];