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

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

Issue 1576583003: More source position improvements and tests (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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
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 #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 11861 matching lines...) Expand 10 before | Expand all | Expand 10 after
11872 expr = ParseClosurization(expr); 11872 expr = ParseClosurization(expr);
11873 } else { 11873 } else {
11874 expr = ParseSelectors(expr, false); 11874 expr = ParseSelectors(expr, false);
11875 } 11875 }
11876 if (IsIncrementOperator(CurrentToken())) { 11876 if (IsIncrementOperator(CurrentToken())) {
11877 TRACE_PARSER("IncrementOperator"); 11877 TRACE_PARSER("IncrementOperator");
11878 if (!IsLegalAssignableSyntax(expr, TokenPos())) { 11878 if (!IsLegalAssignableSyntax(expr, TokenPos())) {
11879 ReportError(expr_pos, "expression is not assignable"); 11879 ReportError(expr_pos, "expression is not assignable");
11880 } 11880 }
11881 Token::Kind incr_op = CurrentToken(); 11881 Token::Kind incr_op = CurrentToken();
11882 const intptr_t op_pos = TokenPos();
11882 ConsumeToken(); 11883 ConsumeToken();
11883 // Not prefix. 11884 // Not prefix.
11884 LetNode* let_expr = PrepareCompoundAssignmentNodes(&expr); 11885 LetNode* let_expr = PrepareCompoundAssignmentNodes(&expr);
11885 LocalVariable* temp = let_expr->AddInitializer(expr); 11886 LocalVariable* temp = let_expr->AddInitializer(expr);
11886 Token::Kind binary_op = 11887 Token::Kind binary_op =
11887 (incr_op == Token::kINCR) ? Token::kADD : Token::kSUB; 11888 (incr_op == Token::kINCR) ? Token::kADD : Token::kSUB;
11888 BinaryOpNode* add = new(Z) BinaryOpNode( 11889 BinaryOpNode* add = new(Z) BinaryOpNode(
11889 expr_pos, 11890 op_pos,
11890 binary_op, 11891 binary_op,
11891 new(Z) LoadLocalNode(expr_pos, temp), 11892 new(Z) LoadLocalNode(op_pos, temp),
11892 new(Z) LiteralNode(expr_pos, Smi::ZoneHandle(Z, Smi::New(1)))); 11893 new(Z) LiteralNode(op_pos, Smi::ZoneHandle(Z, Smi::New(1))));
11893 AstNode* store = 11894 AstNode* store =
11894 CreateAssignmentNode(expr, add, expr_ident, expr_pos, true); 11895 CreateAssignmentNode(expr, add, expr_ident, expr_pos, true);
11895 ASSERT(store != NULL); 11896 ASSERT(store != NULL);
11896 // The result is a pair of the (side effects of the) store followed by 11897 // The result is a pair of the (side effects of the) store followed by
11897 // the (value of the) initial value temp variable load. 11898 // the (value of the) initial value temp variable load.
11898 let_expr->AddNode(store); 11899 let_expr->AddNode(store);
11899 let_expr->AddNode(new(Z) LoadLocalNode(expr_pos, temp)); 11900 let_expr->AddNode(new(Z) LoadLocalNode(op_pos, temp));
11900 return let_expr; 11901 return let_expr;
11901 } 11902 }
11902 return expr; 11903 return expr;
11903 } 11904 }
11904 11905
11905 11906
11906 // Resolve the given type and its type arguments from the given scope class 11907 // Resolve the given type and its type arguments from the given scope class
11907 // according to the given type finalization mode. 11908 // according to the given type finalization mode.
11908 // If the given scope class is null, use the current library, but do not try to 11909 // If the given scope class is null, use the current library, but do not try to
11909 // resolve type parameters. 11910 // resolve type parameters.
(...skipping 2667 matching lines...) Expand 10 before | Expand all | Expand 10 after
14577 const ArgumentListNode& function_args, 14578 const ArgumentListNode& function_args,
14578 const LocalVariable* temp_for_last_arg, 14579 const LocalVariable* temp_for_last_arg,
14579 bool is_super_invocation) { 14580 bool is_super_invocation) {
14580 UNREACHABLE(); 14581 UNREACHABLE();
14581 return NULL; 14582 return NULL;
14582 } 14583 }
14583 14584
14584 } // namespace dart 14585 } // namespace dart
14585 14586
14586 #endif // DART_PRECOMPILED 14587 #endif // DART_PRECOMPILED
OLDNEW
« runtime/vm/flow_graph_builder_test.cc ('K') | « runtime/vm/intermediate_language.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698