diff src/luan/interp/RepeatStmt.java @ 151:c9100f29fae0

conditions must be type boolean git-svn-id: https://luan-java.googlecode.com/svn/trunk@152 21e917c8-12df-6dd8-5cb6-c86387c605b9
author fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
date Mon, 16 Jun 2014 10:37:06 +0000
parents 8ede219cd111
children
line wrap: on
line diff
--- a/src/luan/interp/RepeatStmt.java	Mon Jun 16 10:11:48 2014 +0000
+++ b/src/luan/interp/RepeatStmt.java	Mon Jun 16 10:37:06 2014 +0000
@@ -2,13 +2,15 @@
 
 import luan.Luan;
 import luan.LuanException;
+import luan.LuanSource;
 
 
-final class RepeatStmt implements Stmt {
+final class RepeatStmt extends CodeImpl implements Stmt {
 	private final Stmt doStmt;
 	private final Expr cnd;
 
-	RepeatStmt(Stmt doStmt,Expr cnd) {
+	RepeatStmt(LuanSource.Element se,Stmt doStmt,Expr cnd) {
+		super(se);
 		this.doStmt = doStmt;
 		this.cnd = cnd;
 	}
@@ -17,7 +19,7 @@
 		try {
 			do {
 				doStmt.eval(luan);
-			} while( !Luan.toBoolean( cnd.eval(luan) ) );
+			} while( !luan.bit(se).checkBoolean( cnd.eval(luan) ) );
 		} catch(BreakException e) {}
 	}
 }