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

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

Issue 2907423003: Allow 'void' as a type argument (fixes #28945). (Closed)
Patch Set: work in progress Created 3 years, 6 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') | 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 #include "vm/flags.h" 6 #include "vm/flags.h"
7 7
8 #ifndef DART_PRECOMPILED_RUNTIME 8 #ifndef DART_PRECOMPILED_RUNTIME
9 9
10 #include "lib/invocation_mirror.h" 10 #include "lib/invocation_mirror.h"
(...skipping 5512 matching lines...) Expand 10 before | Expand all | Expand 10 after
5523 } 5523 }
5524 } 5524 }
5525 return metadata_pos; 5525 return metadata_pos;
5526 } 5526 }
5527 5527
5528 5528
5529 void Parser::SkipTypeArguments() { 5529 void Parser::SkipTypeArguments() {
5530 if (CurrentToken() == Token::kLT) { 5530 if (CurrentToken() == Token::kLT) {
5531 do { 5531 do {
5532 ConsumeToken(); 5532 ConsumeToken();
5533 SkipTypeOrFunctionType(false); 5533 SkipTypeOrFunctionType(true);
5534 } while (CurrentToken() == Token::kCOMMA); 5534 } while (CurrentToken() == Token::kCOMMA);
5535 Token::Kind token = CurrentToken(); 5535 Token::Kind token = CurrentToken();
5536 if ((token == Token::kGT) || (token == Token::kSHR)) { 5536 if ((token == Token::kGT) || (token == Token::kSHR)) {
5537 ConsumeRightAngleBracket(); 5537 ConsumeRightAngleBracket();
5538 } else { 5538 } else {
5539 ReportError("right angle bracket expected"); 5539 ReportError("right angle bracket expected");
5540 } 5540 }
5541 } 5541 }
5542 } 5542 }
5543 5543
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
5678 5678
5679 5679
5680 RawTypeArguments* Parser::ParseTypeArguments( 5680 RawTypeArguments* Parser::ParseTypeArguments(
5681 ClassFinalizer::FinalizationKind finalization) { 5681 ClassFinalizer::FinalizationKind finalization) {
5682 TRACE_PARSER("ParseTypeArguments"); 5682 TRACE_PARSER("ParseTypeArguments");
5683 if (CurrentToken() == Token::kLT) { 5683 if (CurrentToken() == Token::kLT) {
5684 GrowableArray<AbstractType*> types; 5684 GrowableArray<AbstractType*> types;
5685 AbstractType& type = AbstractType::Handle(Z); 5685 AbstractType& type = AbstractType::Handle(Z);
5686 do { 5686 do {
5687 ConsumeToken(); 5687 ConsumeToken();
5688 type = ParseTypeOrFunctionType(false, finalization); 5688 type = ParseTypeOrFunctionType(true, finalization);
5689 // Map a malformed type argument to dynamic. 5689 // Map a malformed type argument to dynamic.
5690 if (type.IsMalformed()) { 5690 if (type.IsMalformed()) {
5691 type = Type::DynamicType(); 5691 type = Type::DynamicType();
5692 } 5692 }
5693 types.Add(&AbstractType::ZoneHandle(Z, type.raw())); 5693 types.Add(&AbstractType::ZoneHandle(Z, type.raw()));
5694 } while (CurrentToken() == Token::kCOMMA); 5694 } while (CurrentToken() == Token::kCOMMA);
5695 Token::Kind token = CurrentToken(); 5695 Token::Kind token = CurrentToken();
5696 if ((token == Token::kGT) || (token == Token::kSHR)) { 5696 if ((token == Token::kGT) || (token == Token::kSHR)) {
5697 ConsumeRightAngleBracket(); 5697 ConsumeRightAngleBracket();
5698 } else { 5698 } else {
(...skipping 9615 matching lines...) Expand 10 before | Expand all | Expand 10 after
15314 TokenPosition* start, 15314 TokenPosition* start,
15315 TokenPosition* end) { 15315 TokenPosition* end) {
15316 UNREACHABLE(); 15316 UNREACHABLE();
15317 return false; 15317 return false;
15318 } 15318 }
15319 15319
15320 15320
15321 } // namespace dart 15321 } // namespace dart
15322 15322
15323 #endif // DART_PRECOMPILED_RUNTIME 15323 #endif // DART_PRECOMPILED_RUNTIME
OLDNEW
« no previous file with comments | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698