| 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/ast_transformer.h" | 9 #include "vm/ast_transformer.h" |
| 10 #include "vm/bootstrap.h" | 10 #include "vm/bootstrap.h" |
| (...skipping 11028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11039 } | 11039 } |
| 11040 selector = ParseInstanceCall(LoadReceiver(primary_pos), | 11040 selector = ParseInstanceCall(LoadReceiver(primary_pos), |
| 11041 func_name, | 11041 func_name, |
| 11042 primary_pos); | 11042 primary_pos); |
| 11043 } | 11043 } |
| 11044 } else if (primary_node->primary().IsString()) { | 11044 } else if (primary_node->primary().IsString()) { |
| 11045 // Primary is an unresolved name. | 11045 // Primary is an unresolved name. |
| 11046 if (primary_node->IsSuper()) { | 11046 if (primary_node->IsSuper()) { |
| 11047 ReportError(primary_pos, "illegal use of super"); | 11047 ReportError(primary_pos, "illegal use of super"); |
| 11048 } | 11048 } |
| 11049 String& name = String::CheckedZoneHandle( | 11049 String& name = |
| 11050 primary_node->primary().raw()); | 11050 String::CheckedZoneHandle(primary_node->primary().raw()); |
| 11051 if (current_function().is_static()) { | 11051 if (current_function().is_static()) { |
| 11052 selector = ThrowNoSuchMethodError(primary_pos, | 11052 // The static call will be converted to throwing a NSM error. |
| 11053 current_class(), | 11053 selector = ParseStaticCall(current_class(), name, primary_pos); |
| 11054 name, | |
| 11055 NULL, // No arguments. | |
| 11056 InvocationMirror::kStatic, | |
| 11057 InvocationMirror::kMethod, | |
| 11058 NULL); // No existing function. | |
| 11059 } else { | 11054 } else { |
| 11060 // Treat as call to unresolved (instance) method. | 11055 // Treat as call to unresolved (instance) method. |
| 11061 selector = ParseInstanceCall(LoadReceiver(primary_pos), | 11056 selector = ParseInstanceCall(LoadReceiver(primary_pos), |
| 11062 name, | 11057 name, |
| 11063 primary_pos); | 11058 primary_pos); |
| 11064 } | 11059 } |
| 11065 } else if (primary_node->primary().IsTypeParameter()) { | 11060 } else if (primary_node->primary().IsTypeParameter()) { |
| 11066 const String& name = String::ZoneHandle(Z, | 11061 const String& name = String::ZoneHandle(Z, |
| 11067 TypeParameter::Cast(primary_node->primary()).name()); | 11062 TypeParameter::Cast(primary_node->primary()).name()); |
| 11068 if (ParsingStaticMember()) { | 11063 if (ParsingStaticMember()) { |
| (...skipping 2349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13418 void Parser::SkipQualIdent() { | 13413 void Parser::SkipQualIdent() { |
| 13419 ASSERT(IsIdentifier()); | 13414 ASSERT(IsIdentifier()); |
| 13420 ConsumeToken(); | 13415 ConsumeToken(); |
| 13421 if (CurrentToken() == Token::kPERIOD) { | 13416 if (CurrentToken() == Token::kPERIOD) { |
| 13422 ConsumeToken(); // Consume the kPERIOD token. | 13417 ConsumeToken(); // Consume the kPERIOD token. |
| 13423 ExpectIdentifier("identifier expected after '.'"); | 13418 ExpectIdentifier("identifier expected after '.'"); |
| 13424 } | 13419 } |
| 13425 } | 13420 } |
| 13426 | 13421 |
| 13427 } // namespace dart | 13422 } // namespace dart |
| OLD | NEW |