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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 | 81 |
82 finishSend(Object receiver, Arguments arguments, int offset); | 82 finishSend(Object receiver, Arguments arguments, int offset); |
83 | 83 |
84 Expression buildCompileTimeError(Message message, int charOffset); | 84 Expression buildCompileTimeError(Message message, int charOffset); |
85 | 85 |
86 Expression deprecated_buildCompileTimeError(String error, [int offset]); | 86 Expression deprecated_buildCompileTimeError(String error, [int offset]); |
87 | 87 |
88 Initializer buildInvalidInitializer(Expression expression, [int offset]); | 88 Initializer buildInvalidInitializer(Expression expression, [int offset]); |
89 | 89 |
90 Initializer buildFieldInitializer( | 90 Initializer buildFieldInitializer( |
91 String name, int offset, Expression expression); | 91 bool isSynthetic, String name, int offset, Expression expression); |
92 | 92 |
93 Initializer buildSuperInitializer( | 93 Initializer buildSuperInitializer( |
94 Constructor constructor, Arguments arguments, | 94 bool isSynthetic, Constructor constructor, Arguments arguments, |
95 [int offset]); | 95 [int offset]); |
96 | 96 |
97 Initializer buildRedirectingInitializer( | 97 Initializer buildRedirectingInitializer( |
98 Constructor constructor, Arguments arguments, | 98 Constructor constructor, Arguments arguments, |
99 [int charOffset = -1]); | 99 [int charOffset = -1]); |
100 | 100 |
101 Expression buildStaticInvocation(Procedure target, Arguments arguments); | 101 Expression buildStaticInvocation(Procedure target, Arguments arguments); |
102 | 102 |
103 Expression buildProblemExpression(ProblemBuilder builder, int offset); | 103 Expression buildProblemExpression(ProblemBuilder builder, int offset); |
104 | 104 |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 Constructor constructor = helper.lookupConstructor(name, isSuper: isSuper); | 389 Constructor constructor = helper.lookupConstructor(name, isSuper: isSuper); |
390 if (constructor == null || | 390 if (constructor == null || |
391 !helper.checkArguments( | 391 !helper.checkArguments( |
392 constructor.function, arguments, <TypeParameter>[])) { | 392 constructor.function, arguments, <TypeParameter>[])) { |
393 return helper.buildInvalidInitializer( | 393 return helper.buildInvalidInitializer( |
394 buildThrowNoSuchMethodError( | 394 buildThrowNoSuchMethodError( |
395 new NullLiteral()..fileOffset = offset, arguments, | 395 new NullLiteral()..fileOffset = offset, arguments, |
396 isSuper: isSuper, name: name.name, offset: offset), | 396 isSuper: isSuper, name: name.name, offset: offset), |
397 offset); | 397 offset); |
398 } else if (isSuper) { | 398 } else if (isSuper) { |
399 return helper.buildSuperInitializer(constructor, arguments, offset); | 399 return helper.buildSuperInitializer( |
| 400 false, constructor, arguments, offset); |
400 } else { | 401 } else { |
401 return helper.buildRedirectingInitializer(constructor, arguments, offset); | 402 return helper.buildRedirectingInitializer(constructor, arguments, offset); |
402 } | 403 } |
403 } | 404 } |
404 | 405 |
405 Expression buildAssignment(Expression value, {bool voidContext: false}) { | 406 Expression buildAssignment(Expression value, {bool voidContext: false}) { |
406 return buildAssignmentError(); | 407 return buildAssignmentError(); |
407 } | 408 } |
408 | 409 |
409 Expression buildNullAwareAssignment( | 410 Expression buildNullAwareAssignment( |
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1056 offset ??= offsetForToken(this.token); | 1057 offset ??= offsetForToken(this.token); |
1057 return helper.throwNoSuchMethodError(new NullLiteral()..fileOffset = offset, | 1058 return helper.throwNoSuchMethodError(new NullLiteral()..fileOffset = offset, |
1058 plainNameForRead, arguments, offset, | 1059 plainNameForRead, arguments, offset, |
1059 isGetter: isGetter, isSetter: isSetter); | 1060 isGetter: isGetter, isSetter: isSetter); |
1060 } | 1061 } |
1061 } | 1062 } |
1062 | 1063 |
1063 bool isFieldOrGetter(Member member) { | 1064 bool isFieldOrGetter(Member member) { |
1064 return member is Field || (member is Procedure && member.isGetter); | 1065 return member is Field || (member is Procedure && member.isGetter); |
1065 } | 1066 } |
OLD | NEW |