public LFunction(BHeader header, int[] code, LLocal[] locals, LObject[] constants, LUpvalue[] upvalues, LFunction[] functions, int maximumStackSize, int numUpValues, int numParams, int vararg) { this.header = header; this.code = code; this.locals = locals; this.constants = constants; this.upvalues = upvalues; this.functions = functions; this.maximumStackSize = maximumStackSize; this.numUpvalues = numUpValues; this.numParams = numParams; this.vararg = vararg; }
public override bool IsUpvalueOf(int register) { for (int i = 0; i < _function.Upvalues.Length; i++) { LUpvalue upvalue = _function.Upvalues[i]; if (upvalue.InStack && upvalue.Index == register) { return(true); } } return(false); }
public override bool Equals(object obj) { if (obj is LUpvalue) { LUpvalue upvalue = (LUpvalue)obj; if (!(instack == upvalue.instack && idx == upvalue.idx)) { return(false); } if (name == upvalue.name) { return(true); } return(name != null && name.Equals(upvalue.name)); } else { return(false); } }