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

Unified Diff: runtime/vm/parser.cc

Issue 9958041: Fix issue 1569 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 | tests/language/language.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 6111)
+++ runtime/vm/parser.cc (working copy)
@@ -2476,7 +2476,7 @@
if (CurrentToken() != Token::kLPAREN) {
ErrorMsg("left parenthesis expected");
}
- } else if ((CurrentToken() == Token::kGET) &&
+ } else if ((CurrentToken() == Token::kGET) && !member.has_var &&
(LookaheadToken(1) != Token::kLPAREN) &&
(LookaheadToken(1) != Token::kASSIGN) &&
(LookaheadToken(1) != Token::kCOMMA) &&
@@ -2485,8 +2485,11 @@
member.kind = RawFunction::kGetterFunction;
member.name_pos = this->token_index_;
member.name = ExpectIdentifier("identifier expected");
+ if (CurrentToken() != Token::kLPAREN) {
+ ErrorMsg("'(' expected");
+ }
// If the result type was not specified, it will be set to DynamicType.
- } else if ((CurrentToken() == Token::kSET) &&
+ } else if ((CurrentToken() == Token::kSET) && !member.has_var &&
(LookaheadToken(1) != Token::kLPAREN) &&
(LookaheadToken(1) != Token::kASSIGN) &&
(LookaheadToken(1) != Token::kCOMMA) &&
@@ -2495,12 +2498,15 @@
member.kind = RawFunction::kSetterFunction;
member.name_pos = this->token_index_;
member.name = ExpectIdentifier("identifier expected");
+ if (CurrentToken() != Token::kLPAREN) {
+ ErrorMsg("'(' expected");
+ }
// The grammar allows a return type, so member.type is not always NULL here.
// If no return type is specified, the return type of the setter is Dynamic.
if (member.type == NULL) {
member.type = &Type::ZoneHandle(Type::DynamicType());
}
- } else if ((CurrentToken() == Token::kOPERATOR) &&
+ } else if ((CurrentToken() == Token::kOPERATOR) && !member.has_var &&
(LookaheadToken(1) != Token::kLPAREN) &&
(LookaheadToken(1) != Token::kASSIGN) &&
(LookaheadToken(1) != Token::kCOMMA) &&
« no previous file with comments | « no previous file | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698