Esempio n. 1
0
        private static Location GetLocation(Diagnostic diagnostic, RuntimeModelContext runtimeModelContext, ISourceFile parsedSourceFile, AbsolutePath path)
        {
            var lineAndColumn = diagnostic.GetLineAndColumn(parsedSourceFile);
            var location      = new Location
            {
                Line     = lineAndColumn.Line,
                Position = lineAndColumn.Character,
                File     = path.ToString(runtimeModelContext.PathTable),
            };

            return(location);
        }
Esempio n. 2
0
        private void ReportSemanticError(Diagnostic diagnostic)
        {
            if (diagnostic.File != null)
            {
                var lineAndColumn = diagnostic.GetLineAndColumn(diagnostic.File);
                var location      = new Location
                {
                    Line     = lineAndColumn.Line,
                    Position = lineAndColumn.Character,
                    File     = diagnostic.File.FileName,
                };

                m_logger.CheckerError(LoggingContext, location, diagnostic.MessageText.ToString());
            }
            else
            {
                m_logger.CheckerGlobalError(LoggingContext, diagnostic.MessageText.ToString());
            }
        }
Esempio n. 3
0
        private void ReportSyntaxError(Diagnostic diagnostic)
        {
            Location location = GetLocation(diagnostic);

            m_logger.SyntaxError(LoggingContext, location, diagnostic.MessageText.ToString());
        }