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

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

Issue 10968067: Allow external top-level getters and setters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 3 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 | dart/lib/isolate/base.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/lib/compiler/implementation/scanner/parser.dart
diff --git a/dart/lib/compiler/implementation/scanner/parser.dart b/dart/lib/compiler/implementation/scanner/parser.dart
index 3ffe95749e9a7721d38f0638d1b1e4eedd3e9939..9139d10745f64835214eca4db35f5300fa4c38b6 100644
--- a/dart/lib/compiler/implementation/scanner/parser.dart
+++ b/dart/lib/compiler/implementation/scanner/parser.dart
@@ -558,9 +558,19 @@ class Parser {
if ((value === '(') || (value === '{') || (value === '=>')) {
isField = false;
break;
- } else if ((value === '=') || (value === ';') || (value === ',')) {
+ } else if ((value === '=') || (value === ',')) {
isField = true;
break;
+ } else if (value === ';') {
+ if (getOrSet != null) {
+ // If we found a "get" keyword, this must be an abstract
+ // getter.
+ isField = (getOrSet.stringValue !== 'get');
+ // TODO(ahe): This feels like a hack.
+ } else {
+ isField = true;
+ }
+ break;
} else {
token = listener.unexpected(token);
if (token.kind === EOF_TOKEN) {
« no previous file with comments | « no previous file | dart/lib/isolate/base.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698