public static IList <Diagnostic> GetParseDiagnostics(this SyntaxBase syntax) { var diagnostics = new List <Diagnostic>(); var parseErrorVisitor = new ParseDiagnosticsVisitor(diagnostics); parseErrorVisitor.Visit(syntax); // TODO: Remove this when we fix IL limitations var emitLimitationVisitor = new EmitLimitationVisitor(diagnostics); emitLimitationVisitor.Visit(syntax); return(diagnostics); }
/// <summary> /// Gets all the semantic diagnostics unsorted. Does not include parser and lexer diagnostics. /// </summary> /// <returns></returns> public IEnumerable <ErrorDiagnostic> GetSemanticDiagnostics() { var diagnostics = new List <ErrorDiagnostic>(); var visitor = new SemanticErrorVisitor(diagnostics); visitor.Visit(this.Root); // TODO: Remove this when we fix IL limitations var emitLimitationVisitor = new EmitLimitationVisitor(diagnostics, this); emitLimitationVisitor.Visit(this.Root.Syntax); return(diagnostics); }
/// <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); }