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

Side by Side Diff: runtime/vm/parser.cc

Issue 10820064: Fix issue 977 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/co19/co19-runtime.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/parser.h" 5 #include "vm/parser.h"
6 6
7 #include "vm/bigint_operations.h" 7 #include "vm/bigint_operations.h"
8 #include "vm/class_finalizer.h" 8 #include "vm/class_finalizer.h"
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/compiler_stats.h" 10 #include "vm/compiler_stats.h"
(...skipping 2380 matching lines...) Expand 10 before | Expand all | Expand 10 after
2391 "const constructor '%s' may not have function body", 2391 "const constructor '%s' may not have function body",
2392 method->name->ToCString()); 2392 method->name->ToCString());
2393 } else if (method->IsFactory() && method->has_const) { 2393 } else if (method->IsFactory() && method->has_const) {
2394 ErrorMsg(method->name_pos, 2394 ErrorMsg(method->name_pos,
2395 "const factory '%s' may not have function body", 2395 "const factory '%s' may not have function body",
2396 method->name->ToCString()); 2396 method->name->ToCString());
2397 } else if (members->is_interface()) { 2397 } else if (members->is_interface()) {
2398 ErrorMsg(method->name_pos, 2398 ErrorMsg(method->name_pos,
2399 "function body not allowed in interface declaration"); 2399 "function body not allowed in interface declaration");
2400 } 2400 }
2401 if (method->redirect_name != NULL) {
2402 ErrorMsg(method->name_pos,
2403 "Constructor with redirection may not have function body");
cshapiro 2012/07/27 23:17:12 This might read better with the indefinite article
2404 }
2401 if (CurrentToken() == Token::kLBRACE) { 2405 if (CurrentToken() == Token::kLBRACE) {
2402 SkipBlock(); 2406 SkipBlock();
2403 } else { 2407 } else {
2404 ConsumeToken(); 2408 ConsumeToken();
2405 SkipExpr(); 2409 SkipExpr();
2406 ExpectSemicolon(); 2410 ExpectSemicolon();
2407 } 2411 }
2408 method_end_pos = TokenPos(); 2412 method_end_pos = TokenPos();
2409 } else if (IsLiteral("native")) { 2413 } else if (IsLiteral("native")) {
2410 if (method->has_abstract) { 2414 if (method->has_abstract) {
2411 ErrorMsg(method->name_pos, 2415 ErrorMsg(method->name_pos,
2412 "abstract method '%s' may not have function body", 2416 "abstract method '%s' may not have function body",
2413 method->name->ToCString()); 2417 method->name->ToCString());
2414 } else if (members->is_interface()) { 2418 } else if (members->is_interface()) {
2415 ErrorMsg(method->name_pos, 2419 ErrorMsg(method->name_pos,
2416 "function body not allowed in interface declaration"); 2420 "function body not allowed in interface declaration");
2417 } else if (method->IsConstructor() && method->has_const) { 2421 } else if (method->IsConstructor() && method->has_const) {
2418 ErrorMsg(method->name_pos, 2422 ErrorMsg(method->name_pos,
2419 "const constructor '%s' may not have function body", 2423 "const constructor '%s' may not have function body",
2420 method->name->ToCString()); 2424 method->name->ToCString());
2421 } 2425 }
2426 if (method->redirect_name != NULL) {
2427 ErrorMsg(method->name_pos,
2428 "Constructor with redirection may not have function body");
cshapiro 2012/07/27 23:17:12 ditto
2429 }
2422 ParseNativeDeclaration(); 2430 ParseNativeDeclaration();
2423 } else if (CurrentToken() == Token::kSEMICOLON) { 2431 } else if (CurrentToken() == Token::kSEMICOLON) {
2424 if (members->is_interface() || 2432 if (members->is_interface() ||
2425 method->has_abstract || 2433 method->has_abstract ||
2426 (method->redirect_name != NULL) || 2434 (method->redirect_name != NULL) ||
2427 method->IsConstructor()) { 2435 method->IsConstructor()) {
2428 ConsumeToken(); 2436 ConsumeToken();
2429 } else { 2437 } else {
2430 ErrorMsg(method->name_pos, 2438 ErrorMsg(method->name_pos,
2431 "function body expected for method '%s'", 2439 "function body expected for method '%s'",
(...skipping 6299 matching lines...) Expand 10 before | Expand all | Expand 10 after
8731 void Parser::SkipQualIdent() { 8739 void Parser::SkipQualIdent() {
8732 ASSERT(IsIdentifier()); 8740 ASSERT(IsIdentifier());
8733 ConsumeToken(); 8741 ConsumeToken();
8734 if (CurrentToken() == Token::kPERIOD) { 8742 if (CurrentToken() == Token::kPERIOD) {
8735 ConsumeToken(); // Consume the kPERIOD token. 8743 ConsumeToken(); // Consume the kPERIOD token.
8736 ExpectIdentifier("identifier expected after '.'"); 8744 ExpectIdentifier("identifier expected after '.'");
8737 } 8745 }
8738 } 8746 }
8739 8747
8740 } // namespace dart 8748 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | tests/co19/co19-runtime.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698