]> Nishi Git Mirror - gwion.git/commitdiff
:art: Range improvment and testing
authorJérémie Astor <astor.jeremie@wanadoo.fr>
Sat, 30 Nov 2019 23:37:14 +0000 (00:37 +0100)
committerJérémie Astor <astor.jeremie@wanadoo.fr>
Sat, 30 Nov 2019 23:37:14 +0000 (00:37 +0100)
src/emit/emit.c
tests/range/range_no_match.gw

index f5448f18b5eda0f36e3cbdda4fd58fc2dc82c895..9fbf6d67dbe24e23aeb41e6f416d12f6c67eda93 100644 (file)
@@ -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;
index 091c010478bec5424626717fa418b0dffcdef5e9..e151a033c3b19ac2d8e1656e0b6f3ca07f5ad7ba 100644 (file)
@@ -1,2 +1,2 @@
 #! [contains] range types do not match
-[1:1,2];
+[1:me];