Mercurial Hosting > luan
view core/src/luan/impl/WhileStmt.java @ 557:6268c1ce6ea8
sane queryparser update
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 21 Jun 2015 16:15:52 -0600 |
parents | b48cfa14ba60 |
children | 4723d22062ce |
line wrap: on
line source
package luan.impl; import luan.Luan; import luan.LuanException; import luan.LuanElement; final class WhileStmt extends CodeImpl implements Stmt { private final Expr cnd; private final Stmt doStmt; WhileStmt(LuanElement el,Expr cnd,Stmt doStmt) { super(el); this.cnd = cnd; this.doStmt = doStmt; } @Override public void eval(LuanStateImpl luan) throws LuanException { try { while( luan.bit(el).checkBoolean( cnd.eval(luan) ) ) { doStmt.eval(luan); } } catch(BreakException e) {} } }