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

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

Issue 1311693003: oneee# Enter a description of the change. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/hash_table.h ('k') | 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 4271 matching lines...) Expand 10 before | Expand all | Expand 10 after
4282 // The type arguments of the result type are the type parameters of the 4282 // The type arguments of the result type are the type parameters of the
4283 // current class. Note that in the case of a patch class, they are copied 4283 // current class. Note that in the case of a patch class, they are copied
4284 // from the class being patched. 4284 // from the class being patched.
4285 member.type = &Type::ZoneHandle(Z, Type::New( 4285 member.type = &Type::ZoneHandle(Z, Type::New(
4286 result_type_class, 4286 result_type_class,
4287 TypeArguments::Handle(Z, current_class().type_parameters()), 4287 TypeArguments::Handle(Z, current_class().type_parameters()),
4288 member.name_pos)); 4288 member.name_pos));
4289 4289
4290 // We must be dealing with a constructor or named constructor. 4290 // We must be dealing with a constructor or named constructor.
4291 member.kind = RawFunction::kConstructor; 4291 member.kind = RawFunction::kConstructor;
4292 *member.name = String::Concat(*member.name, Symbols::Dot()); 4292 GrowableArray<const String*> to_concat(Z, 3);
4293 to_concat.Add(&String::ZoneHandle(Z, member.name->raw()));
4294 to_concat.Add(&Symbols::Dot());
4293 if (CurrentToken() == Token::kPERIOD) { 4295 if (CurrentToken() == Token::kPERIOD) {
4294 // Named constructor. 4296 // Named constructor.
4295 ConsumeToken(); 4297 ConsumeToken();
4296 member.dict_name = ExpectIdentifier("identifier expected"); 4298 member.dict_name = ExpectIdentifier("identifier expected");
4297 *member.name = String::Concat(*member.name, *member.dict_name); 4299 to_concat.Add(&String::ZoneHandle(Z, member.dict_name->raw()));
4298 } 4300 }
4299 // Ensure that names are symbols. 4301 *member.name = Symbols::FromConcatAll(to_concat);
4300 *member.name = Symbols::New(*member.name);
4301
4302 CheckToken(Token::kLPAREN); 4302 CheckToken(Token::kLPAREN);
4303 } else if ((CurrentToken() == Token::kGET) && !member.has_var && 4303 } else if ((CurrentToken() == Token::kGET) && !member.has_var &&
4304 (LookaheadToken(1) != Token::kLPAREN) && 4304 (LookaheadToken(1) != Token::kLPAREN) &&
4305 (LookaheadToken(1) != Token::kASSIGN) && 4305 (LookaheadToken(1) != Token::kASSIGN) &&
4306 (LookaheadToken(1) != Token::kCOMMA) && 4306 (LookaheadToken(1) != Token::kCOMMA) &&
4307 (LookaheadToken(1) != Token::kSEMICOLON)) { 4307 (LookaheadToken(1) != Token::kSEMICOLON)) {
4308 ConsumeToken(); 4308 ConsumeToken();
4309 member.kind = RawFunction::kGetterFunction; 4309 member.kind = RawFunction::kGetterFunction;
4310 member.name_pos = this->TokenPos(); 4310 member.name_pos = this->TokenPos();
4311 member.name = ExpectIdentifier("identifier expected"); 4311 member.name = ExpectIdentifier("identifier expected");
(...skipping 10006 matching lines...) Expand 10 before | Expand all | Expand 10 after
14318 void Parser::SkipQualIdent() { 14318 void Parser::SkipQualIdent() {
14319 ASSERT(IsIdentifier()); 14319 ASSERT(IsIdentifier());
14320 ConsumeToken(); 14320 ConsumeToken();
14321 if (CurrentToken() == Token::kPERIOD) { 14321 if (CurrentToken() == Token::kPERIOD) {
14322 ConsumeToken(); // Consume the kPERIOD token. 14322 ConsumeToken(); // Consume the kPERIOD token.
14323 ExpectIdentifier("identifier expected after '.'"); 14323 ExpectIdentifier("identifier expected after '.'");
14324 } 14324 }
14325 } 14325 }
14326 14326
14327 } // namespace dart 14327 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/hash_table.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698