Mercurial Hosting > luan
comparison src/luan/interp/WhileStmt.java @ 48:64ecb7a3aad7
rename Lua to Luan
git-svn-id: https://luan-java.googlecode.com/svn/trunk@49 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Fri, 28 Dec 2012 03:29:12 +0000 |
parents | 5cf15507d77e |
children | 8ede219cd111 |
comparison
equal
deleted
inserted
replaced
47:659c7139e903 | 48:64ecb7a3aad7 |
---|---|
1 package luan.interp; | 1 package luan.interp; |
2 | 2 |
3 import luan.Lua; | 3 import luan.Luan; |
4 import luan.LuaException; | 4 import luan.LuanException; |
5 | 5 |
6 | 6 |
7 final class WhileStmt implements Stmt { | 7 final class WhileStmt implements Stmt { |
8 private final Expr cnd; | 8 private final Expr cnd; |
9 private final Stmt doStmt; | 9 private final Stmt doStmt; |
11 WhileStmt(Expr cnd,Stmt doStmt) { | 11 WhileStmt(Expr cnd,Stmt doStmt) { |
12 this.cnd = cnd; | 12 this.cnd = cnd; |
13 this.doStmt = doStmt; | 13 this.doStmt = doStmt; |
14 } | 14 } |
15 | 15 |
16 @Override public void eval(LuaStateImpl lua) throws LuaException { | 16 @Override public void eval(LuanStateImpl lua) throws LuanException { |
17 try { | 17 try { |
18 while( Lua.toBoolean( cnd.eval(lua) ) ) { | 18 while( Luan.toBoolean( cnd.eval(lua) ) ) { |
19 doStmt.eval(lua); | 19 doStmt.eval(lua); |
20 } | 20 } |
21 } catch(BreakException e) {} | 21 } catch(BreakException e) {} |
22 } | 22 } |
23 } | 23 } |