OLD | NEW |
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 Loading... |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |