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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index f22a2c8fac4f1d8b5a0fbf9464119bbccd7ba739..28777b271e0e835818d86f2bf029a6b8c9c47c75 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -11693,6 +11693,7 @@ AstNode* Parser::ParsePostfixExpr() {
ReportError(expr_pos, "expression is not assignable");
}
Token::Kind incr_op = CurrentToken();
+ const intptr_t op_pos = TokenPos();
ConsumeToken();
// Not prefix.
LetNode* let_expr = PrepareCompoundAssignmentNodes(&expr);
@@ -11700,17 +11701,17 @@ AstNode* Parser::ParsePostfixExpr() {
Token::Kind binary_op =
(incr_op == Token::kINCR) ? Token::kADD : Token::kSUB;
BinaryOpNode* add = new(Z) BinaryOpNode(
- expr_pos,
+ op_pos,
binary_op,
- new(Z) LoadLocalNode(expr_pos, temp),
- new(Z) LiteralNode(expr_pos, Smi::ZoneHandle(Z, Smi::New(1))));
+ new(Z) LoadLocalNode(op_pos, temp),
+ new(Z) LiteralNode(op_pos, Smi::ZoneHandle(Z, Smi::New(1))));
AstNode* store =
CreateAssignmentNode(expr, add, expr_ident, expr_pos, true);
ASSERT(store != NULL);
// The result is a pair of the (side effects of the) store followed by
// the (value of the) initial value temp variable load.
let_expr->AddNode(store);
- let_expr->AddNode(new(Z) LoadLocalNode(expr_pos, temp));
+ let_expr->AddNode(new(Z) LoadLocalNode(op_pos, temp));
return let_expr;
}
return expr;
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698