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

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

Issue 1312833009: Added {Zone}GrowableHandlePtrArray types: simplifies code, makes code safer (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: d 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/object.cc ('k') | runtime/vm/symbols.h » ('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 "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 GrowableArray<const String*> to_concat(Z, 3); 4292 GrowableHandlePtrArray<const String> to_concat(Z, 3);
4293 to_concat.Add(&String::ZoneHandle(Z, member.name->raw())); 4293 to_concat.Add(*member.name);
4294 to_concat.Add(&Symbols::Dot()); 4294 to_concat.Add(Symbols::Dot());
4295 if (CurrentToken() == Token::kPERIOD) { 4295 if (CurrentToken() == Token::kPERIOD) {
4296 // Named constructor. 4296 // Named constructor.
4297 ConsumeToken(); 4297 ConsumeToken();
4298 member.dict_name = ExpectIdentifier("identifier expected"); 4298 member.dict_name = ExpectIdentifier("identifier expected");
4299 to_concat.Add(&String::ZoneHandle(Z, member.dict_name->raw())); 4299 to_concat.Add(*member.dict_name);
4300 } 4300 }
4301 *member.name = Symbols::FromConcatAll(to_concat); 4301 *member.name = Symbols::FromConcatAll(to_concat);
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;
(...skipping 9979 matching lines...) Expand 10 before | Expand all | Expand 10 after
14289 void Parser::SkipQualIdent() { 14289 void Parser::SkipQualIdent() {
14290 ASSERT(IsIdentifier()); 14290 ASSERT(IsIdentifier());
14291 ConsumeToken(); 14291 ConsumeToken();
14292 if (CurrentToken() == Token::kPERIOD) { 14292 if (CurrentToken() == Token::kPERIOD) {
14293 ConsumeToken(); // Consume the kPERIOD token. 14293 ConsumeToken(); // Consume the kPERIOD token.
14294 ExpectIdentifier("identifier expected after '.'"); 14294 ExpectIdentifier("identifier expected after '.'");
14295 } 14295 }
14296 } 14296 }
14297 14297
14298 } // namespace dart 14298 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/symbols.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698