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.body_builder; | 5 library fasta.body_builder; |
6 | 6 |
7 import '../fasta_codes.dart' | 7 import '../fasta_codes.dart' show Message; |
8 show | 8 |
9 FastaMessage, | 9 import '../fasta_codes.dart' as fasta; |
10 codeConstFieldWithoutInitializer, | |
11 codeExpectedButGot, | |
12 codeExpectedFunctionBody, | |
13 codeFinalFieldWithoutInitializer; | |
14 | 10 |
15 import '../parser/parser.dart' | 11 import '../parser/parser.dart' |
16 show Assert, FormalParameterType, MemberKind, optional; | 12 show Assert, FormalParameterType, MemberKind, optional; |
17 | 13 |
18 import '../parser/identifier_context.dart' show IdentifierContext; | 14 import '../parser/identifier_context.dart' show IdentifierContext; |
19 | 15 |
20 import 'package:front_end/src/fasta/kernel/kernel_shadow_ast.dart'; | 16 import 'package:front_end/src/fasta/kernel/kernel_shadow_ast.dart'; |
21 | 17 |
22 import 'package:front_end/src/fasta/kernel/utils.dart' show offsetForToken; | 18 import 'package:front_end/src/fasta/kernel/utils.dart' show offsetForToken; |
23 | 19 |
(...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
949 } | 945 } |
950 | 946 |
951 @override | 947 @override |
952 Expression throwNoSuchMethodError( | 948 Expression throwNoSuchMethodError( |
953 Expression receiver, String name, Arguments arguments, int charOffset, | 949 Expression receiver, String name, Arguments arguments, int charOffset, |
954 {bool isSuper: false, | 950 {bool isSuper: false, |
955 bool isGetter: false, | 951 bool isGetter: false, |
956 bool isSetter: false, | 952 bool isSetter: false, |
957 bool isStatic: false}) { | 953 bool isStatic: false}) { |
958 String errorName = isSuper ? "super.$name" : name; | 954 String errorName = isSuper ? "super.$name" : name; |
959 String message; | 955 Message message; |
960 if (isGetter) { | 956 if (isGetter) { |
961 message = "Getter not found: '$errorName'."; | 957 message = fasta.templateGetterNotFound.withArguments(errorName); |
962 } else if (isSetter) { | 958 } else if (isSetter) { |
963 message = "Setter not found: '$errorName'."; | 959 message = fasta.templateSetterNotFound.withArguments(errorName); |
964 } else { | 960 } else { |
965 message = "Method not found: '$errorName'."; | 961 message = fasta.templateMethodNotFound.withArguments(errorName); |
966 } | 962 } |
967 if (constantExpressionRequired) { | 963 if (constantExpressionRequired) { |
968 // TODO(ahe): Use error below instead of building a compile-time error, | 964 // TODO(ahe): Use error below instead of building a compile-time error, |
969 // should be: | 965 // should be: |
970 // return library.loader.throwCompileConstantError(error, charOffset); | 966 // return library.loader.throwCompileConstantError(error, charOffset); |
971 return deprecated_buildCompileTimeError(message, charOffset); | 967 return buildCompileTimeError(message, charOffset); |
972 } else { | 968 } else { |
973 Expression error = library.loader.instantiateNoSuchMethodError( | 969 Expression error = library.loader.instantiateNoSuchMethodError( |
974 receiver, name, arguments, charOffset, | 970 receiver, name, arguments, charOffset, |
975 isMethod: !isGetter && !isSetter, | 971 isMethod: !isGetter && !isSetter, |
976 isGetter: isGetter, | 972 isGetter: isGetter, |
977 isSetter: isSetter, | 973 isSetter: isSetter, |
978 isStatic: isStatic, | 974 isStatic: isStatic, |
979 isTopLevel: !isStatic && !isSuper); | 975 isTopLevel: !isStatic && !isSuper); |
980 deprecated_warning(message, charOffset); | 976 warning(message, charOffset); |
981 return new KernelSyntheticExpression(new Throw(error)); | 977 return new KernelSyntheticExpression(new Throw(error)); |
982 } | 978 } |
983 } | 979 } |
984 | 980 |
985 @override | 981 @override |
986 void warnUnresolvedSuperGet(Name name, int charOffset) { | 982 void warnUnresolvedSuperGet(Name name, int charOffset) { |
987 deprecated_warning( | 983 deprecated_warning( |
988 "Super class has no getter named '${name.name}'.", charOffset); | 984 "Super class has no getter named '${name.name}'.", charOffset); |
989 } | 985 } |
990 | 986 |
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1533 void handleLiteralList( | 1529 void handleLiteralList( |
1534 int count, Token beginToken, Token constKeyword, Token endToken) { | 1530 int count, Token beginToken, Token constKeyword, Token endToken) { |
1535 debugEvent("LiteralList"); | 1531 debugEvent("LiteralList"); |
1536 List<Expression> expressions = popListForValue(count); | 1532 List<Expression> expressions = popListForValue(count); |
1537 List<DartType> typeArguments = pop(); | 1533 List<DartType> typeArguments = pop(); |
1538 DartType typeArgument; | 1534 DartType typeArgument; |
1539 if (typeArguments != null) { | 1535 if (typeArguments != null) { |
1540 typeArgument = typeArguments.first; | 1536 typeArgument = typeArguments.first; |
1541 if (typeArguments.length > 1) { | 1537 if (typeArguments.length > 1) { |
1542 typeArgument = null; | 1538 typeArgument = null; |
1543 deprecated_warningNotError( | 1539 warningNotError(fasta.messageListLiteralTooManyTypeArguments, |
1544 "Too many type arguments on List literal.", beginToken.charOffset); | 1540 beginToken.charOffset); |
1545 } | 1541 } |
1546 } | 1542 } |
1547 push(new KernelListLiteral(expressions, | 1543 push(new KernelListLiteral(expressions, |
1548 typeArgument: typeArgument, isConst: constKeyword != null) | 1544 typeArgument: typeArgument, isConst: constKeyword != null) |
1549 ..fileOffset = offsetForToken(constKeyword ?? beginToken)); | 1545 ..fileOffset = offsetForToken(constKeyword ?? beginToken)); |
1550 } | 1546 } |
1551 | 1547 |
1552 @override | 1548 @override |
1553 void handleLiteralBool(Token token) { | 1549 void handleLiteralBool(Token token) { |
1554 debugEvent("LiteralBool"); | 1550 debugEvent("LiteralBool"); |
(...skipping 20 matching lines...) Expand all Loading... |
1575 int count, Token beginToken, Token constKeyword, Token endToken) { | 1571 int count, Token beginToken, Token constKeyword, Token endToken) { |
1576 debugEvent("LiteralMap"); | 1572 debugEvent("LiteralMap"); |
1577 List<MapEntry> entries = popList(count) ?? <MapEntry>[]; | 1573 List<MapEntry> entries = popList(count) ?? <MapEntry>[]; |
1578 List<DartType> typeArguments = pop(); | 1574 List<DartType> typeArguments = pop(); |
1579 DartType keyType; | 1575 DartType keyType; |
1580 DartType valueType; | 1576 DartType valueType; |
1581 if (typeArguments != null) { | 1577 if (typeArguments != null) { |
1582 if (typeArguments.length != 2) { | 1578 if (typeArguments.length != 2) { |
1583 keyType = null; | 1579 keyType = null; |
1584 valueType = null; | 1580 valueType = null; |
1585 deprecated_warningNotError( | 1581 warningNotError(fasta.messageListLiteralTypeArgumentMismatch, |
1586 "Map literal requires two type arguments.", beginToken.charOffset); | 1582 beginToken.charOffset); |
1587 } else { | 1583 } else { |
1588 keyType = typeArguments[0]; | 1584 keyType = typeArguments[0]; |
1589 valueType = typeArguments[1]; | 1585 valueType = typeArguments[1]; |
1590 } | 1586 } |
1591 } | 1587 } |
1592 push(new KernelMapLiteral(entries, | 1588 push(new KernelMapLiteral(entries, |
1593 keyType: keyType, valueType: valueType, isConst: constKeyword != null) | 1589 keyType: keyType, valueType: valueType, isConst: constKeyword != null) |
1594 ..fileOffset = constKeyword?.charOffset ?? offsetForToken(beginToken)); | 1590 ..fileOffset = constKeyword?.charOffset ?? offsetForToken(beginToken)); |
1595 } | 1591 } |
1596 | 1592 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1642 | 1638 |
1643 DartType kernelTypeFromBuilder( | 1639 DartType kernelTypeFromBuilder( |
1644 Builder builder, List<DartType> arguments, int charOffset) { | 1640 Builder builder, List<DartType> arguments, int charOffset) { |
1645 if (constantExpressionRequired && builder is TypeVariableBuilder) { | 1641 if (constantExpressionRequired && builder is TypeVariableBuilder) { |
1646 deprecated_addCompileTimeError(charOffset, "Not a constant expression."); | 1642 deprecated_addCompileTimeError(charOffset, "Not a constant expression."); |
1647 } | 1643 } |
1648 if (builder.hasProblem) { | 1644 if (builder.hasProblem) { |
1649 ProblemBuilder problem = builder; | 1645 ProblemBuilder problem = builder; |
1650 deprecated_addCompileTimeError(charOffset, problem.deprecated_message); | 1646 deprecated_addCompileTimeError(charOffset, problem.deprecated_message); |
1651 } else { | 1647 } else { |
1652 deprecated_warningNotError( | 1648 warningNotError( |
1653 "Not a type: '${builder.fullNameForErrors}'.", charOffset); | 1649 fasta.templateNotAType.withArguments(builder.fullNameForErrors), |
| 1650 charOffset); |
1654 } | 1651 } |
1655 // TODO(ahe): Create an error somehow. | 1652 // TODO(ahe): Create an error somehow. |
1656 return const InvalidType(); | 1653 return const InvalidType(); |
1657 } | 1654 } |
1658 | 1655 |
1659 @override | 1656 @override |
1660 void handleType(Token beginToken, Token endToken) { | 1657 void handleType(Token beginToken, Token endToken) { |
1661 // TODO(ahe): The scope is wrong for return types of generic functions. | 1658 // TODO(ahe): The scope is wrong for return types of generic functions. |
1662 debugEvent("Type"); | 1659 debugEvent("Type"); |
1663 List<DartType> arguments = pop(); | 1660 List<DartType> arguments = pop(); |
(...skipping 25 matching lines...) Expand all Loading... |
1689 "Can't be used as a type: '${debugName(prefix, suffix)}'."); | 1686 "Can't be used as a type: '${debugName(prefix, suffix)}'."); |
1690 return; | 1687 return; |
1691 } | 1688 } |
1692 } | 1689 } |
1693 if (name is Identifier) { | 1690 if (name is Identifier) { |
1694 name = name.name; | 1691 name = name.name; |
1695 } | 1692 } |
1696 if (name is TypeDeclarationAccessor) { | 1693 if (name is TypeDeclarationAccessor) { |
1697 push(name.buildType(arguments)); | 1694 push(name.buildType(arguments)); |
1698 } else if (name is FastaAccessor) { | 1695 } else if (name is FastaAccessor) { |
1699 deprecated_warningNotError( | 1696 warningNotError(fasta.templateNotAType.withArguments(beginToken.lexeme), |
1700 "'${beginToken.lexeme}' isn't a type.", beginToken.charOffset); | 1697 beginToken.charOffset); |
1701 push(const InvalidType()); | 1698 push(const InvalidType()); |
1702 } else if (name is TypeBuilder) { | 1699 } else if (name is TypeBuilder) { |
1703 push(name.build(library)); | 1700 push(name.build(library)); |
1704 } else if (name is Builder) { | 1701 } else if (name is Builder) { |
1705 push(kernelTypeFromBuilder(name, arguments, beginToken.charOffset)); | 1702 push(kernelTypeFromBuilder(name, arguments, beginToken.charOffset)); |
1706 } else if (name is String) { | 1703 } else if (name is String) { |
1707 push(kernelTypeFromString(name, arguments, beginToken.charOffset)); | 1704 push(kernelTypeFromString(name, arguments, beginToken.charOffset)); |
1708 } else { | 1705 } else { |
1709 deprecated_internalProblem("Unhandled: '${name.runtimeType}'."); | 1706 deprecated_internalProblem("Unhandled: '${name.runtimeType}'."); |
1710 } | 1707 } |
| 1708 // TODO(ahe): Unused code fasta.messageNonInstanceTypeVariableUse. |
1711 } | 1709 } |
1712 | 1710 |
1713 @override | 1711 @override |
1714 void beginFunctionType(Token beginToken) { | 1712 void beginFunctionType(Token beginToken) { |
1715 debugEvent("beginFunctionType"); | 1713 debugEvent("beginFunctionType"); |
1716 enterFunctionTypeScope(); | 1714 enterFunctionTypeScope(); |
1717 } | 1715 } |
1718 | 1716 |
1719 void enterFunctionTypeScope() { | 1717 void enterFunctionTypeScope() { |
1720 List typeVariables = pop(); | 1718 List typeVariables = pop(); |
(...skipping 1294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3015 } | 3013 } |
3016 | 3014 |
3017 @override | 3015 @override |
3018 void handleModifiers(int count) { | 3016 void handleModifiers(int count) { |
3019 debugEvent("Modifiers"); | 3017 debugEvent("Modifiers"); |
3020 // TODO(ahe): Copied from outline_builder.dart. | 3018 // TODO(ahe): Copied from outline_builder.dart. |
3021 push(popList(count) ?? NullValue.Modifiers); | 3019 push(popList(count) ?? NullValue.Modifiers); |
3022 } | 3020 } |
3023 | 3021 |
3024 @override | 3022 @override |
3025 void handleRecoverableError(Token token, FastaMessage message) { | 3023 void handleRecoverableError(Token token, Message message) { |
3026 bool silent = hasParserError || | 3024 bool silent = hasParserError || |
3027 message.code == codeFinalFieldWithoutInitializer || | 3025 message.code == fasta.codeFinalFieldWithoutInitializer || |
3028 message.code == codeConstFieldWithoutInitializer; | 3026 message.code == fasta.codeConstFieldWithoutInitializer; |
3029 deprecated_addCompileTimeError(message.charOffset, message.message, | 3027 deprecated_addCompileTimeError(offsetForToken(token), message.message, |
3030 silent: silent); | 3028 silent: silent); |
3031 } | 3029 } |
3032 | 3030 |
3033 @override | 3031 @override |
3034 Token handleUnrecoverableError(Token token, FastaMessage message) { | 3032 Token handleUnrecoverableError(Token token, Message message) { |
3035 if (enableNative && message.code == codeExpectedFunctionBody) { | 3033 if (enableNative && message.code == fasta.codeExpectedFunctionBody) { |
3036 Token recover = library.loader.target.skipNativeClause(token); | 3034 Token recover = library.loader.target.skipNativeClause(token); |
3037 if (recover != null) return recover; | 3035 if (recover != null) return recover; |
3038 } else if (message.code == codeExpectedButGot) { | 3036 } else if (message.code == fasta.codeExpectedButGot) { |
3039 String expected = message.arguments["string"]; | 3037 String expected = message.arguments["string"]; |
3040 const List<String> trailing = const <String>[")", "}", ";", ","]; | 3038 const List<String> trailing = const <String>[")", "}", ";", ","]; |
3041 if (trailing.contains(token.stringValue) && trailing.contains(expected)) { | 3039 if (trailing.contains(token.stringValue) && trailing.contains(expected)) { |
3042 handleRecoverableError(token, message); | 3040 handleRecoverableError(token, message); |
3043 return newSyntheticToken(token); | 3041 return newSyntheticToken(token); |
3044 } | 3042 } |
3045 } | 3043 } |
3046 return super.handleUnrecoverableError(token, message); | 3044 return super.handleUnrecoverableError(token, message); |
3047 } | 3045 } |
3048 | 3046 |
3049 @override | 3047 @override |
3050 Expression deprecated_buildCompileTimeError(error, [int charOffset = -1]) { | 3048 Expression deprecated_buildCompileTimeError(String error, |
| 3049 [int charOffset = -1]) { |
3051 // TODO(ahe): This method should be passed the erroneous expression, wrap | 3050 // TODO(ahe): This method should be passed the erroneous expression, wrap |
3052 // it in a class (TBD) from which the erroneous expression can be easily | 3051 // it in a class (TBD) from which the erroneous expression can be easily |
3053 // extracted. Similar for statements and initializers. See also [issue | 3052 // extracted. Similar for statements and initializers. See also [issue |
3054 // 29717](https://github.com/dart-lang/sdk/issues/29717) | 3053 // 29717](https://github.com/dart-lang/sdk/issues/29717) |
3055 deprecated_addCompileTimeError(charOffset, error, wasHandled: true); | 3054 deprecated_addCompileTimeError(charOffset, error, wasHandled: true); |
3056 return new KernelSyntheticExpression(library.loader | 3055 return new KernelSyntheticExpression(library.loader |
3057 .throwCompileConstantError(library.loader | 3056 .throwCompileConstantError(library.loader |
3058 .deprecated_buildCompileTimeError( | 3057 .deprecated_buildCompileTimeError( |
3059 deprecated_formatUnexpected(uri, charOffset, error), | 3058 deprecated_formatUnexpected(uri, charOffset, error), |
3060 charOffset))); | 3059 charOffset))); |
3061 } | 3060 } |
3062 | 3061 |
| 3062 @override |
| 3063 Expression buildCompileTimeError(Message message, int charOffset) { |
| 3064 // TODO(ahe): This method should be passed the erroneous expression, wrap |
| 3065 // it in a class (TBD) from which the erroneous expression can be easily |
| 3066 // extracted. Similar for statements and initializers. See also [issue |
| 3067 // 29717](https://github.com/dart-lang/sdk/issues/29717) |
| 3068 deprecated_addCompileTimeError(charOffset, message.message, |
| 3069 wasHandled: true); |
| 3070 return new KernelSyntheticExpression(library.loader |
| 3071 .throwCompileConstantError(library.loader |
| 3072 .deprecated_buildCompileTimeError( |
| 3073 deprecated_formatUnexpected(uri, charOffset, message.message), |
| 3074 charOffset))); |
| 3075 } |
| 3076 |
3063 Expression deprecated_wrapInCompileTimeError( | 3077 Expression deprecated_wrapInCompileTimeError( |
3064 Expression expression, String message) { | 3078 Expression expression, String message) { |
3065 return new Let( | 3079 return new Let( |
3066 new VariableDeclaration.forValue(expression) | 3080 new VariableDeclaration.forValue(expression) |
3067 ..fileOffset = expression.fileOffset, | 3081 ..fileOffset = expression.fileOffset, |
3068 deprecated_buildCompileTimeError(message, expression.fileOffset)) | 3082 deprecated_buildCompileTimeError(message, expression.fileOffset)) |
3069 ..fileOffset = expression.fileOffset; | 3083 ..fileOffset = expression.fileOffset; |
3070 } | 3084 } |
3071 | 3085 |
3072 Expression buildFallThroughError(int charOffset) { | 3086 Expression buildFallThroughError(int charOffset) { |
3073 deprecated_warningNotError( | 3087 deprecated_warningNotError( |
3074 "Switch case may fall through to next case.", charOffset); | 3088 "Switch case may fall through to next case.", charOffset); |
3075 | 3089 |
3076 Location location = messages.getLocationFromUri(uri, charOffset); | 3090 Location location = messages.getLocationFromUri(uri, charOffset); |
3077 | 3091 |
3078 return new Throw(buildStaticInvocation( | 3092 return new Throw(buildStaticInvocation( |
3079 library.loader.coreTypes.fallThroughErrorUrlAndLineConstructor, | 3093 library.loader.coreTypes.fallThroughErrorUrlAndLineConstructor, |
3080 new Arguments(<Expression>[ | 3094 new Arguments(<Expression>[ |
3081 new StringLiteral(location?.file ?? uri.toString()), | 3095 new StringLiteral(location?.file ?? uri.toString()), |
3082 new IntLiteral(location?.line ?? 0) | 3096 new IntLiteral(location?.line ?? 0) |
3083 ]), | 3097 ]), |
3084 charOffset: charOffset)); | 3098 charOffset: charOffset)); |
3085 } | 3099 } |
3086 | 3100 |
3087 Expression buildAbstractClassInstantiationError(String className, | 3101 Expression buildAbstractClassInstantiationError(String className, |
3088 [int charOffset = -1]) { | 3102 [int charOffset = -1]) { |
3089 deprecated_warning( | 3103 warning(fasta.templateAbstractClassInstantiation.withArguments(className), |
3090 "The class '$className' is abstract and can't be instantiated.", | |
3091 charOffset); | 3104 charOffset); |
3092 Builder constructor = library.loader.getAbstractClassInstantiationError(); | 3105 Builder constructor = library.loader.getAbstractClassInstantiationError(); |
3093 return new KernelSyntheticExpression(new Throw(buildStaticInvocation( | 3106 return new KernelSyntheticExpression(new Throw(buildStaticInvocation( |
3094 constructor.target, | 3107 constructor.target, |
3095 new KernelArguments(<Expression>[new StringLiteral(className)])))); | 3108 new KernelArguments(<Expression>[new StringLiteral(className)])))); |
3096 } | 3109 } |
3097 | 3110 |
3098 Statement deprecated_buildCompileTimeErrorStatement(error, | 3111 Statement deprecated_buildCompileTimeErrorStatement(error, |
3099 [int charOffset = -1]) { | 3112 [int charOffset = -1]) { |
3100 return new KernelExpressionStatement( | 3113 return new KernelExpressionStatement( |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3228 deprecated_addCompileTimeError(charOffset, message); | 3241 deprecated_addCompileTimeError(charOffset, message); |
3229 } else { | 3242 } else { |
3230 super.deprecated_warning(message, charOffset); | 3243 super.deprecated_warning(message, charOffset); |
3231 } | 3244 } |
3232 } | 3245 } |
3233 | 3246 |
3234 void deprecated_warningNotError(String message, [int charOffset = -1]) { | 3247 void deprecated_warningNotError(String message, [int charOffset = -1]) { |
3235 super.deprecated_warning(message, charOffset); | 3248 super.deprecated_warning(message, charOffset); |
3236 } | 3249 } |
3237 | 3250 |
| 3251 void warningNotError(Message message, int charOffset) { |
| 3252 super.warning(message, charOffset); |
| 3253 } |
| 3254 |
3238 @override | 3255 @override |
3239 DartType validatedTypeVariableUse( | 3256 DartType validatedTypeVariableUse( |
3240 TypeParameterType type, int offset, bool nonInstanceAccessIsError) { | 3257 TypeParameterType type, int offset, bool nonInstanceAccessIsError) { |
3241 if (!isInstanceContext && type.parameter.parent is Class) { | 3258 if (!isInstanceContext && type.parameter.parent is Class) { |
3242 String message = "Type variables can't be used in static members."; | 3259 String message = "Type variables can't be used in static members."; |
3243 if (nonInstanceAccessIsError) { | 3260 if (nonInstanceAccessIsError) { |
3244 deprecated_addCompileTimeError(offset, message); | 3261 deprecated_addCompileTimeError(offset, message); |
3245 } else { | 3262 } else { |
3246 deprecated_warning(message, offset); | 3263 deprecated_warning(message, offset); |
3247 } | 3264 } |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3297 ..fileOffset = offset) | 3314 ..fileOffset = offset) |
3298 ..fileOffset = offset; | 3315 ..fileOffset = offset; |
3299 } else { | 3316 } else { |
3300 return new KernelMethodInvocation(receiver, name, arguments, | 3317 return new KernelMethodInvocation(receiver, name, arguments, |
3301 isImplicitCall: isImplicitCall) | 3318 isImplicitCall: isImplicitCall) |
3302 ..fileOffset = offset; | 3319 ..fileOffset = offset; |
3303 } | 3320 } |
3304 } | 3321 } |
3305 | 3322 |
3306 @override | 3323 @override |
3307 void addCompileTimeErrorFromMessage(FastaMessage message) { | 3324 void addCompileTimeError(Message message, int charOffset) { |
3308 library.deprecated_addCompileTimeError(message.charOffset, message.message, | 3325 library.deprecated_addCompileTimeError(charOffset, message.message, |
3309 fileUri: message.uri); | 3326 fileUri: uri); |
3310 } | 3327 } |
3311 | 3328 |
3312 @override | 3329 @override |
3313 void debugEvent(String name) { | 3330 void debugEvent(String name) { |
3314 // printEvent(name); | 3331 // printEvent(name); |
3315 } | 3332 } |
3316 | 3333 |
3317 @override | 3334 @override |
3318 StaticGet makeStaticGet(Member readTarget, Token token) { | 3335 StaticGet makeStaticGet(Member readTarget, Token token) { |
3319 return new KernelStaticGet(readTarget)..fileOffset = offsetForToken(token); | 3336 return new KernelStaticGet(readTarget)..fileOffset = offsetForToken(token); |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3773 if (starToken == null) { | 3790 if (starToken == null) { |
3774 return AsyncMarker.Async; | 3791 return AsyncMarker.Async; |
3775 } else { | 3792 } else { |
3776 assert(identical(starToken.stringValue, "*")); | 3793 assert(identical(starToken.stringValue, "*")); |
3777 return AsyncMarker.AsyncStar; | 3794 return AsyncMarker.AsyncStar; |
3778 } | 3795 } |
3779 } else { | 3796 } else { |
3780 return deprecated_internalProblem("Unknown async modifier: $asyncToken"); | 3797 return deprecated_internalProblem("Unknown async modifier: $asyncToken"); |
3781 } | 3798 } |
3782 } | 3799 } |
OLD | NEW |