Mercurial Hosting > luan
comparison src/luan/interp/TableExpr.java @ 46:a443637829c1
remove LuaNumber
git-svn-id: https://luan-java.googlecode.com/svn/trunk@47 21e917c8-12df-6dd8-5cb6-c86387c605b9
| author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
|---|---|
| date | Thu, 27 Dec 2012 01:48:36 +0000 |
| parents | 57054fa43189 |
| children | 64ecb7a3aad7 |
comparison
equal
deleted
inserted
replaced
| 45:b1b14d09fc98 | 46:a443637829c1 |
|---|---|
| 1 package luan.interp; | 1 package luan.interp; |
| 2 | 2 |
| 3 import luan.LuaException; | 3 import luan.LuaException; |
| 4 import luan.LuaTable; | 4 import luan.LuaTable; |
| 5 import luan.LuaNumber; | |
| 6 import luan.LuaSource; | 5 import luan.LuaSource; |
| 7 | 6 |
| 8 | 7 |
| 9 final class TableExpr extends CodeImpl implements Expr { | 8 final class TableExpr extends CodeImpl implements Expr { |
| 10 | 9 |
| 32 for( Field field : fields ) { | 31 for( Field field : fields ) { |
| 33 table.put( field.key.eval(lua), field.value.eval(lua) ); | 32 table.put( field.key.eval(lua), field.value.eval(lua) ); |
| 34 } | 33 } |
| 35 Object[] a = expressions.eval(lua); | 34 Object[] a = expressions.eval(lua); |
| 36 for( int i=0; i<a.length; i++ ) { | 35 for( int i=0; i<a.length; i++ ) { |
| 37 table.put( LuaNumber.of(i+1), a[i] ); | 36 table.put( i+1, a[i] ); |
| 38 } | 37 } |
| 39 return table; | 38 return table; |
| 40 } | 39 } |
| 41 } | 40 } |
