Chromium Code Reviews| 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 | 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/bootstrap.h" | 9 #include "vm/bootstrap.h" |
| 10 #include "vm/class_finalizer.h" | 10 #include "vm/class_finalizer.h" |
| (...skipping 8552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 8563 current_class(), type, ClassFinalizer::kCanonicalize); | 8563 current_class(), type, ClassFinalizer::kCanonicalize); |
| 8564 // Type may be malbounded, but not malformed. | 8564 // Type may be malbounded, but not malformed. |
| 8565 ASSERT(!type.IsMalformed()); | 8565 ASSERT(!type.IsMalformed()); |
| 8566 selector = new TypeNode(primary_pos, type); | 8566 selector = new TypeNode(primary_pos, type); |
| 8567 } else { | 8567 } else { |
| 8568 UNREACHABLE(); // Internal parser error. | 8568 UNREACHABLE(); // Internal parser error. |
| 8569 } | 8569 } |
| 8570 } else { | 8570 } else { |
| 8571 // Left is not a primary node; this must be a closure call. | 8571 // Left is not a primary node; this must be a closure call. |
| 8572 AstNode* closure = left; | 8572 AstNode* closure = left; |
| 8573 if (parsing_metadata_) { | |
|
hausner
2014/02/27 22:50:25
It would still be good to have an explanation here
rmacnak
2014/02/27 23:23:30
Done.
| |
| 8574 ErrorMsg(closure->token_pos(), | |
| 8575 "expression is not a valid compile-time constant"); | |
| 8576 } | |
| 8573 selector = ParseClosureCall(closure); | 8577 selector = ParseClosureCall(closure); |
| 8574 } | 8578 } |
| 8575 } else { | 8579 } else { |
| 8576 // No (more) selectors to parse. | 8580 // No (more) selectors to parse. |
| 8577 left = LoadFieldIfUnresolved(left); | 8581 left = LoadFieldIfUnresolved(left); |
| 8578 if (left->IsPrimaryNode()) { | 8582 if (left->IsPrimaryNode()) { |
| 8579 PrimaryNode* primary_node = left->AsPrimaryNode(); | 8583 PrimaryNode* primary_node = left->AsPrimaryNode(); |
| 8580 const intptr_t primary_pos = primary->token_pos(); | 8584 const intptr_t primary_pos = primary->token_pos(); |
| 8581 if (primary_node->primary().IsFunction()) { | 8585 if (primary_node->primary().IsFunction()) { |
| 8582 // Treat as implicit closure. | 8586 // Treat as implicit closure. |
| (...skipping 2195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 10778 void Parser::SkipQualIdent() { | 10782 void Parser::SkipQualIdent() { |
| 10779 ASSERT(IsIdentifier()); | 10783 ASSERT(IsIdentifier()); |
| 10780 ConsumeToken(); | 10784 ConsumeToken(); |
| 10781 if (CurrentToken() == Token::kPERIOD) { | 10785 if (CurrentToken() == Token::kPERIOD) { |
| 10782 ConsumeToken(); // Consume the kPERIOD token. | 10786 ConsumeToken(); // Consume the kPERIOD token. |
| 10783 ExpectIdentifier("identifier expected after '.'"); | 10787 ExpectIdentifier("identifier expected after '.'"); |
| 10784 } | 10788 } |
| 10785 } | 10789 } |
| 10786 | 10790 |
| 10787 } // namespace dart | 10791 } // namespace dart |
| OLD | NEW |