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

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

Issue 2750013002: [kernel] Debugging of switch statement (Closed)
Patch Set: Addressed comments Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/kernel/kernel_visitor.dart ('k') | pkg/kernel/binary.md » ('j') | no next file with comments »
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 9718a21d5385dabe094ed0055463990df120fae8..018360e822a435e904507164539a9ae71a650c15 100644
--- a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
@@ -811,7 +811,8 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
debugEvent("endLiteralString");
if (interpolationCount == 0) {
Token token = pop();
- push(new StringLiteral(unescapeString(token.lexeme)));
+ push(new StringLiteral(unescapeString(token.lexeme))
+ ..fileOffset = token.charOffset);
} else {
List parts = popList(1 + interpolationCount * 2);
Token first = parts.first;
@@ -873,7 +874,8 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
@override
void handleLiteralInt(Token token) {
debugEvent("LiteralInt");
- push(new IntLiteral(int.parse(token.lexeme)));
+ push(
+ new IntLiteral(int.parse(token.lexeme))..fileOffset = token.charOffset);
}
@override
@@ -1113,19 +1115,19 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
debugEvent("LiteralBool");
bool value = optional("true", token);
assert(value || optional("false", token));
- push(new BoolLiteral(value));
+ push(new BoolLiteral(value)..fileOffset = token.charOffset);
}
@override
void handleLiteralDouble(Token token) {
debugEvent("LiteralDouble");
- push(new DoubleLiteral(double.parse(token.lexeme)));
+ push(new DoubleLiteral(double.parse(token.lexeme))..fileOffset = token.charOffset);
}
@override
void handleLiteralNull(Token token) {
debugEvent("LiteralNull");
- push(new NullLiteral());
+ push(new NullLiteral()..fileOffset = token.charOffset);
}
@override
@@ -2080,8 +2082,12 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
exitLocalScope();
List<Label> labels = pop();
List<Expression> expressions = pop();
- push(new SwitchCase(expressions, block, isDefault: defaultKeyword != null)
- ..fileOffset = firstToken.charOffset);
+ List<int> expressionOffsets = <int>[];
+ for (Expression expression in expressions) {
+ expressionOffsets.add(expression.fileOffset);
+ }
+ push(new SwitchCase(expressions, expressionOffsets, block,
+ isDefault: defaultKeyword != null)..fileOffset = firstToken.charOffset);
push(labels);
}
« no previous file with comments | « pkg/compiler/lib/src/kernel/kernel_visitor.dart ('k') | pkg/kernel/binary.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698