Mercurial Hosting > luan
comparison src/luan/interp/FnCall.java @ 49:8ede219cd111
add WebShell
git-svn-id: https://luan-java.googlecode.com/svn/trunk@50 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Fri, 28 Dec 2012 19:35:04 +0000 |
parents | 64ecb7a3aad7 |
children | c84274b18f0c |
comparison
equal
deleted
inserted
replaced
48:64ecb7a3aad7 | 49:8ede219cd111 |
---|---|
16 this.fnExpr = fnExpr; | 16 this.fnExpr = fnExpr; |
17 this.args = args; | 17 this.args = args; |
18 this.fnName = fnExpr.se().text(); | 18 this.fnName = fnExpr.se().text(); |
19 } | 19 } |
20 | 20 |
21 @Override public Object[] eval(LuanStateImpl lua) throws LuanException { | 21 @Override public Object[] eval(LuanStateImpl luan) throws LuanException { |
22 return call( lua, fnExpr.eval(lua) ); | 22 return call( luan, fnExpr.eval(luan) ); |
23 } | 23 } |
24 | 24 |
25 private Object[] call(LuanStateImpl lua,Object o) throws LuanException { | 25 private Object[] call(LuanStateImpl luan,Object o) throws LuanException { |
26 if( o instanceof LuanFunction ) { | 26 if( o instanceof LuanFunction ) { |
27 LuanFunction fn = (LuanFunction)o; | 27 LuanFunction fn = (LuanFunction)o; |
28 return lua.call( fn, se, fnName, args.eval(lua) ); | 28 return luan.call( fn, se, fnName, args.eval(luan) ); |
29 } | 29 } |
30 Object h = lua.getHandler("__call",o); | 30 Object h = luan.getHandler("__call",o); |
31 if( h != null ) | 31 if( h != null ) |
32 return call(lua,h); | 32 return call(luan,h); |
33 throw new LuanException( lua, se, "attempt to call a " + Luan.type(o) + " value" ); | 33 throw new LuanException( luan, se, "attempt to call a " + Luan.type(o) + " value" ); |
34 } | 34 } |
35 } | 35 } |