| 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 2427f3de0797a5b404fce5efa3eba1d1930173f7..4937efd7d4720770c3a88e88057d3c24a3c2d7b5 100644
|
| --- a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
|
| +++ b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
|
| @@ -584,7 +584,8 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
|
| return buildCompileTimeError(
|
| "Not an operator: '$operator'.", token.charOffset);
|
| } else {
|
| - Expression result = makeBinary(a, new Name(operator), null, b);
|
| + Expression result =
|
| + makeBinary(a, new Name(operator), null, b, token.charOffset);
|
| if (isSuper) {
|
| result = toSuperMethodInvocation(result);
|
| }
|
| @@ -784,7 +785,7 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
|
| }
|
|
|
| @override
|
| - void endLiteralString(int interpolationCount) {
|
| + void endLiteralString(int interpolationCount, Token endToken) {
|
| debugEvent("endLiteralString");
|
| if (interpolationCount == 0) {
|
| Token token = pop();
|
| @@ -807,7 +808,8 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
|
| }
|
| expressions
|
| .add(new StringLiteral(unescapeLastStringPart(last.value, quote)));
|
| - push(new StringConcatenation(expressions));
|
| + push(new StringConcatenation(expressions)
|
| + ..fileOffset = endToken.charOffset);
|
| }
|
| }
|
|
|
| @@ -1065,7 +1067,8 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
|
| }
|
| }
|
| push(new ListLiteral(expressions,
|
| - typeArgument: typeArgument, isConst: constKeyword != null));
|
| + typeArgument: typeArgument, isConst: constKeyword != null)
|
| + ..fileOffset = constKeyword?.charOffset ?? beginToken.charOffset);
|
| }
|
|
|
| @override
|
| @@ -1108,7 +1111,8 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
|
| }
|
| }
|
| push(new MapLiteral(entries,
|
| - keyType: keyType, valueType: valueType, isConst: constKeyword != null));
|
| + keyType: keyType, valueType: valueType, isConst: constKeyword != null)
|
| + ..fileOffset = constKeyword?.charOffset ?? beginToken.charOffset);
|
| }
|
|
|
| @override
|
| @@ -1269,7 +1273,7 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
|
| void endThrowExpression(Token throwToken, Token endToken) {
|
| debugEvent("ThrowExpression");
|
| Expression expression = popForValue();
|
| - push(new Throw(expression));
|
| + push(new Throw(expression)..fileOffset = throwToken.charOffset);
|
| }
|
|
|
| @override
|
| @@ -1318,7 +1322,8 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
|
| }
|
| }
|
| variable ??= new VariableDeclaration(name.name,
|
| - type: type ?? const DynamicType(), initializer: name.initializer);
|
| + type: type ?? const DynamicType(),
|
| + initializer: name.initializer)..fileOffset = name.fileOffset;
|
| push(variable);
|
| }
|
|
|
| @@ -1499,7 +1504,8 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
|
| debugEvent("UnaryPrefixAssignmentExpression");
|
| var accessor = pop();
|
| if (accessor is BuilderAccessor) {
|
| - push(accessor.buildPrefixIncrement(incrementOperator(token)));
|
| + push(accessor.buildPrefixIncrement(
|
| + incrementOperator(token), token.charOffset));
|
| } else {
|
| push(wrapInvalid(toValue(accessor)));
|
| }
|
| @@ -2103,7 +2109,8 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
|
| push(compileTimeErrorInLoopOrSwitch = buildCompileTimeErrorStatement(
|
| "Can't break to '$name'.", breakKeyword.next.charOffset));
|
| } else {
|
| - BreakStatement statement = new BreakStatement(null);
|
| + BreakStatement statement = new BreakStatement(null)
|
| + ..fileOffset = breakKeyword.charOffset;
|
| target.addBreak(statement);
|
| push(statement);
|
| }
|
| @@ -2148,7 +2155,8 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
|
| push(compileTimeErrorInLoopOrSwitch = buildCompileTimeErrorStatement(
|
| "Can't continue at '$name'.", continueKeyword.next.charOffset));
|
| } else {
|
| - BreakStatement statement = new BreakStatement(null);
|
| + BreakStatement statement = new BreakStatement(null)
|
| + ..fileOffset = continueKeyword.charOffset;
|
| target.addContinue(statement);
|
| push(statement);
|
| }
|
| @@ -2370,17 +2378,18 @@ abstract class ContextAccessor extends BuilderAccessor {
|
| return internalError("not supported");
|
| }
|
|
|
| - Expression buildCompoundAssignment(Name binaryOperator, Expression value,
|
| + Expression buildCompoundAssignment(
|
| + Name binaryOperator, Expression value, int charOffset,
|
| {bool voidContext: false, Procedure interfaceTarget}) {
|
| return internalError("not supported");
|
| }
|
|
|
| - Expression buildPrefixIncrement(Name binaryOperator,
|
| + Expression buildPrefixIncrement(Name binaryOperator, int charOffset,
|
| {bool voidContext: false, Procedure interfaceTarget}) {
|
| return internalError("not supported");
|
| }
|
|
|
| - Expression buildPostfixIncrement(Name binaryOperator,
|
| + Expression buildPostfixIncrement(Name binaryOperator, int charOffset,
|
| {bool voidContext: false, Procedure interfaceTarget}) {
|
| return internalError("not supported");
|
| }
|
| @@ -2411,40 +2420,40 @@ class DelayedAssignment extends ContextAccessor {
|
| if (identical("=", assignmentOperator)) {
|
| return accessor.buildAssignment(value, voidContext: voidContext);
|
| } else if (identical("+=", assignmentOperator)) {
|
| - return accessor.buildCompoundAssignment(plusName, value,
|
| + return accessor.buildCompoundAssignment(plusName, value, charOffset,
|
| voidContext: voidContext);
|
| } else if (identical("-=", assignmentOperator)) {
|
| - return accessor.buildCompoundAssignment(minusName, value,
|
| + return accessor.buildCompoundAssignment(minusName, value, charOffset,
|
| voidContext: voidContext);
|
| } else if (identical("*=", assignmentOperator)) {
|
| - return accessor.buildCompoundAssignment(multiplyName, value,
|
| + return accessor.buildCompoundAssignment(multiplyName, value, charOffset,
|
| voidContext: voidContext);
|
| } else if (identical("%=", assignmentOperator)) {
|
| - return accessor.buildCompoundAssignment(percentName, value,
|
| + return accessor.buildCompoundAssignment(percentName, value, charOffset,
|
| voidContext: voidContext);
|
| } else if (identical("&=", assignmentOperator)) {
|
| - return accessor.buildCompoundAssignment(ampersandName, value,
|
| + return accessor.buildCompoundAssignment(ampersandName, value, charOffset,
|
| voidContext: voidContext);
|
| } else if (identical("/=", assignmentOperator)) {
|
| - return accessor.buildCompoundAssignment(divisionName, value,
|
| + return accessor.buildCompoundAssignment(divisionName, value, charOffset,
|
| voidContext: voidContext);
|
| } else if (identical("<<=", assignmentOperator)) {
|
| - return accessor.buildCompoundAssignment(leftShiftName, value,
|
| + return accessor.buildCompoundAssignment(leftShiftName, value, charOffset,
|
| voidContext: voidContext);
|
| } else if (identical(">>=", assignmentOperator)) {
|
| - return accessor.buildCompoundAssignment(rightShiftName, value,
|
| + return accessor.buildCompoundAssignment(rightShiftName, value, charOffset,
|
| voidContext: voidContext);
|
| } else if (identical("??=", assignmentOperator)) {
|
| return accessor.buildNullAwareAssignment(value, const DynamicType(),
|
| voidContext: voidContext);
|
| } else if (identical("^=", assignmentOperator)) {
|
| - return accessor.buildCompoundAssignment(caretName, value,
|
| + return accessor.buildCompoundAssignment(caretName, value, charOffset,
|
| voidContext: voidContext);
|
| } else if (identical("|=", assignmentOperator)) {
|
| - return accessor.buildCompoundAssignment(barName, value,
|
| + return accessor.buildCompoundAssignment(barName, value, charOffset,
|
| voidContext: voidContext);
|
| } else if (identical("~/=", assignmentOperator)) {
|
| - return accessor.buildCompoundAssignment(mustacheName, value,
|
| + return accessor.buildCompoundAssignment(mustacheName, value, charOffset,
|
| voidContext: voidContext);
|
| } else {
|
| return internalError("Unhandled: $assignmentOperator");
|
| @@ -2478,12 +2487,12 @@ class DelayedPostfixIncrement extends ContextAccessor {
|
| : super(helper, charOffset, accessor);
|
|
|
| Expression buildSimpleRead() {
|
| - return accessor.buildPostfixIncrement(binaryOperator,
|
| + return accessor.buildPostfixIncrement(binaryOperator, charOffset,
|
| voidContext: false, interfaceTarget: interfaceTarget);
|
| }
|
|
|
| Expression buildForEffect() {
|
| - return accessor.buildPostfixIncrement(binaryOperator,
|
| + return accessor.buildPostfixIncrement(binaryOperator, charOffset,
|
| voidContext: true, interfaceTarget: interfaceTarget);
|
| }
|
| }
|
|
|