haxe3 IntIterator fix
This commit is contained in:
@@ -71,7 +71,7 @@ class Test {
|
||||
test("var y = 0; var add = function(a) y += a; add(5); add(3); y", 8);
|
||||
test("var a = [1,[2,[3,[4,null]]]]; var t = 0; while( a != null ) { t += a[0]; a = a[1]; }; t",10);
|
||||
test("var t = 0; for( x in 1...10 ) t += x; t",45);
|
||||
test("var t = 0; for( x in new IntIter(1,10) ) t +=x; t",45,{ IntIter : IntIter });
|
||||
test("var t = 0; for( x in new IntIter(1,10) ) t +=x; t",45,{ IntIter : #if (haxe3 || haxe_211) IntIterator #else IntIter #end });
|
||||
test("var x = 1; try { var x = 66; throw 789; } catch( e : Dynamic ) e + x",790);
|
||||
test("var x = 1; var f = function(x) throw x; try f(55) catch( e : Dynamic ) e + x",56);
|
||||
test("var i=2; if( true ) --i; i",1);
|
||||
|
||||
+1
-1
@@ -72,7 +72,7 @@ class Interp {
|
||||
binops.set("||",function(e1,e2) return me.expr(e1) == true || me.expr(e2) == true);
|
||||
binops.set("&&",function(e1,e2) return me.expr(e1) == true && me.expr(e2) == true);
|
||||
binops.set("=",assign);
|
||||
binops.set("...",function(e1,e2) return new IntIter(me.expr(e1),me.expr(e2)));
|
||||
binops.set("...",function(e1,e2) return new #if (haxe_211 || haxe3) IntIterator #else IntIter #end(me.expr(e1),me.expr(e2)));
|
||||
assignOp("+=",function(v1:Dynamic,v2:Dynamic) return v1 + v2);
|
||||
assignOp("-=",function(v1:Float,v2:Float) return v1 - v2);
|
||||
assignOp("*=",function(v1:Float,v2:Float) return v1 * v2);
|
||||
|
||||
Reference in New Issue
Block a user