Mercurial Hosting > luan
comparison src/luan/interp/IfStmt.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 IfStmt implements Stmt { | 7 final class IfStmt implements Stmt { |
8 private final Expr cnd; | 8 private final Expr cnd; |
9 final Stmt thenStmt; | 9 final Stmt thenStmt; |
13 this.cnd = cnd; | 13 this.cnd = cnd; |
14 this.thenStmt = thenStmt; | 14 this.thenStmt = thenStmt; |
15 this.elseStmt = elseStmt; | 15 this.elseStmt = elseStmt; |
16 } | 16 } |
17 | 17 |
18 @Override public void eval(LuaStateImpl lua) throws LuaException { | 18 @Override public void eval(LuanStateImpl lua) throws LuanException { |
19 if( Lua.toBoolean( cnd.eval(lua) ) ) { | 19 if( Luan.toBoolean( cnd.eval(lua) ) ) { |
20 thenStmt.eval(lua); | 20 thenStmt.eval(lua); |
21 } else { | 21 } else { |
22 elseStmt.eval(lua); | 22 elseStmt.eval(lua); |
23 } | 23 } |
24 } | 24 } |