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

Unified Diff: pkg/analyzer/lib/src/dart/analysis/file_state.dart

Issue 2752093002: Allow AstBuilder to report parse errors. (Closed)
Patch Set: Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/parser_fasta_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/dart/analysis/file_state.dart
diff --git a/pkg/analyzer/lib/src/dart/analysis/file_state.dart b/pkg/analyzer/lib/src/dart/analysis/file_state.dart
index 11e3674946d17b84a8a4341eea58c226bfca8492..393a0201f845ee40e515362a9f59675e937b6431 100644
--- a/pkg/analyzer/lib/src/dart/analysis/file_state.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/file_state.dart
@@ -359,11 +359,16 @@ class FileState {
try {
fasta.ScannerResult scanResult = fasta.scan(_contentBytes);
- var listener = new fasta.AstBuilder(null, null,
- new _FastaElementStoreProxy(), new _FastaEmptyScope(), uri);
- var parser = new fasta.Parser(listener);
+ var astBuilder = new fasta.AstBuilder(
+ new ErrorReporter(errorListener, source),
+ null,
+ null,
+ new _FastaElementStoreProxy(),
+ new _FastaEmptyScope(),
+ uri);
+ var parser = new fasta.Parser(astBuilder);
parser.parseUnit(scanResult.tokens);
- var unit = listener.pop() as CompilationUnit;
+ var unit = astBuilder.pop() as CompilationUnit;
LineInfo lineInfo = new LineInfo(scanResult.lineStarts);
unit.lineInfo = lineInfo;
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/parser_fasta_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698