OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library fasta.fasta_accessors; | 5 library fasta.fasta_accessors; |
6 | 6 |
7 import 'package:kernel/ast.dart' | 7 import 'package:kernel/ast.dart' |
8 hide InvalidExpression, InvalidInitializer, InvalidStatement; | 8 hide InvalidExpression, InvalidInitializer, InvalidStatement; |
9 | 9 |
10 import '../../scanner/token.dart' show Token; | 10 import '../../scanner/token.dart' show Token; |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 | 116 |
117 bool isIdentical(Member member); | 117 bool isIdentical(Member member); |
118 | 118 |
119 Expression buildMethodInvocation( | 119 Expression buildMethodInvocation( |
120 Expression receiver, Name name, Arguments arguments, int offset, | 120 Expression receiver, Name name, Arguments arguments, int offset, |
121 {bool isConstantExpression, bool isNullAware, bool isImplicitCall}); | 121 {bool isConstantExpression, bool isNullAware, bool isImplicitCall}); |
122 | 122 |
123 DartType validatedTypeVariableUse( | 123 DartType validatedTypeVariableUse( |
124 TypeParameterType type, int offset, bool nonInstanceAccessIsError); | 124 TypeParameterType type, int offset, bool nonInstanceAccessIsError); |
125 | 125 |
| 126 void warning(Message message, int charOffset); |
| 127 |
126 void deprecated_warning(String message, [int charOffset]); | 128 void deprecated_warning(String message, [int charOffset]); |
127 | 129 |
128 void warnUnresolvedSuperGet(Name name, int charOffset); | 130 void warnUnresolvedSuperGet(Name name, int charOffset); |
129 | 131 |
130 void warnUnresolvedSuperSet(Name name, int charOffset); | 132 void warnUnresolvedSuperSet(Name name, int charOffset); |
131 | 133 |
132 void warnUnresolvedSuperMethod(Name name, int charOffset); | 134 void warnUnresolvedSuperMethod(Name name, int charOffset); |
133 } | 135 } |
134 | 136 |
135 abstract class FastaAccessor implements Accessor { | 137 abstract class FastaAccessor implements Accessor { |
(...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
949 | 951 |
950 TypeDeclarationAccessor(BuilderHelper helper, this.declaration, | 952 TypeDeclarationAccessor(BuilderHelper helper, this.declaration, |
951 String plainNameForRead, Token token) | 953 String plainNameForRead, Token token) |
952 : super(helper, null, plainNameForRead, token); | 954 : super(helper, null, plainNameForRead, token); |
953 | 955 |
954 Expression get expression { | 956 Expression get expression { |
955 if (super.expression == null) { | 957 if (super.expression == null) { |
956 int offset = offsetForToken(token); | 958 int offset = offsetForToken(token); |
957 if (declaration is KernelInvalidTypeBuilder) { | 959 if (declaration is KernelInvalidTypeBuilder) { |
958 KernelInvalidTypeBuilder declaration = this.declaration; | 960 KernelInvalidTypeBuilder declaration = this.declaration; |
959 String message = declaration.message; | 961 helper.library.addWarning( |
960 helper.library.deprecated_addWarning(declaration.charOffset, message, | 962 declaration.message, declaration.charOffset, declaration.fileUri); |
961 fileUri: declaration.fileUri); | 963 helper.warning(declaration.message, offset); |
962 helper.deprecated_warning(message, offset); | |
963 super.expression = new Throw( | 964 super.expression = new Throw( |
964 new StringLiteral(message)..fileOffset = offsetForToken(token)) | 965 new StringLiteral(declaration.message.message) |
| 966 ..fileOffset = offsetForToken(token)) |
965 ..fileOffset = offset; | 967 ..fileOffset = offset; |
966 } else { | 968 } else { |
967 super.expression = new KernelTypeLiteral( | 969 super.expression = new KernelTypeLiteral( |
968 buildType(null, nonInstanceAccessIsError: true)) | 970 buildType(null, nonInstanceAccessIsError: true)) |
969 ..fileOffset = offsetForToken(token); | 971 ..fileOffset = offsetForToken(token); |
970 } | 972 } |
971 } | 973 } |
972 return super.expression; | 974 return super.expression; |
973 } | 975 } |
974 | 976 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1056 offset ??= offsetForToken(this.token); | 1058 offset ??= offsetForToken(this.token); |
1057 return helper.throwNoSuchMethodError(new NullLiteral()..fileOffset = offset, | 1059 return helper.throwNoSuchMethodError(new NullLiteral()..fileOffset = offset, |
1058 plainNameForRead, arguments, offset, | 1060 plainNameForRead, arguments, offset, |
1059 isGetter: isGetter, isSetter: isSetter); | 1061 isGetter: isGetter, isSetter: isSetter); |
1060 } | 1062 } |
1061 } | 1063 } |
1062 | 1064 |
1063 bool isFieldOrGetter(Member member) { | 1065 bool isFieldOrGetter(Member member) { |
1064 return member is Field || (member is Procedure && member.isGetter); | 1066 return member is Field || (member is Procedure && member.isGetter); |
1065 } | 1067 } |
OLD | NEW |