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

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

Issue 778213003: Remove overly strict assert around method name token position (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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 | no next file » | 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 "lib/invocation_mirror.h" 7 #include "lib/invocation_mirror.h"
8 #include "platform/utils.h" 8 #include "platform/utils.h"
9 #include "vm/ast_transformer.h" 9 #include "vm/ast_transformer.h"
10 #include "vm/bootstrap.h" 10 #include "vm/bootstrap.h"
(...skipping 3319 matching lines...) Expand 10 before | Expand all | Expand 10 after
3330 ASSERT(CurrentToken() == Token::kPERIOD); // We checked above. 3330 ASSERT(CurrentToken() == Token::kPERIOD); // We checked above.
3331 ConsumeToken(); 3331 ConsumeToken();
3332 return prefix.raw(); 3332 return prefix.raw();
3333 } 3333 }
3334 3334
3335 3335
3336 void Parser::ParseMethodOrConstructor(ClassDesc* members, MemberDesc* method) { 3336 void Parser::ParseMethodOrConstructor(ClassDesc* members, MemberDesc* method) {
3337 TRACE_PARSER("ParseMethodOrConstructor"); 3337 TRACE_PARSER("ParseMethodOrConstructor");
3338 ASSERT(CurrentToken() == Token::kLPAREN || method->IsGetter()); 3338 ASSERT(CurrentToken() == Token::kLPAREN || method->IsGetter());
3339 ASSERT(method->type != NULL); 3339 ASSERT(method->type != NULL);
3340 ASSERT(is_top_level_ || method->name_pos > 0);
3341 ASSERT(current_member_ == method); 3340 ASSERT(current_member_ == method);
3342 3341
3343 if (method->has_var) { 3342 if (method->has_var) {
3344 ReportError(method->name_pos, "keyword var not allowed for methods"); 3343 ReportError(method->name_pos, "keyword var not allowed for methods");
3345 } 3344 }
3346 if (method->has_final) { 3345 if (method->has_final) {
3347 ReportError(method->name_pos, "'final' not allowed for methods"); 3346 ReportError(method->name_pos, "'final' not allowed for methods");
3348 } 3347 }
3349 if (method->has_abstract && method->has_static) { 3348 if (method->has_abstract && method->has_static) {
3350 ReportError(method->name_pos, 3349 ReportError(method->name_pos,
(...skipping 8851 matching lines...) Expand 10 before | Expand all | Expand 10 after
12202 void Parser::SkipQualIdent() { 12201 void Parser::SkipQualIdent() {
12203 ASSERT(IsIdentifier()); 12202 ASSERT(IsIdentifier());
12204 ConsumeToken(); 12203 ConsumeToken();
12205 if (CurrentToken() == Token::kPERIOD) { 12204 if (CurrentToken() == Token::kPERIOD) {
12206 ConsumeToken(); // Consume the kPERIOD token. 12205 ConsumeToken(); // Consume the kPERIOD token.
12207 ExpectIdentifier("identifier expected after '.'"); 12206 ExpectIdentifier("identifier expected after '.'");
12208 } 12207 }
12209 } 12208 }
12210 12209
12211 } // namespace dart 12210 } // namespace dart
OLDNEW
« 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