private void LoadDebug(LuaProto proto) { int n; proto.Source = LoadString(); // LineInfo n = LoadInt(); #if DEBUG_UNDUMP ULDebug.Log("Load LineInfo:" + n); #endif proto.LineInfo.Clear(); for (int i = 0; i < n; ++i) { proto.LineInfo.Add(LoadInt()); } // LocalVar n = LoadInt(); #if DEBUG_UNDUMP ULDebug.Log("Load LocalVar:" + n); #endif proto.LocVars.Clear(); for (int i = 0; i < n; ++i) { LocVar locVar = new LocVar(); locVar.VarName = LoadString(); locVar.StartPc = LoadInt(); locVar.EndPc = LoadInt(); proto.LocVars.Add(locVar); } // Upvalues' name n = LoadInt(); for (int i = 0; i < n; ++i) { proto.Upvalues[i].Name = LoadString(); } }
private int RegisterLocalVar( string varname ) { var v = new LocVar(); v.VarName = varname; v.StartPc = 0; v.EndPc = 0; CurFunc.Proto.LocVars.Add(v); return CurFunc.Proto.LocVars.Count - 1; }