예제 #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);
        }