Beispiel #1
0
 private void AddError(int errorId, SourceSpan errorPosition, params object[] args)
 {
     if (m_errorList != null)
     {
         m_errorList.AddError(errorId, errorPosition, args);
     }
 }
Beispiel #2
0
        public object GetResult(int index, CompilationErrorList errorList)
        {
            CodeContract.RequiresArgumentInRange(index >= 0 && index < m_acceptedHeads.Count, "index", "index is out of range");

            var head = m_acceptedHeads[index];

            if (head.Errors != null && errorList != null)
            {
                //aggregate errors
                foreach (var error in head.Errors)
                {
                    int errorId = error.ErrorId ?? m_errorDef.OtherErrorId;

                    errorList.AddError(errorId, error.ErrorPosition, error.ErrorArgument, error.ErrorArgument2);
                }
            }

            return(head.TopStackValue);
        }
Beispiel #3
0
        public object GetResult(int index, CompilationErrorList errorList)
        {
            CodeContract.RequiresArgumentInRange(index >= 0 && index < m_acceptedHeads.Count, "index", "index is out of range");

            var head = m_acceptedHeads[index];

            if (head.Errors != null && errorList != null)
            {
                //aggregate errors
                foreach (var error in head.Errors)
                {
                    int errorId = error.ErrorId ?? m_errorDef.OtherErrorId;

                    errorList.AddError(errorId, error.ErrorPosition, error.ErrorArgument, error.ErrorArgument2);
                }
            }

            return head.TopStackValue;
        }