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

Unified Diff: pkg/front_end/lib/src/fasta/kernel/body_builder.dart

Issue 2999633002: [kernel] Offsets on loops (Closed)
Patch Set: Fix long line Created 3 years, 4 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 | « no previous file | pkg/kernel/binary.md » ('j') | pkg/kernel/lib/ast.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/fasta/kernel/body_builder.dart
diff --git a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
index 020c80b5986d0d4f026ed9d2f6891393c835ec68..3edce3b3c1eb299814a4922a2488100a1c1edc0c 100644
--- a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
@@ -1508,7 +1508,8 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
continueTarget.resolveContinues(body);
}
Statement result =
- new KernelForStatement(variables, condition, updates, body);
+ new KernelForStatement(variables, condition, updates, body)
+ ..fileOffset = forKeyword.charOffset;
if (begin != null) {
result = new KernelBlock(<Statement>[begin, result]);
}
@@ -2556,7 +2557,8 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
body = new KernelLabeledStatement(body);
continueTarget.resolveContinues(body);
}
- Statement result = new KernelDoStatement(body, condition);
+ Statement result = new KernelDoStatement(body, condition)
+ ..fileOffset = doKeyword.charOffset;
if (breakTarget.hasUsers) {
result = new KernelLabeledStatement(result);
breakTarget.resolveBreaks(result);
@@ -2624,7 +2626,8 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
Statement result = new KernelForInStatement(
variable, expression, body, declaresVariable,
isAsync: awaitToken != null)
- ..fileOffset = body.fileOffset;
+ ..fileOffset = forToken.charOffset
+ ..bodyOffset = body.fileOffset;
if (breakTarget.hasUsers) {
result = new KernelLabeledStatement(result);
breakTarget.resolveBreaks(result);
@@ -2703,7 +2706,8 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
body = new KernelLabeledStatement(body);
continueTarget.resolveContinues(body);
}
- Statement result = new KernelWhileStatement(condition, body);
+ Statement result = new KernelWhileStatement(condition, body)
+ ..fileOffset = whileKeyword.charOffset;
if (breakTarget.hasUsers) {
result = new KernelLabeledStatement(result);
breakTarget.resolveBreaks(result);
« no previous file with comments | « no previous file | pkg/kernel/binary.md » ('j') | pkg/kernel/lib/ast.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698