Mercurial Hosting > luan
comparison src/luan/interp/GenericForStmt.java @ 31:5cf15507d77e
separate interpreter from interface
git-svn-id: https://luan-java.googlecode.com/svn/trunk@32 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Thu, 13 Dec 2012 02:50:04 +0000 |
parents | d85510d92eee |
children | c3eab5a3ce3c |
comparison
equal
deleted
inserted
replaced
30:8d8f4f5caef4 | 31:5cf15507d77e |
---|---|
1 package luan.interp; | 1 package luan.interp; |
2 | 2 |
3 import luan.Lua; | 3 import luan.Lua; |
4 import luan.LuaState; | |
5 import luan.LuaException; | 4 import luan.LuaException; |
6 import luan.LuaFunction; | 5 import luan.LuaFunction; |
7 | 6 |
8 | 7 |
9 final class GenericForStmt implements Stmt { | 8 final class GenericForStmt implements Stmt { |
17 this.nVars = nVars; | 16 this.nVars = nVars; |
18 this.iterExpr = iterExpr; | 17 this.iterExpr = iterExpr; |
19 this.block = block; | 18 this.block = block; |
20 } | 19 } |
21 | 20 |
22 @Override public void eval(LuaState lua) throws LuaException { | 21 @Override public void eval(LuaStateImpl lua) throws LuaException { |
23 LuaFunction iter = Lua.checkFunction( iterExpr.eval(lua) ); | 22 LuaFunction iter = Lua.checkFunction( iterExpr.eval(lua) ); |
24 Object[] stack = lua.stack(); | 23 Object[] stack = lua.stack(); |
25 try { | 24 try { |
26 while(true) { | 25 while(true) { |
27 Object[] vals = iter.call(lua); | 26 Object[] vals = iter.call(lua); |