Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(272)

Side by Side Diff: runtime/vm/parser.cc

Issue 1027383004: Evaluate expression before NSM (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/language/regress_22936_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 10309 matching lines...) Expand 10 before | Expand all | Expand 10 after
10320 target_cls = &Class::Handle(Z, 10320 target_cls = &Class::Handle(Z,
10321 original->AsLoadStaticFieldNode()->field().owner()); 10321 original->AsLoadStaticFieldNode()->field().owner());
10322 } else if ((left_ident != NULL) && 10322 } else if ((left_ident != NULL) &&
10323 (original->IsLiteralNode() || 10323 (original->IsLiteralNode() ||
10324 original->IsLoadLocalNode())) { 10324 original->IsLoadLocalNode())) {
10325 name = left_ident->raw(); 10325 name = left_ident->raw();
10326 } 10326 }
10327 if (name.IsNull()) { 10327 if (name.IsNull()) {
10328 ReportError(left_pos, "expression is not assignable"); 10328 ReportError(left_pos, "expression is not assignable");
10329 } 10329 }
10330 result = ThrowNoSuchMethodError( 10330 LetNode* let_node = new(Z) LetNode(left_pos);
10331 original->token_pos(), 10331 let_node->AddInitializer(rhs);
10332 *target_cls, 10332 let_node->AddNode(ThrowNoSuchMethodError(
10333 String::Handle(Z, Field::SetterName(name)), 10333 original->token_pos(),
10334 NULL, // No arguments. 10334 *target_cls,
10335 InvocationMirror::kStatic, 10335 String::Handle(Z, Field::SetterName(name)),
10336 original->IsLoadLocalNode() ? 10336 NULL, // No arguments.
10337 InvocationMirror::kLocalVar : InvocationMirror::kSetter, 10337 InvocationMirror::kStatic,
10338 NULL); // No existing function. 10338 original->IsLoadLocalNode() ?
10339 InvocationMirror::kLocalVar : InvocationMirror::kSetter,
10340 NULL)); // No existing function.
10341 result = let_node;
10339 } else if (result->IsStoreIndexedNode() || 10342 } else if (result->IsStoreIndexedNode() ||
10340 result->IsInstanceSetterNode() || 10343 result->IsInstanceSetterNode() ||
10341 result->IsStaticSetterNode() || 10344 result->IsStaticSetterNode() ||
10342 result->IsStoreStaticFieldNode() || 10345 result->IsStoreStaticFieldNode() ||
10343 result->IsStoreLocalNode()) { 10346 result->IsStoreLocalNode()) {
10344 // Ensure that the expression temp is allocated for nodes that may need it. 10347 // Ensure that the expression temp is allocated for nodes that may need it.
10345 EnsureExpressionTemp(); 10348 EnsureExpressionTemp();
10346 } 10349 }
10347 return result; 10350 return result;
10348 } 10351 }
(...skipping 3047 matching lines...) Expand 10 before | Expand all | Expand 10 after
13396 void Parser::SkipQualIdent() { 13399 void Parser::SkipQualIdent() {
13397 ASSERT(IsIdentifier()); 13400 ASSERT(IsIdentifier());
13398 ConsumeToken(); 13401 ConsumeToken();
13399 if (CurrentToken() == Token::kPERIOD) { 13402 if (CurrentToken() == Token::kPERIOD) {
13400 ConsumeToken(); // Consume the kPERIOD token. 13403 ConsumeToken(); // Consume the kPERIOD token.
13401 ExpectIdentifier("identifier expected after '.'"); 13404 ExpectIdentifier("identifier expected after '.'");
13402 } 13405 }
13403 } 13406 }
13404 13407
13405 } // namespace dart 13408 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | tests/language/regress_22936_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698