Mercurial Hosting > luan
view src/luan/impl/RepeatStmt.java @ 166:4eaee12f6c65
move luan/interp to impl
git-svn-id: https://luan-java.googlecode.com/svn/trunk@167 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Sun, 22 Jun 2014 04:17:38 +0000 |
parents | src/luan/interp/RepeatStmt.java@c9100f29fae0 |
children |
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) {} } }