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 9153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9164 } | 9164 } |
9165 return true; | 9165 return true; |
9166 } else if (func.IsStaticFunction()) { | 9166 } else if (func.IsStaticFunction()) { |
9167 if (node != NULL) { | 9167 if (node != NULL) { |
9168 ASSERT(AbstractType::Handle(func.result_type()).IsResolved()); | 9168 ASSERT(AbstractType::Handle(func.result_type()).IsResolved()); |
9169 // The static getter may later be changed into a dynamically | 9169 // The static getter may later be changed into a dynamically |
9170 // resolved instance setter if no static setter can | 9170 // resolved instance setter if no static setter can |
9171 // be found. | 9171 // be found. |
9172 AstNode* receiver = NULL; | 9172 AstNode* receiver = NULL; |
9173 const bool kTestOnly = true; | 9173 const bool kTestOnly = true; |
| 9174 if (parsing_metadata_) { |
| 9175 ErrorMsg(ident_pos, |
| 9176 "'%s' is not a compile-time constant", |
| 9177 ident.ToCString()); |
| 9178 } |
9174 if (!current_function().is_static() && | 9179 if (!current_function().is_static() && |
9175 (LookupReceiver(current_block_->scope, kTestOnly) != NULL)) { | 9180 (LookupReceiver(current_block_->scope, kTestOnly) != NULL)) { |
9176 receiver = LoadReceiver(ident_pos); | 9181 receiver = LoadReceiver(ident_pos); |
9177 } | 9182 } |
9178 *node = new StaticGetterNode(ident_pos, | 9183 *node = new StaticGetterNode(ident_pos, |
9179 receiver, | 9184 receiver, |
9180 false, | 9185 false, |
9181 Class::ZoneHandle(isolate(), cls.raw()), | 9186 Class::ZoneHandle(isolate(), cls.raw()), |
9182 ident); | 9187 ident); |
9183 } | 9188 } |
(...skipping 1765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10949 void Parser::SkipQualIdent() { | 10954 void Parser::SkipQualIdent() { |
10950 ASSERT(IsIdentifier()); | 10955 ASSERT(IsIdentifier()); |
10951 ConsumeToken(); | 10956 ConsumeToken(); |
10952 if (CurrentToken() == Token::kPERIOD) { | 10957 if (CurrentToken() == Token::kPERIOD) { |
10953 ConsumeToken(); // Consume the kPERIOD token. | 10958 ConsumeToken(); // Consume the kPERIOD token. |
10954 ExpectIdentifier("identifier expected after '.'"); | 10959 ExpectIdentifier("identifier expected after '.'"); |
10955 } | 10960 } |
10956 } | 10961 } |
10957 | 10962 |
10958 } // namespace dart | 10963 } // namespace dart |
OLD | NEW |