Mercurial Hosting > luan
diff src/luan/interp/SetTableEntry.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 | e3624b7cd603 |
children | 8ede219cd111 |
line wrap: on
line diff
--- a/src/luan/interp/SetTableEntry.java Thu Dec 27 04:36:44 2012 +0000 +++ b/src/luan/interp/SetTableEntry.java Fri Dec 28 03:29:12 2012 +0000 @@ -1,30 +1,30 @@ package luan.interp; -import luan.LuaException; -import luan.LuaTable; -import luan.Lua; -import luan.LuaFunction; -import luan.LuaSource; +import luan.LuanException; +import luan.LuanTable; +import luan.Luan; +import luan.LuanFunction; +import luan.LuanSource; final class SetTableEntry extends CodeImpl implements Settable { private final Expr tableExpr; private final Expr keyExpr; - SetTableEntry(LuaSource.Element se,Expr tableExpr,Expr keyExpr) { + SetTableEntry(LuanSource.Element se,Expr tableExpr,Expr keyExpr) { super(se); this.tableExpr = tableExpr; this.keyExpr = keyExpr; } - @Override public void set(LuaStateImpl lua,Object value) throws LuaException { + @Override public void set(LuanStateImpl lua,Object value) throws LuanException { newindex( lua, tableExpr.eval(lua), keyExpr.eval(lua), value ); } - private void newindex(LuaStateImpl lua,Object t,Object key,Object value) throws LuaException { + private void newindex(LuanStateImpl lua,Object t,Object key,Object value) throws LuanException { Object h; - if( t instanceof LuaTable ) { - LuaTable table = (LuaTable)t; + if( t instanceof LuanTable ) { + LuanTable table = (LuanTable)t; Object old = table.put(key,value); if( old != null ) return; @@ -35,10 +35,10 @@ } else { h = lua.getHandler("__newindex",t); if( h==null ) - throw new LuaException( lua, se, "attempt to index a " + Lua.type(t) + " value" ); + throw new LuanException( lua, se, "attempt to index a " + Luan.type(t) + " value" ); } - if( h instanceof LuaFunction ) { - LuaFunction fn = (LuaFunction)h; + if( h instanceof LuanFunction ) { + LuanFunction fn = (LuanFunction)h; lua.call(fn,se,"__newindex",t,key,value); } newindex(lua,h,key,value);