Index: pkg/front_end/lib/src/fasta/kernel/fasta_accessors.dart |
diff --git a/pkg/front_end/lib/src/fasta/kernel/fasta_accessors.dart b/pkg/front_end/lib/src/fasta/kernel/fasta_accessors.dart |
index 90151e15b3b193c45ea305d7d0cfb90d80750fec..98a30e47396b1bb3ac7aad6c3dc6a47b9d227acb 100644 |
--- a/pkg/front_end/lib/src/fasta/kernel/fasta_accessors.dart |
+++ b/pkg/front_end/lib/src/fasta/kernel/fasta_accessors.dart |
@@ -20,6 +20,7 @@ import 'package:kernel/frontend/accessors.dart' as kernel |
IndexAccessor, |
NullAwarePropertyAccessor, |
PropertyAccessor, |
+ ReadOnlyAccessor, |
StaticAccessor, |
SuperIndexAccessor, |
SuperPropertyAccessor, |
@@ -775,6 +776,32 @@ class VariableAccessor extends kernel.VariableAccessor with FastaAccessor { |
toString() => "VariableAccessor()"; |
} |
+class ReadOnlyAccessor extends kernel.ReadOnlyAccessor with FastaAccessor { |
+ final BuilderHelper helper; |
+ |
+ final String plainNameForRead; |
+ |
+ ReadOnlyAccessor( |
+ this.helper, Expression expression, this.plainNameForRead, int offset) |
+ : super(expression, offset); |
+ |
+ Expression doInvocation(int offset, Arguments arguments) { |
+ return buildMethodInvocation( |
+ buildSimpleRead(), callName, arguments, offset); |
+ } |
+} |
+ |
+class ParenthesizedExpression extends ReadOnlyAccessor { |
+ ParenthesizedExpression( |
+ BuilderHelper helper, Expression expression, int offset) |
+ : super(helper, expression, "<a parenthesized expression>", offset); |
+ |
+ Expression makeInvalidWrite(Expression value) { |
+ return helper.buildCompileTimeError( |
+ "Can't assign to a parenthesized expression.", offset); |
+ } |
+} |
+ |
bool isFieldOrGetter(Member member) { |
return member is Field || (member is Procedure && member.isGetter); |
} |