Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(148)

Side by Side Diff: pkg/analyzer/lib/analyzer.dart

Issue 1994243002: Dangling comment reference cleanup in analyzer. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analyzer/lib/dart/ast/ast.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer; 5 library analyzer;
6 6
7 import 'dart:io'; 7 import 'dart:io';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/src/dart/scanner/reader.dart'; 10 import 'package:analyzer/src/dart/scanner/reader.dart';
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 var parser = new Parser(source, errorCollector) 105 var parser = new Parser(source, errorCollector)
106 ..parseFunctionBodies = parseFunctionBodies; 106 ..parseFunctionBodies = parseFunctionBodies;
107 var unit = parser.parseCompilationUnit(token) 107 var unit = parser.parseCompilationUnit(token)
108 ..lineInfo = new LineInfo(scanner.lineStarts); 108 ..lineInfo = new LineInfo(scanner.lineStarts);
109 109
110 if (errorCollector.hasErrors && !suppressErrors) throw errorCollector.group; 110 if (errorCollector.hasErrors && !suppressErrors) throw errorCollector.group;
111 111
112 return unit; 112 return unit;
113 } 113 }
114 114
115 /// A simple error listener that collects errors into an [AnalysisErrorGroup]. 115 /// A simple error listener that collects errors into an [AnalyzerErrorGroup].
116 class _ErrorCollector extends AnalysisErrorListener { 116 class _ErrorCollector extends AnalysisErrorListener {
117 final _errors = <AnalysisError>[]; 117 final _errors = <AnalysisError>[];
118 118
119 _ErrorCollector(); 119 _ErrorCollector();
120 120
121 /// The group of errors collected. 121 /// The group of errors collected.
122 AnalyzerErrorGroup get group => 122 AnalyzerErrorGroup get group =>
123 new AnalyzerErrorGroup.fromAnalysisErrors(_errors); 123 new AnalyzerErrorGroup.fromAnalysisErrors(_errors);
124 124
125 /// Whether any errors where collected. 125 /// Whether any errors where collected.
126 bool get hasErrors => !_errors.isEmpty; 126 bool get hasErrors => !_errors.isEmpty;
127 127
128 @override 128 @override
129 void onError(AnalysisError error) => _errors.add(error); 129 void onError(AnalysisError error) => _errors.add(error);
130 } 130 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/dart/ast/ast.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698