comparison src/luan/interp/ReturnStmt.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 6ca02b188dba
comparison
equal deleted inserted replaced
48:64ecb7a3aad7 49:8ede219cd111
21 this.expressions = expressions; 21 this.expressions = expressions;
22 this.tailFnExpr = null; 22 this.tailFnExpr = null;
23 } 23 }
24 } 24 }
25 25
26 @Override public void eval(LuanStateImpl lua) throws LuanException { 26 @Override public void eval(LuanStateImpl luan) throws LuanException {
27 lua.returnValues = expressions.eval(lua); 27 luan.returnValues = expressions.eval(luan);
28 if( tailFnExpr != null ) { 28 if( tailFnExpr != null ) {
29 LuanFunction tailFn = lua.checkFunction( se, tailFnExpr.eval(lua) ); 29 LuanFunction tailFn = luan.checkFunction( se, tailFnExpr.eval(luan) );
30 if( tailFn instanceof Closure ) { 30 if( tailFn instanceof Closure ) {
31 lua.tailFn = (Closure)tailFn; 31 luan.tailFn = (Closure)tailFn;
32 } else { 32 } else {
33 lua.returnValues = lua.call(tailFn,tailFnExpr.se(),tailFnExpr.se().text(),lua.returnValues); 33 luan.returnValues = luan.call(tailFn,tailFnExpr.se(),tailFnExpr.se().text(),luan.returnValues);
34 } 34 }
35 } 35 }
36 if( throwReturnException ) 36 if( throwReturnException )
37 throw new ReturnException(); 37 throw new ReturnException();
38 } 38 }