private void LoadUpvalues(LuaProto proto) { int n = LoadInt(); #if DEBUG_UNDUMP ULDebug.Log("Load Upvalues:" + n); #endif proto.Upvalues.Clear(); for (int i = 0; i < n; ++i) { UpvalDesc upvalDesc = new UpvalDesc(); upvalDesc.Name = null; upvalDesc.InStack = LoadBoolean(); upvalDesc.Index = (int)LoadByte(); proto.Upvalues.Add(upvalDesc); } }
private int NewUpvalue( FuncState fs, string name, ExpDesc e ) { var f = fs.Proto; int idx = f.Upvalues.Count; var upval = new UpvalDesc(); upval.InStack = (e.Kind == ExpKind.VLOCAL); upval.Index = e.Info; upval.Name = name; f.Upvalues.Add( upval ); return idx; }