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

Unified Diff: pkg/analyzer/lib/src/generated/parser.dart

Issue 1044383002: improve parser recovery when top level function is missing parameters (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 5 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
Index: pkg/analyzer/lib/src/generated/parser.dart
diff --git a/pkg/analyzer/lib/src/generated/parser.dart b/pkg/analyzer/lib/src/generated/parser.dart
index 9ee83b9be93c5ac429969020d6540881fdfe41dc..60e873b2dd0e70d5ff02d85623173f441f11b333 100644
--- a/pkg/analyzer/lib/src/generated/parser.dart
+++ b/pkg/analyzer/lib/src/generated/parser.dart
@@ -5738,6 +5738,9 @@ class Parser {
} else {
_reportErrorForCurrentToken(
ParserErrorCode.MISSING_FUNCTION_PARAMETERS);
+ parameters = new FormalParameterList(
+ _createSyntheticToken(TokenType.OPEN_PAREN), null, null, null,
+ _createSyntheticToken(TokenType.CLOSE_PAREN));
}
} else if (_matches(TokenType.OPEN_PAREN)) {
_reportErrorForCurrentToken(ParserErrorCode.GETTER_WITH_PARAMETERS);
« no previous file with comments | « pkg/analysis_server/test/services/completion/local_computer_test.dart ('k') | pkg/analyzer/test/generated/parser_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698