CreateInternalCompilerErrorMessage() protected static méthode

protected static CreateInternalCompilerErrorMessage ( string compileroutput ) : CompilerMessage
compileroutput string
Résultat CompilerMessage
Exemple #1
0
        public virtual IEnumerable <CompilerMessage> Parse(string[] errorOutput, string[] standardOutput, bool compilationHadFailure)
        {
            bool flag = false;
            List <CompilerMessage> compilerMessageList = new List <CompilerMessage>();
            Regex outputRegex = this.GetOutputRegex();

            foreach (string line in errorOutput)
            {
                string input = line.Length <= 1000 ? line : line.Substring(0, 100);
                Match  match = outputRegex.Match(input);
                if (match.Success)
                {
                    CompilerMessage fromMatchedRegex = CompilerOutputParserBase.CreateCompilerMessageFromMatchedRegex(line, match, this.GetErrorIdentifier());
                    fromMatchedRegex.normalizedStatus = this.NormalizedStatusFor(match);
                    if (fromMatchedRegex.type == CompilerMessageType.Error)
                    {
                        flag = true;
                    }
                    compilerMessageList.Add(fromMatchedRegex);
                }
            }
            if (compilationHadFailure && !flag)
            {
                compilerMessageList.Add(CompilerOutputParserBase.CreateInternalCompilerErrorMessage(errorOutput));
            }
            return((IEnumerable <CompilerMessage>)compilerMessageList);
        }
        public virtual IEnumerable <CompilerMessage> Parse(string[] errorOutput, string[] standardOutput, bool compilationHadFailure)
        {
            bool flag = false;
            List <CompilerMessage> list = new List <CompilerMessage>();
            Regex outputRegex           = this.GetOutputRegex();

            for (int i = 0; i < errorOutput.Length; i++)
            {
                string text  = errorOutput[i];
                string input = (text.Length <= 1000) ? text : text.Substring(0, 100);
                Match  match = outputRegex.Match(input);
                if (match.Success)
                {
                    CompilerMessage item = CompilerOutputParserBase.CreateCompilerMessageFromMatchedRegex(text, match, this.GetErrorIdentifier());
                    item.normalizedStatus = this.NormalizedStatusFor(match);
                    if (item.type == CompilerMessageType.Error)
                    {
                        flag = true;
                    }
                    list.Add(item);
                }
            }
            if (compilationHadFailure && !flag)
            {
                list.Add(CompilerOutputParserBase.CreateInternalCompilerErrorMessage(errorOutput));
            }
            return(list);
        }