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

Unified Diff: pkg/analyzer/lib/analyzer.dart

Issue 204033003: Updating code_transformers to not fail on syntax errors (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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/code_transformers/lib/src/entry_point.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/analyzer.dart
diff --git a/pkg/analyzer/lib/analyzer.dart b/pkg/analyzer/lib/analyzer.dart
index 38942e3e836172671b62cfa170db223871dc7cb7..fc9cfa11e3080626f3bb8446759a0869fb3481b9 100644
--- a/pkg/analyzer/lib/analyzer.dart
+++ b/pkg/analyzer/lib/analyzer.dart
@@ -52,7 +52,8 @@ CompilationUnit parseDartFile(String path) {
///
/// If [name] is passed, it's used in error messages as the name of the code
/// being parsed.
-CompilationUnit parseCompilationUnit(String contents, {String name}) {
+CompilationUnit parseCompilationUnit(String contents,
+ {String name, bool suppressErrors: false}) {
if (name == null) name = '<unknown source>';
var source = new StringSource(contents, name);
var errorCollector = new _ErrorCollector();
@@ -63,7 +64,7 @@ CompilationUnit parseCompilationUnit(String contents, {String name}) {
var unit = parser.parseCompilationUnit(token);
unit.lineInfo = new LineInfo(scanner.lineStarts);
- if (errorCollector.hasErrors) throw errorCollector.group;
+ if (errorCollector.hasErrors && !suppressErrors) throw errorCollector.group;
return unit;
}
« no previous file with comments | « no previous file | pkg/code_transformers/lib/src/entry_point.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698