Mercurial Hosting > luan
comparison src/luan/interp/FnCall.java @ 11:b7d7069fee58
add assignment statement and CmdLine
git-svn-id: https://luan-java.googlecode.com/svn/trunk@12 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Thu, 22 Nov 2012 10:51:56 +0000 |
parents | 7a2cdbc5767f |
children | 9cea1aea5eef |
comparison
equal
deleted
inserted
replaced
10:8217d8485715 | 11:b7d7069fee58 |
---|---|
6 import luan.LuaFunction; | 6 import luan.LuaFunction; |
7 import luan.LuaException; | 7 import luan.LuaException; |
8 import luan.LuaState; | 8 import luan.LuaState; |
9 | 9 |
10 | 10 |
11 final class FnCall extends Values { | 11 final class FnCall implements Expressions { |
12 private final Expr fnExpr; | 12 private final Expr fnExpr; |
13 private final Values args; | 13 private final Expressions args; |
14 | 14 |
15 FnCall(Expr fnExpr,Values args) { | 15 FnCall(Expr fnExpr,Expressions args) { |
16 this.fnExpr = fnExpr; | 16 this.fnExpr = fnExpr; |
17 this.args = args; | 17 this.args = args; |
18 } | 18 } |
19 | 19 |
20 List eval(LuaState lua) throws LuaException { | 20 @Override public List eval(LuaState lua) throws LuaException { |
21 LuaFunction fn = Lua.checkFunction( fnExpr.eval(lua) ); | 21 LuaFunction fn = Lua.checkFunction( fnExpr.eval(lua) ); |
22 return Arrays.asList( fn.call( args.eval(lua).toArray() ) ); | 22 return Arrays.asList( fn.call( args.eval(lua).toArray() ) ); |
23 } | 23 } |
24 } | 24 } |