Beispiel #1
0
        //-----------------------------------------------------------------------------------------------------------------------------------------------------

        public HappilLocal <T> Local <T>(IHappilOperand <T> initialValue)
        {
            var local = new HappilLocal <T>(this);

            local.Assign(initialValue);
            return(local);
        }
Beispiel #2
0
        //-----------------------------------------------------------------------------------------------------------------------------------------------------

        internal protected void AddReturnStatement(IHappilOperand <TypeTemplate.TReturn> returnValue)
        {
            if (m_CurrentBodyDefinitionIndex > 0)
            {
                if (object.ReferenceEquals(m_ReturnValueLocal, null))
                {
                    m_ReturnValueLocal = this.Local <TypeTemplate.TReturn>();
                }

                m_ReturnValueLocal.Assign(returnValue.OrNullConstant());
            }
            else
            {
                //TODO: verify that current scope belongs to this method
                StatementScope.Current.AddStatement(new ReturnStatement <TypeTemplate.TReturn>(returnValue));
            }
        }