Пример #1
0
        /// <summary>
        /// Gets all the semantic diagnostics unsorted. Does not include parser and lexer diagnostics.
        /// </summary>
        /// <returns></returns>
        public IReadOnlyList <Diagnostic> GetSemanticDiagnostics()
        {
            var diagnosticWriter = ToListDiagnosticWriter.Create();

            var visitor = new SemanticDiagnosticVisitor(diagnosticWriter);

            visitor.Visit(this.Root);

            var typeValidationDiagnostics = typeManager.GetAllDiagnostics();

            diagnosticWriter.WriteMultiple(typeValidationDiagnostics);

            return(diagnosticWriter.GetDiagnostics());
        }
Пример #2
0
        /// <summary>
        /// Gets all the semantic diagnostics unsorted. Does not include parser and lexer diagnostics.
        /// </summary>
        /// <returns></returns>
        public IEnumerable <Diagnostic> GetSemanticDiagnostics()
        {
            var diagnostics = new List <Diagnostic>();

            var visitor = new SemanticDiagnosticVisitor(diagnostics);

            visitor.Visit(this.Root);

            var typeValidationDiagnostics = typeManager.GetAllDiagnostics();

            diagnostics.AddRange(typeValidationDiagnostics);

            return(diagnostics);
        }
Пример #3
0
        /// <summary>
        /// Gets all the semantic diagnostics unsorted. Does not include parser and lexer diagnostics.
        /// </summary>
        /// <returns></returns>
        public IEnumerable <Diagnostic> GetSemanticDiagnostics()
        {
            var diagnostics = new List <Diagnostic>();

            var visitor = new SemanticDiagnosticVisitor(diagnostics);

            visitor.Visit(this.Root);

            var typeValidationDiagnostics = TypeValidationVisitor.GetTypeValidationDiagnostics(bindings, typeManager, this.Root.Syntax);

            diagnostics.AddRange(typeValidationDiagnostics);

            // TODO: Remove this when we fix IL limitations
            var emitLimitationVisitor = new EmitLimitationVisitor(diagnostics, this);

            emitLimitationVisitor.Visit(this.Root.Syntax);

            return(diagnostics);
        }