Mercurial Hosting > luan
comparison src/luan/interp/TableExpr.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 | 0e406bd9ac7b |
children | e51906de0f11 |
comparison
equal
deleted
inserted
replaced
30:8d8f4f5caef4 | 31:5cf15507d77e |
---|---|
1 package luan.interp; | 1 package luan.interp; |
2 | 2 |
3 import luan.LuaException; | 3 import luan.LuaException; |
4 import luan.LuaState; | |
5 import luan.LuaTable; | 4 import luan.LuaTable; |
6 import luan.LuaNumber; | 5 import luan.LuaNumber; |
7 | 6 |
8 | 7 |
9 final class TableExpr implements Expr { | 8 final class TableExpr implements Expr { |
24 TableExpr(Field[] fields,Expressions expressions) { | 23 TableExpr(Field[] fields,Expressions expressions) { |
25 this.fields = fields; | 24 this.fields = fields; |
26 this.expressions = expressions; | 25 this.expressions = expressions; |
27 } | 26 } |
28 | 27 |
29 @Override public Object eval(LuaState lua) throws LuaException { | 28 @Override public Object eval(LuaStateImpl lua) throws LuaException { |
30 LuaTable table = new LuaTable(); | 29 LuaTable table = new LuaTable(); |
31 for( Field field : fields ) { | 30 for( Field field : fields ) { |
32 table.set( field.key.eval(lua), field.value.eval(lua) ); | 31 table.set( field.key.eval(lua), field.value.eval(lua) ); |
33 } | 32 } |
34 Object[] a = expressions.eval(lua); | 33 Object[] a = expressions.eval(lua); |