Exemplo n.º 1
0
 void OnSourceFileParsed(IEnumerable <string> files, ParserResult result)
 {
     OnFileParsed(files, result);
 }
Exemplo n.º 2
0
 void OnFileParsed(string file, ParserResult result)
 {
     OnFileParsed(new[] { file }, result);
 }
Exemplo n.º 3
0
        void OnFileParsed(string file, ParserResult result)
        {
            switch (result.Kind)
            {
            case ParserResultKind.Success:
                Diagnostics.EmitMessage(DiagnosticId.ParseResult,
                                        "Parsed '{0}'", file);
                break;

            case ParserResultKind.Error:
                Diagnostics.EmitError(DiagnosticId.ParseResult,
                                      "Error parsing '{0}'", file);
                break;

            case ParserResultKind.FileNotFound:
                Diagnostics.EmitError(DiagnosticId.ParseResult,
                                      "File '{0}' was not found", file);
                break;
            }

#if OLD_PARSER
            foreach (var diag in result.Diagnostics)
            {
                if (Options.IgnoreParseWarnings &&
                    diag.Level == ParserDiagnosticLevel.Warning)
                {
                    continue;
                }

                if (diag.Level == ParserDiagnosticLevel.Note)
                {
                    continue;
                }

                Diagnostics.EmitMessage(DiagnosticId.ParserDiagnostic,
                                        "{0}({1},{2}): {3}: {4}", diag.FileName, diag.LineNumber,
                                        diag.ColumnNumber, diag.Level.ToString().ToLower(),
                                        diag.Message);
            }
#else
            for (uint i = 0; i < result.DiagnosticsCount; ++i)
            {
                var diag = result.getDiagnostics(i);

                if (Options.IgnoreParseWarnings &&
                    diag.Level == ParserDiagnosticLevel.Warning)
                {
                    continue;
                }

                if (diag.Level == ParserDiagnosticLevel.Note)
                {
                    continue;
                }

                Diagnostics.EmitMessage(DiagnosticId.ParserDiagnostic,
                                        "{0}({1},{2}): {3}: {4}", diag.FileName, diag.LineNumber,
                                        diag.ColumnNumber, diag.Level.ToString().ToLower(),
                                        diag.Message);
            }
#endif
        }
Exemplo n.º 4
0
 void OnSourceFileParsed(IList <SourceFile> files, ParserResult result)
 {
     OnFileParsed(files.Select(f => f.Path), result);
 }
Exemplo n.º 5
0
 void OnSourceFileParsed(SourceFile file, ParserResult result)
 {
     OnFileParsed(file.Path, result);
 }