Mercurial Hosting > luan
view src/luan/interp/RepeatStmt.java @ 31:5cf15507d77e
separate interpreter from interface
git-svn-id: https://luan-java.googlecode.com/svn/trunk@32 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Thu, 13 Dec 2012 02:50:04 +0000 |
parents | d85510d92eee |
children | 64ecb7a3aad7 |
line wrap: on
line source
package luan.interp; import luan.Lua; import luan.LuaException; 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(LuaStateImpl lua) throws LuaException { try { do { doStmt.eval(lua); } while( !Lua.toBoolean( cnd.eval(lua) ) ); } catch(BreakException e) {} } }