Mercurial Hosting > luan
diff src/luan/interp/LenExpr.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 | a443637829c1 |
children | 8ede219cd111 |
line wrap: on
line diff
--- a/src/luan/interp/LenExpr.java Thu Dec 27 04:36:44 2012 +0000 +++ b/src/luan/interp/LenExpr.java Fri Dec 28 03:29:12 2012 +0000 @@ -1,31 +1,31 @@ package luan.interp; -import luan.Lua; -import luan.LuaTable; -import luan.LuaFunction; -import luan.LuaException; -import luan.LuaSource; +import luan.Luan; +import luan.LuanTable; +import luan.LuanFunction; +import luan.LuanException; +import luan.LuanSource; final class LenExpr extends UnaryOpExpr { - LenExpr(LuaSource.Element se,Expr op) { + LenExpr(LuanSource.Element se,Expr op) { super(se,op); } - @Override public Object eval(LuaStateImpl lua) throws LuaException { + @Override public Object eval(LuanStateImpl lua) throws LuanException { Object o = op.eval(lua); if( o instanceof String ) { String s = (String)o; return s.length(); } - LuaFunction fn = lua.getHandlerFunction(se,"__len",o); + LuanFunction fn = lua.getHandlerFunction(se,"__len",o); if( fn != null ) - return Lua.first(lua.call(fn,se,"__len",o)); - if( o instanceof LuaTable ) { - LuaTable t = (LuaTable)o; + return Luan.first(lua.call(fn,se,"__len",o)); + if( o instanceof LuanTable ) { + LuanTable t = (LuanTable)o; return t.length(); } - throw new LuaException( lua, se, "attempt to get length of a " + Lua.type(o) + " value" ); + throw new LuanException( lua, se, "attempt to get length of a " + Luan.type(o) + " value" ); } }