Beispiel #1
0
		private SymbolRef CreateUpValue(BuildTimeScope buildTimeScope, SymbolRef symb, int closuredFrame, int currentFrame)
		{
			// it's a 0-level upvalue. Just create it and we're done.
			if (closuredFrame == currentFrame)
				return m_ClosureBuilders[currentFrame + 1].CreateUpvalue(this, symb);

			SymbolRef upvalue = CreateUpValue(buildTimeScope, symb, closuredFrame, currentFrame - 1);

			return m_ClosureBuilders[currentFrame + 1].CreateUpvalue(this, upvalue);
		}
Beispiel #2
0
        private SymbolRef CreateUpValue(BuildTimeScope buildTimeScope, SymbolRef symb, int closuredFrame, int currentFrame)
        {
            // it's a 0-level upvalue. Just create it and we're done.
            if (closuredFrame == currentFrame)
            {
                return(m_ClosureBuilders[currentFrame + 1].CreateUpvalue(this, symb));
            }

            SymbolRef upvalue = CreateUpValue(buildTimeScope, symb, closuredFrame, currentFrame - 1);

            return(m_ClosureBuilders[currentFrame + 1].CreateUpvalue(this, upvalue));
        }
        public SymbolRef CreateUpvalue(BuildTimeScope scope, SymbolRef symbol)
        {
            for (var i = 0; i < m_Closure.Count; i++)
            {
                if (m_Closure[i].i_Name == symbol.i_Name)
                {
                    return SymbolRef.Upvalue(symbol.i_Name, i);
                }
            }

            m_Closure.Add(symbol);

            if (m_ClosureInstruction != null)
            {
                m_ClosureInstruction.SymbolList = m_Closure.ToArray();
            }

            return SymbolRef.Upvalue(symbol.i_Name, m_Closure.Count - 1);
        }
Beispiel #4
0
		public SymbolRef CreateUpvalue(BuildTimeScope scope, SymbolRef symbol)
		{
			return null;
		}