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

Unified Diff: dart/lib/compiler/implementation/scanner/listener.dart

Issue 10382084: Don't parse factory keyword as a type. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/lib/compiler/implementation/scanner/listener.dart
diff --git a/dart/lib/compiler/implementation/scanner/listener.dart b/dart/lib/compiler/implementation/scanner/listener.dart
index cb986b4c08dd3bb63de7d14563f296751fc893ac..72a03b3d7f7f4cbdb3dcdf6d6c2fca3c83e4f91f 100644
--- a/dart/lib/compiler/implementation/scanner/listener.dart
+++ b/dart/lib/compiler/implementation/scanner/listener.dart
@@ -1459,9 +1459,14 @@ class PartialFunctionElement extends FunctionElement {
FunctionExpression parseNode(DiagnosticListener listener) {
if (cachedNode != null) return cachedNode;
- cachedNode = parse(listener,
- getCompilationUnit(),
- (p) => p.parseFunction(beginToken, getOrSet));
+ Node parseFunction(Parser p) {
+ if (isMember() && p.optional('factory', beginToken)) {
+ return p.parseFactoryMethod(beginToken);
+ } else {
+ return p.parseFunction(beginToken, getOrSet);
+ }
+ }
+ cachedNode = parse(listener, getCompilationUnit(), parseFunction);
return cachedNode;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698