Mercurial Hosting > luan
view src/luan/interp/RepeatStmt.java @ 48:64ecb7a3aad7
rename Lua to Luan
git-svn-id: https://luan-java.googlecode.com/svn/trunk@49 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Fri, 28 Dec 2012 03:29:12 +0000 |
parents | 5cf15507d77e |
children | 8ede219cd111 |
line wrap: on
line source
package luan.interp; import luan.Luan; import luan.LuanException; final class RepeatStmt implements Stmt { private final Stmt doStmt; private final Expr cnd; RepeatStmt(Stmt doStmt,Expr cnd) { this.doStmt = doStmt; this.cnd = cnd; } @Override public void eval(LuanStateImpl lua) throws LuanException { try { do { doStmt.eval(lua); } while( !Luan.toBoolean( cnd.eval(lua) ) ); } catch(BreakException e) {} } }