Mercurial Hosting > luan
view core/src/luan/impl/RepeatStmt.java @ 369:85bf9f0379aa
template statements no longer depend on 'Io' being defined
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Fri, 17 Apr 2015 06:25:38 -0600 |
parents | 3dcb0f9bee82 |
children | b48cfa14ba60 |
line wrap: on
line source
package luan.impl; import luan.Luan; import luan.LuanException; import luan.LuanSource; final class RepeatStmt extends CodeImpl implements Stmt { private final Stmt doStmt; private final Expr cnd; RepeatStmt(LuanSource.Element se,Stmt doStmt,Expr cnd) { super(se); this.doStmt = doStmt; this.cnd = cnd; } @Override public void eval(LuanStateImpl luan) throws LuanException { try { do { doStmt.eval(luan); } while( !luan.bit(se).checkBoolean( cnd.eval(luan) ) ); } catch(BreakException e) {} } }