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