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 "vm/bigint_operations.h" | 8 #include "vm/bigint_operations.h" |
| 9 #include "vm/bootstrap.h" | 9 #include "vm/bootstrap.h" |
| 10 #include "vm/class_finalizer.h" | 10 #include "vm/class_finalizer.h" |
| (...skipping 7534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7545 | 7545 |
| 7546 | 7546 |
| 7547 AstNode* Parser::CreateAssignmentNode(AstNode* original, | 7547 AstNode* Parser::CreateAssignmentNode(AstNode* original, |
| 7548 AstNode* rhs, | 7548 AstNode* rhs, |
| 7549 const String* left_ident, | 7549 const String* left_ident, |
| 7550 intptr_t left_pos) { | 7550 intptr_t left_pos) { |
| 7551 AstNode* result = original->MakeAssignmentNode(rhs); | 7551 AstNode* result = original->MakeAssignmentNode(rhs); |
| 7552 if (result == NULL) { | 7552 if (result == NULL) { |
| 7553 String& name = String::ZoneHandle(); | 7553 String& name = String::ZoneHandle(); |
| 7554 if (original->IsTypeNode()) { | 7554 if (original->IsTypeNode()) { |
| 7555 name = Symbols::New(original->Name()); | 7555 name = Symbols::New(original->AsTypeNode()->TypeName()); |
| 7556 } else if ((left_ident != NULL) && | 7556 } else if ((left_ident != NULL) && |
| 7557 (original->IsLiteralNode() || | 7557 (original->IsLiteralNode() || |
| 7558 original->IsLoadLocalNode() || | 7558 original->IsLoadLocalNode() || |
| 7559 original->IsLoadStaticFieldNode())) { | 7559 original->IsLoadStaticFieldNode())) { |
| 7560 name = left_ident->raw(); | 7560 name = left_ident->raw(); |
| 7561 } | 7561 } |
| 7562 if (name.IsNull()) { | 7562 if (name.IsNull()) { |
| 7563 ErrorMsg(left_pos, "expression is not assignable"); | 7563 ErrorMsg(left_pos, "expression is not assignable"); |
| 7564 } | 7564 } |
| 7565 result = ThrowNoSuchMethodError(original->token_pos(), | 7565 result = ThrowNoSuchMethodError(original->token_pos(), |
| (...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 8219 name, | 8219 name, |
| 8220 NULL, // No arguments. | 8220 NULL, // No arguments. |
| 8221 InvocationMirror::kStatic, | 8221 InvocationMirror::kStatic, |
| 8222 InvocationMirror::kMethod); | 8222 InvocationMirror::kMethod); |
| 8223 } else { | 8223 } else { |
| 8224 // Treat as call to unresolved (instance) method. | 8224 // Treat as call to unresolved (instance) method. |
| 8225 AstNode* receiver = LoadReceiver(primary->token_pos()); | 8225 AstNode* receiver = LoadReceiver(primary->token_pos()); |
| 8226 selector = ParseInstanceCall(receiver, name); | 8226 selector = ParseInstanceCall(receiver, name); |
| 8227 } | 8227 } |
| 8228 } else if (primary->primary().IsTypeParameter()) { | 8228 } else if (primary->primary().IsTypeParameter()) { |
| 8229 const String& name = String::ZoneHandle( | 8229 const String& name = String::ZoneHandle(Symbols::New("primary")); |
|
Kevin Millikin (Google)
2013/09/05 13:53:46
I know this seems wrong (and not useful), but it m
regis
2013/09/05 19:42:12
This is not dead code. You can trigger this code w
Kevin Millikin (Google)
2013/09/06 12:18:46
Thanks for the clarification. I filed issue 13134
| |
| 8230 Symbols::New(primary->Name())); | |
| 8231 selector = ThrowNoSuchMethodError(primary->token_pos(), | 8230 selector = ThrowNoSuchMethodError(primary->token_pos(), |
| 8232 current_class(), | 8231 current_class(), |
| 8233 name, | 8232 name, |
| 8234 NULL, // No arguments. | 8233 NULL, // No arguments. |
| 8235 InvocationMirror::kStatic, | 8234 InvocationMirror::kStatic, |
| 8236 InvocationMirror::kMethod); | 8235 InvocationMirror::kMethod); |
| 8237 } else if (primary->primary().IsClass()) { | 8236 } else if (primary->primary().IsClass()) { |
| 8238 const Class& type_class = Class::Cast(primary->primary()); | 8237 const Class& type_class = Class::Cast(primary->primary()); |
| 8239 Type& type = Type::ZoneHandle( | 8238 Type& type = Type::ZoneHandle( |
| 8240 Type::New(type_class, TypeArguments::Handle(), | 8239 Type::New(type_class, TypeArguments::Handle(), |
| (...skipping 2262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 10503 void Parser::SkipQualIdent() { | 10502 void Parser::SkipQualIdent() { |
| 10504 ASSERT(IsIdentifier()); | 10503 ASSERT(IsIdentifier()); |
| 10505 ConsumeToken(); | 10504 ConsumeToken(); |
| 10506 if (CurrentToken() == Token::kPERIOD) { | 10505 if (CurrentToken() == Token::kPERIOD) { |
| 10507 ConsumeToken(); // Consume the kPERIOD token. | 10506 ConsumeToken(); // Consume the kPERIOD token. |
| 10508 ExpectIdentifier("identifier expected after '.'"); | 10507 ExpectIdentifier("identifier expected after '.'"); |
| 10509 } | 10508 } |
| 10510 } | 10509 } |
| 10511 | 10510 |
| 10512 } // namespace dart | 10511 } // namespace dart |
| OLD | NEW |