예제 #1
0
        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);
            }
        }
예제 #2
0
파일: Parser.cs 프로젝트: Jornason/UniLua
		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;
		}