示例#1
0
        private bool FindCompilationErrorAndWarning(string aText,
                                                    out string aFileName,
                                                    out int aLineNumber,
                                                    out int aColNumber,
                                                    out OTAMessageKind aOTAMessageKind){
            string _RegExpString;

            // Init output
            aFileName = "";
            aLineNumber = 0;
            aColNumber = 0;
            aOTAMessageKind = OTAMessageKind.otamkInfo;

            if ((bool)PropertyRegistry.Get("UseAnt", false)) {
                _RegExpString = @"\[csc\]\s*(?<FileName>.+)\((?<Line>\d+),\s*(?<Col>\d+)\)\:";
            } else {
                _RegExpString = @"\s*(?<FileName>.+)\((?<Line>\d+),\s*(?<Col>\d+)\)\:";
            }

            Regex _Regex = new Regex(_RegExpString,
                                     RegexOptions.IgnoreCase |
                                     RegexOptions.Multiline |
                                     RegexOptions.IgnorePatternWhitespace |
                                     RegexOptions.Compiled);

            Match _Match = _Regex.Match(aText);

            if (_Match.Success) {
                aFileName = _Match.Groups[1].Value;
                aLineNumber = int.Parse(_Match.Groups[2].Value);
                aColNumber = int.Parse(_Match.Groups[3].Value);

                if (aText.IndexOf("error") > -1) {
                    aOTAMessageKind = OTAMessageKind.otamkError;

                    fErrorCount++;
                } else if (aText.IndexOf("warning") > -1) {
                    aOTAMessageKind = OTAMessageKind.otamkWarn;

                    fWarningCount++;
                }

                return true;
            }

            return false;
        }
示例#2
0
        private bool FindInternalError(string aText,
                                       out OTAMessageKind aOTAMessageKind){
            string _RegExpString;

            // Init output
            aOTAMessageKind = OTAMessageKind.otamkInfo;
            
            if ((bool)PropertyRegistry.Get("UseAnt", false)) {
                _RegExpString = @"\[csc\]\serror\sCS";
            } else {
                _RegExpString = @"error\sCS";
            }

            Regex _Regex = new Regex(_RegExpString,
                                     RegexOptions.IgnoreCase |
                                     RegexOptions.Multiline |
                                     RegexOptions.IgnorePatternWhitespace |
                                     RegexOptions.Compiled);

            Match _Match = _Regex.Match(aText);

            if (_Match.Success) {
                aOTAMessageKind = OTAMessageKind.otamkError;
                fErrorCount++;

                return true;
            }

            return false;
        }