Mercurial Hosting > luan
view core/src/luan/impl/RepeatStmt.java @ 645:859c0dedc8b6
remove LuanSource
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Tue, 29 Mar 2016 18:09:51 -0600 |
parents | 4723d22062ce |
children | 8e8c30b72e9b |
line wrap: on
line source
package luan.impl; import luan.Luan; import luan.LuanException; final class RepeatStmt extends CodeImpl 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 luan) throws LuanException { try { do { doStmt.eval(luan); } while( !luan.checkBoolean( cnd.eval(luan) ) ); } catch(BreakException e) {} } }