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

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

Issue 739723003: Incremental parser fix: handle insertion of "final" before field decl. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix bogus test Created 6 years, 1 month 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_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 16d1ff2ff95de5f4111d0f602b0dee593e2d9a70..45a62e3a85f1480e523d5a5d20eb4de97379358d 100644
--- a/pkg/analyzer/lib/src/generated/parser.dart
+++ b/pkg/analyzer/lib/src/generated/parser.dart
@@ -1709,6 +1709,13 @@ class IncrementalParseDispatcher implements AstVisitor<AstNode> {
throw new InsufficientContextException();
} else if (node.metadata.contains(_oldNode)) {
return _parser.parseAnnotation();
+ } else if (identical(_oldNode, node.type)) {
+ // There is not enough context to know whether we should reparse the type
+ // using parseReturnType() (which allows 'void') or parseTypeName()
+ // (which doesn't). Note that even though the language disallows
+ // variables of type 'void', the parser sometimes accepts them in the
+ // course of error recovery (e.g. "class C { void v; }"
+ throw new InsufficientContextException();
} else if (node.variables.contains(_oldNode)) {
throw new InsufficientContextException();
}
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/parser_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698