2007-06-08 05:11:37 +00:00
|
|
|
package lua.io;
|
|
|
|
|
|
2007-06-27 06:43:33 +00:00
|
|
|
import lua.CallFrame;
|
2007-06-08 05:11:37 +00:00
|
|
|
import lua.StackState;
|
2007-06-19 04:25:34 +00:00
|
|
|
import lua.value.LFunction;
|
2007-06-08 05:11:37 +00:00
|
|
|
import lua.value.LValue;
|
|
|
|
|
|
2007-06-19 04:25:34 +00:00
|
|
|
public class Closure extends LFunction {
|
2007-06-08 05:11:37 +00:00
|
|
|
public LValue env;
|
|
|
|
|
public Proto p;
|
|
|
|
|
public UpVal[] upVals;
|
|
|
|
|
public Closure(StackState state, Proto p) {
|
2007-06-27 06:43:33 +00:00
|
|
|
this.env = state._G;
|
2007-06-08 05:11:37 +00:00
|
|
|
this.p = p;
|
|
|
|
|
upVals = new UpVal[p.nups];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// perform a lua call
|
2007-06-27 06:43:33 +00:00
|
|
|
public void luaStackCall(CallFrame call, int base, int top, int nresults) {
|
|
|
|
|
call.state.stackCall( this, base, top, nresults );
|
2007-06-15 06:41:40 +00:00
|
|
|
}
|
2007-06-08 05:11:37 +00:00
|
|
|
}
|