| 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 #include "vm/flags.h" | 6 #include "vm/flags.h" |
| 7 | 7 |
| 8 #ifndef DART_PRECOMPILED | 8 #ifndef DART_PRECOMPILED |
| 9 | 9 |
| 10 #include "lib/invocation_mirror.h" | 10 #include "lib/invocation_mirror.h" |
| (...skipping 11675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11686 expr = ParseClosurization(expr); | 11686 expr = ParseClosurization(expr); |
| 11687 } else { | 11687 } else { |
| 11688 expr = ParseSelectors(expr, false); | 11688 expr = ParseSelectors(expr, false); |
| 11689 } | 11689 } |
| 11690 if (IsIncrementOperator(CurrentToken())) { | 11690 if (IsIncrementOperator(CurrentToken())) { |
| 11691 TRACE_PARSER("IncrementOperator"); | 11691 TRACE_PARSER("IncrementOperator"); |
| 11692 if (!IsLegalAssignableSyntax(expr, TokenPos())) { | 11692 if (!IsLegalAssignableSyntax(expr, TokenPos())) { |
| 11693 ReportError(expr_pos, "expression is not assignable"); | 11693 ReportError(expr_pos, "expression is not assignable"); |
| 11694 } | 11694 } |
| 11695 Token::Kind incr_op = CurrentToken(); | 11695 Token::Kind incr_op = CurrentToken(); |
| 11696 const intptr_t op_pos = TokenPos(); |
| 11696 ConsumeToken(); | 11697 ConsumeToken(); |
| 11697 // Not prefix. | 11698 // Not prefix. |
| 11698 LetNode* let_expr = PrepareCompoundAssignmentNodes(&expr); | 11699 LetNode* let_expr = PrepareCompoundAssignmentNodes(&expr); |
| 11699 LocalVariable* temp = let_expr->AddInitializer(expr); | 11700 LocalVariable* temp = let_expr->AddInitializer(expr); |
| 11700 Token::Kind binary_op = | 11701 Token::Kind binary_op = |
| 11701 (incr_op == Token::kINCR) ? Token::kADD : Token::kSUB; | 11702 (incr_op == Token::kINCR) ? Token::kADD : Token::kSUB; |
| 11702 BinaryOpNode* add = new(Z) BinaryOpNode( | 11703 BinaryOpNode* add = new(Z) BinaryOpNode( |
| 11703 expr_pos, | 11704 op_pos, |
| 11704 binary_op, | 11705 binary_op, |
| 11705 new(Z) LoadLocalNode(expr_pos, temp), | 11706 new(Z) LoadLocalNode(op_pos, temp), |
| 11706 new(Z) LiteralNode(expr_pos, Smi::ZoneHandle(Z, Smi::New(1)))); | 11707 new(Z) LiteralNode(op_pos, Smi::ZoneHandle(Z, Smi::New(1)))); |
| 11707 AstNode* store = | 11708 AstNode* store = |
| 11708 CreateAssignmentNode(expr, add, expr_ident, expr_pos, true); | 11709 CreateAssignmentNode(expr, add, expr_ident, expr_pos, true); |
| 11709 ASSERT(store != NULL); | 11710 ASSERT(store != NULL); |
| 11710 // The result is a pair of the (side effects of the) store followed by | 11711 // The result is a pair of the (side effects of the) store followed by |
| 11711 // the (value of the) initial value temp variable load. | 11712 // the (value of the) initial value temp variable load. |
| 11712 let_expr->AddNode(store); | 11713 let_expr->AddNode(store); |
| 11713 let_expr->AddNode(new(Z) LoadLocalNode(expr_pos, temp)); | 11714 let_expr->AddNode(new(Z) LoadLocalNode(op_pos, temp)); |
| 11714 return let_expr; | 11715 return let_expr; |
| 11715 } | 11716 } |
| 11716 return expr; | 11717 return expr; |
| 11717 } | 11718 } |
| 11718 | 11719 |
| 11719 | 11720 |
| 11720 // Resolve the given type and its type arguments from the given scope class | 11721 // Resolve the given type and its type arguments from the given scope class |
| 11721 // according to the given type finalization mode. | 11722 // according to the given type finalization mode. |
| 11722 // If the given scope class is null, use the current library, but do not try to | 11723 // If the given scope class is null, use the current library, but do not try to |
| 11723 // resolve type parameters. | 11724 // resolve type parameters. |
| (...skipping 2661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14385 const ArgumentListNode& function_args, | 14386 const ArgumentListNode& function_args, |
| 14386 const LocalVariable* temp_for_last_arg, | 14387 const LocalVariable* temp_for_last_arg, |
| 14387 bool is_super_invocation) { | 14388 bool is_super_invocation) { |
| 14388 UNREACHABLE(); | 14389 UNREACHABLE(); |
| 14389 return NULL; | 14390 return NULL; |
| 14390 } | 14391 } |
| 14391 | 14392 |
| 14392 } // namespace dart | 14393 } // namespace dart |
| 14393 | 14394 |
| 14394 #endif // DART_PRECOMPILED | 14395 #endif // DART_PRECOMPILED |
| OLD | NEW |