diff src/luan/interp/NumericForStmt.java @ 88:6ca02b188dba

add LuanBit to clean up code; add repr(); git-svn-id: https://luan-java.googlecode.com/svn/trunk@89 21e917c8-12df-6dd8-5cb6-c86387c605b9
author fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
date Wed, 27 Feb 2013 23:50:32 +0000
parents 8ede219cd111
children
line wrap: on
line diff
--- a/src/luan/interp/NumericForStmt.java	Wed Feb 27 19:42:09 2013 +0000
+++ b/src/luan/interp/NumericForStmt.java	Wed Feb 27 23:50:32 2013 +0000
@@ -3,6 +3,7 @@
 import luan.Luan;
 import luan.LuanException;
 import luan.LuanSource;
+import luan.LuanBit;
 
 
 final class NumericForStmt extends CodeImpl implements Stmt {
@@ -22,9 +23,10 @@
 	}
 
 	@Override public void eval(LuanStateImpl luan) throws LuanException {
-		double v = luan.checkNumber( se, fromExpr.eval(luan) ).doubleValue();
-		double limit = luan.checkNumber( se, toExpr.eval(luan) ).doubleValue();
-		double step = luan.checkNumber( se, stepExpr.eval(luan) ).doubleValue();
+		LuanBit bit = luan.bit(se);
+		double v = bit.checkNumber( fromExpr.eval(luan) ).doubleValue();
+		double limit = bit.checkNumber( toExpr.eval(luan) ).doubleValue();
+		double step = bit.checkNumber( stepExpr.eval(luan) ).doubleValue();
 		try {
 			while( step > 0.0 && v <= limit || step < 0.0 && v >= limit ) {
 				luan.stackSet( iVar, v );