| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 // This file has been automatically generated. Please do not edit it manually. | 5 // This file has been automatically generated. Please do not edit it manually. |
| 6 // To regenerate the file, use the script "pkg/analyzer/tool/generate_files". | 6 // To regenerate the file, use the script "pkg/analyzer/tool/generate_files". |
| 7 | 7 |
| 8 library analyzer.src.summary.format; | 8 library analyzer.src.summary.format; |
| 9 | 9 |
| 10 import 'base.dart' as base; | 10 import 'base.dart' as base; |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 * `a` is a prefix name and `b` is a class name. | 166 * `a` is a prefix name and `b` is a class name. |
| 167 * | 167 * |
| 168 * TODO(paulberry): figure out how to resolve this ambiguity in the | 168 * TODO(paulberry): figure out how to resolve this ambiguity in the |
| 169 * "prelinked" part of the summary. | 169 * "prelinked" part of the summary. |
| 170 */ | 170 */ |
| 171 invokeConstructor, | 171 invokeConstructor, |
| 172 | 172 |
| 173 /** | 173 /** |
| 174 * Pop the top n values from the stack (where n is obtained from | 174 * Pop the top n values from the stack (where n is obtained from |
| 175 * [UnlinkedConst.ints]), place them in a [List], and push the result back | 175 * [UnlinkedConst.ints]), place them in a [List], and push the result back |
| 176 * onto the stack. The type parameter for the [List] is implicitly `dynamic`. |
| 177 */ |
| 178 makeUntypedList, |
| 179 |
| 180 /** |
| 181 * Pop the top 2*n values from the stack (where n is obtained from |
| 182 * [UnlinkedConst.ints]), interpret them as key/value pairs, place them in a |
| 183 * [Map], and push the result back onto the stack. The two type parameters |
| 184 * for the [Map] are implicitly `dynamic`. |
| 185 */ |
| 186 makeUntypedMap, |
| 187 |
| 188 /** |
| 189 * Pop the top n values from the stack (where n is obtained from |
| 190 * [UnlinkedConst.ints]), place them in a [List], and push the result back |
| 176 * onto the stack. The type parameter for the [List] is obtained from | 191 * onto the stack. The type parameter for the [List] is obtained from |
| 177 * [UnlinkedConst.references]. | 192 * [UnlinkedConst.references]. |
| 178 */ | 193 */ |
| 179 makeList, | 194 makeTypedList, |
| 180 | 195 |
| 181 /** | 196 /** |
| 182 * Pop the top 2*n values from the stack (where n is obtained from | 197 * Pop the top 2*n values from the stack (where n is obtained from |
| 183 * [UnlinkedConst.ints]), interpret them as key/value pairs, place them in a | 198 * [UnlinkedConst.ints]), interpret them as key/value pairs, place them in a |
| 184 * [Map], and push the result back onto the stack. The two type parameters fo
r | 199 * [Map], and push the result back onto the stack. The two type parameters fo
r |
| 185 * the [Map] are obtained from [UnlinkedConst.references]. | 200 * the [Map] are obtained from [UnlinkedConst.references]. |
| 186 */ | 201 */ |
| 187 makeMap, | 202 makeTypedMap, |
| 188 | 203 |
| 189 /** | 204 /** |
| 190 * Pop the top 2 values from the stack, pass them to the predefined Dart | 205 * Pop the top 2 values from the stack, pass them to the predefined Dart |
| 191 * function `identical`, and push the result back onto the stack. | 206 * function `identical`, and push the result back onto the stack. |
| 192 */ | 207 */ |
| 193 identical, | 208 identical, |
| 194 | 209 |
| 195 /** | 210 /** |
| 196 * Pop the top 2 values from the stack, evaluate `v1 == v2`, and push the | 211 * Pop the top 2 values from the stack, evaluate `v1 == v2`, and push the |
| 197 * result back onto the stack. | 212 * result back onto the stack. |
| (...skipping 2705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2903 int _nameOffset; | 2918 int _nameOffset; |
| 2904 UnlinkedDocumentationCommentBuilder _documentationComment; | 2919 UnlinkedDocumentationCommentBuilder _documentationComment; |
| 2905 List<UnlinkedTypeParamBuilder> _typeParameters; | 2920 List<UnlinkedTypeParamBuilder> _typeParameters; |
| 2906 EntityRefBuilder _returnType; | 2921 EntityRefBuilder _returnType; |
| 2907 List<UnlinkedParamBuilder> _parameters; | 2922 List<UnlinkedParamBuilder> _parameters; |
| 2908 UnlinkedExecutableKind _kind; | 2923 UnlinkedExecutableKind _kind; |
| 2909 bool _isAbstract; | 2924 bool _isAbstract; |
| 2910 bool _isStatic; | 2925 bool _isStatic; |
| 2911 bool _isConst; | 2926 bool _isConst; |
| 2912 bool _isFactory; | 2927 bool _isFactory; |
| 2913 bool _hasImplicitReturnType; | |
| 2914 bool _isExternal; | 2928 bool _isExternal; |
| 2915 | 2929 |
| 2916 @override | 2930 @override |
| 2917 String get name => _name ??= ''; | 2931 String get name => _name ??= ''; |
| 2918 | 2932 |
| 2919 /** | 2933 /** |
| 2920 * Name of the executable. For setters, this includes the trailing "=". For | 2934 * Name of the executable. For setters, this includes the trailing "=". For |
| 2921 * named constructors, this excludes the class name and excludes the ".". | 2935 * named constructors, this excludes the class name and excludes the ".". |
| 2922 * For unnamed constructors, this is the empty string. | 2936 * For unnamed constructors, this is the empty string. |
| 2923 */ | 2937 */ |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2963 void set typeParameters(List<UnlinkedTypeParamBuilder> _value) { | 2977 void set typeParameters(List<UnlinkedTypeParamBuilder> _value) { |
| 2964 assert(!_finished); | 2978 assert(!_finished); |
| 2965 _typeParameters = _value; | 2979 _typeParameters = _value; |
| 2966 } | 2980 } |
| 2967 | 2981 |
| 2968 @override | 2982 @override |
| 2969 EntityRefBuilder get returnType => _returnType; | 2983 EntityRefBuilder get returnType => _returnType; |
| 2970 | 2984 |
| 2971 /** | 2985 /** |
| 2972 * Declared return type of the executable. Absent if the executable is a | 2986 * Declared return type of the executable. Absent if the executable is a |
| 2973 * constructor. Note that when strong mode is enabled, the actual return | 2987 * constructor or the return type is implicit. |
| 2974 * type may be different due to type inference. | |
| 2975 */ | 2988 */ |
| 2976 void set returnType(EntityRefBuilder _value) { | 2989 void set returnType(EntityRefBuilder _value) { |
| 2977 assert(!_finished); | 2990 assert(!_finished); |
| 2978 _returnType = _value; | 2991 _returnType = _value; |
| 2979 } | 2992 } |
| 2980 | 2993 |
| 2981 @override | 2994 @override |
| 2982 List<UnlinkedParamBuilder> get parameters => _parameters ??= <UnlinkedParamBui
lder>[]; | 2995 List<UnlinkedParamBuilder> get parameters => _parameters ??= <UnlinkedParamBui
lder>[]; |
| 2983 | 2996 |
| 2984 /** | 2997 /** |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3045 | 3058 |
| 3046 /** | 3059 /** |
| 3047 * Indicates whether the executable is declared using the `factory` keyword. | 3060 * Indicates whether the executable is declared using the `factory` keyword. |
| 3048 */ | 3061 */ |
| 3049 void set isFactory(bool _value) { | 3062 void set isFactory(bool _value) { |
| 3050 assert(!_finished); | 3063 assert(!_finished); |
| 3051 _isFactory = _value; | 3064 _isFactory = _value; |
| 3052 } | 3065 } |
| 3053 | 3066 |
| 3054 @override | 3067 @override |
| 3055 bool get hasImplicitReturnType => _hasImplicitReturnType ??= false; | |
| 3056 | |
| 3057 /** | |
| 3058 * Indicates whether the executable lacks an explicit return type | |
| 3059 * declaration. False for constructors and setters. | |
| 3060 */ | |
| 3061 void set hasImplicitReturnType(bool _value) { | |
| 3062 assert(!_finished); | |
| 3063 _hasImplicitReturnType = _value; | |
| 3064 } | |
| 3065 | |
| 3066 @override | |
| 3067 bool get isExternal => _isExternal ??= false; | 3068 bool get isExternal => _isExternal ??= false; |
| 3068 | 3069 |
| 3069 /** | 3070 /** |
| 3070 * Indicates whether the executable is declared using the `external` keyword. | 3071 * Indicates whether the executable is declared using the `external` keyword. |
| 3071 */ | 3072 */ |
| 3072 void set isExternal(bool _value) { | 3073 void set isExternal(bool _value) { |
| 3073 assert(!_finished); | 3074 assert(!_finished); |
| 3074 _isExternal = _value; | 3075 _isExternal = _value; |
| 3075 } | 3076 } |
| 3076 | 3077 |
| 3077 UnlinkedExecutableBuilder({String name, int nameOffset, UnlinkedDocumentationC
ommentBuilder documentationComment, List<UnlinkedTypeParamBuilder> typeParameter
s, EntityRefBuilder returnType, List<UnlinkedParamBuilder> parameters, UnlinkedE
xecutableKind kind, bool isAbstract, bool isStatic, bool isConst, bool isFactory
, bool hasImplicitReturnType, bool isExternal}) | 3078 UnlinkedExecutableBuilder({String name, int nameOffset, UnlinkedDocumentationC
ommentBuilder documentationComment, List<UnlinkedTypeParamBuilder> typeParameter
s, EntityRefBuilder returnType, List<UnlinkedParamBuilder> parameters, UnlinkedE
xecutableKind kind, bool isAbstract, bool isStatic, bool isConst, bool isFactory
, bool isExternal}) |
| 3078 : _name = name, | 3079 : _name = name, |
| 3079 _nameOffset = nameOffset, | 3080 _nameOffset = nameOffset, |
| 3080 _documentationComment = documentationComment, | 3081 _documentationComment = documentationComment, |
| 3081 _typeParameters = typeParameters, | 3082 _typeParameters = typeParameters, |
| 3082 _returnType = returnType, | 3083 _returnType = returnType, |
| 3083 _parameters = parameters, | 3084 _parameters = parameters, |
| 3084 _kind = kind, | 3085 _kind = kind, |
| 3085 _isAbstract = isAbstract, | 3086 _isAbstract = isAbstract, |
| 3086 _isStatic = isStatic, | 3087 _isStatic = isStatic, |
| 3087 _isConst = isConst, | 3088 _isConst = isConst, |
| 3088 _isFactory = isFactory, | 3089 _isFactory = isFactory, |
| 3089 _hasImplicitReturnType = hasImplicitReturnType, | |
| 3090 _isExternal = isExternal; | 3090 _isExternal = isExternal; |
| 3091 | 3091 |
| 3092 fb.Offset finish(fb.Builder fbBuilder) { | 3092 fb.Offset finish(fb.Builder fbBuilder) { |
| 3093 assert(!_finished); | 3093 assert(!_finished); |
| 3094 _finished = true; | 3094 _finished = true; |
| 3095 fb.Offset offset_name; | 3095 fb.Offset offset_name; |
| 3096 fb.Offset offset_documentationComment; | 3096 fb.Offset offset_documentationComment; |
| 3097 fb.Offset offset_typeParameters; | 3097 fb.Offset offset_typeParameters; |
| 3098 fb.Offset offset_returnType; | 3098 fb.Offset offset_returnType; |
| 3099 fb.Offset offset_parameters; | 3099 fb.Offset offset_parameters; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3139 } | 3139 } |
| 3140 if (_isStatic == true) { | 3140 if (_isStatic == true) { |
| 3141 fbBuilder.addBool(8, true); | 3141 fbBuilder.addBool(8, true); |
| 3142 } | 3142 } |
| 3143 if (_isConst == true) { | 3143 if (_isConst == true) { |
| 3144 fbBuilder.addBool(9, true); | 3144 fbBuilder.addBool(9, true); |
| 3145 } | 3145 } |
| 3146 if (_isFactory == true) { | 3146 if (_isFactory == true) { |
| 3147 fbBuilder.addBool(10, true); | 3147 fbBuilder.addBool(10, true); |
| 3148 } | 3148 } |
| 3149 if (_hasImplicitReturnType == true) { | 3149 if (_isExternal == true) { |
| 3150 fbBuilder.addBool(11, true); | 3150 fbBuilder.addBool(11, true); |
| 3151 } | 3151 } |
| 3152 if (_isExternal == true) { | |
| 3153 fbBuilder.addBool(12, true); | |
| 3154 } | |
| 3155 return fbBuilder.endTable(); | 3152 return fbBuilder.endTable(); |
| 3156 } | 3153 } |
| 3157 } | 3154 } |
| 3158 | 3155 |
| 3159 /** | 3156 /** |
| 3160 * Unlinked summary information about a function, method, getter, or setter | 3157 * Unlinked summary information about a function, method, getter, or setter |
| 3161 * declaration. | 3158 * declaration. |
| 3162 */ | 3159 */ |
| 3163 abstract class UnlinkedExecutable extends base.SummaryClass { | 3160 abstract class UnlinkedExecutable extends base.SummaryClass { |
| 3164 | 3161 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 3184 UnlinkedDocumentationComment get documentationComment; | 3181 UnlinkedDocumentationComment get documentationComment; |
| 3185 | 3182 |
| 3186 /** | 3183 /** |
| 3187 * Type parameters of the executable, if any. Empty if support for generic | 3184 * Type parameters of the executable, if any. Empty if support for generic |
| 3188 * method syntax is disabled. | 3185 * method syntax is disabled. |
| 3189 */ | 3186 */ |
| 3190 List<UnlinkedTypeParam> get typeParameters; | 3187 List<UnlinkedTypeParam> get typeParameters; |
| 3191 | 3188 |
| 3192 /** | 3189 /** |
| 3193 * Declared return type of the executable. Absent if the executable is a | 3190 * Declared return type of the executable. Absent if the executable is a |
| 3194 * constructor. Note that when strong mode is enabled, the actual return | 3191 * constructor or the return type is implicit. |
| 3195 * type may be different due to type inference. | |
| 3196 */ | 3192 */ |
| 3197 EntityRef get returnType; | 3193 EntityRef get returnType; |
| 3198 | 3194 |
| 3199 /** | 3195 /** |
| 3200 * Parameters of the executable, if any. Note that getters have no | 3196 * Parameters of the executable, if any. Note that getters have no |
| 3201 * parameters (hence this will be the empty list), and setters have a single | 3197 * parameters (hence this will be the empty list), and setters have a single |
| 3202 * parameter. | 3198 * parameter. |
| 3203 */ | 3199 */ |
| 3204 List<UnlinkedParam> get parameters; | 3200 List<UnlinkedParam> get parameters; |
| 3205 | 3201 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 3227 * Indicates whether the executable is declared using the `const` keyword. | 3223 * Indicates whether the executable is declared using the `const` keyword. |
| 3228 */ | 3224 */ |
| 3229 bool get isConst; | 3225 bool get isConst; |
| 3230 | 3226 |
| 3231 /** | 3227 /** |
| 3232 * Indicates whether the executable is declared using the `factory` keyword. | 3228 * Indicates whether the executable is declared using the `factory` keyword. |
| 3233 */ | 3229 */ |
| 3234 bool get isFactory; | 3230 bool get isFactory; |
| 3235 | 3231 |
| 3236 /** | 3232 /** |
| 3237 * Indicates whether the executable lacks an explicit return type | |
| 3238 * declaration. False for constructors and setters. | |
| 3239 */ | |
| 3240 bool get hasImplicitReturnType; | |
| 3241 | |
| 3242 /** | |
| 3243 * Indicates whether the executable is declared using the `external` keyword. | 3233 * Indicates whether the executable is declared using the `external` keyword. |
| 3244 */ | 3234 */ |
| 3245 bool get isExternal; | 3235 bool get isExternal; |
| 3246 } | 3236 } |
| 3247 | 3237 |
| 3248 class _UnlinkedExecutableReader extends fb.TableReader<_UnlinkedExecutableImpl>
{ | 3238 class _UnlinkedExecutableReader extends fb.TableReader<_UnlinkedExecutableImpl>
{ |
| 3249 const _UnlinkedExecutableReader(); | 3239 const _UnlinkedExecutableReader(); |
| 3250 | 3240 |
| 3251 @override | 3241 @override |
| 3252 _UnlinkedExecutableImpl createObject(fb.BufferPointer bp) => new _UnlinkedExec
utableImpl(bp); | 3242 _UnlinkedExecutableImpl createObject(fb.BufferPointer bp) => new _UnlinkedExec
utableImpl(bp); |
| 3253 } | 3243 } |
| 3254 | 3244 |
| 3255 class _UnlinkedExecutableImpl extends Object with _UnlinkedExecutableMixin imple
ments UnlinkedExecutable { | 3245 class _UnlinkedExecutableImpl extends Object with _UnlinkedExecutableMixin imple
ments UnlinkedExecutable { |
| 3256 final fb.BufferPointer _bp; | 3246 final fb.BufferPointer _bp; |
| 3257 | 3247 |
| 3258 _UnlinkedExecutableImpl(this._bp); | 3248 _UnlinkedExecutableImpl(this._bp); |
| 3259 | 3249 |
| 3260 String _name; | 3250 String _name; |
| 3261 int _nameOffset; | 3251 int _nameOffset; |
| 3262 UnlinkedDocumentationComment _documentationComment; | 3252 UnlinkedDocumentationComment _documentationComment; |
| 3263 List<UnlinkedTypeParam> _typeParameters; | 3253 List<UnlinkedTypeParam> _typeParameters; |
| 3264 EntityRef _returnType; | 3254 EntityRef _returnType; |
| 3265 List<UnlinkedParam> _parameters; | 3255 List<UnlinkedParam> _parameters; |
| 3266 UnlinkedExecutableKind _kind; | 3256 UnlinkedExecutableKind _kind; |
| 3267 bool _isAbstract; | 3257 bool _isAbstract; |
| 3268 bool _isStatic; | 3258 bool _isStatic; |
| 3269 bool _isConst; | 3259 bool _isConst; |
| 3270 bool _isFactory; | 3260 bool _isFactory; |
| 3271 bool _hasImplicitReturnType; | |
| 3272 bool _isExternal; | 3261 bool _isExternal; |
| 3273 | 3262 |
| 3274 @override | 3263 @override |
| 3275 String get name { | 3264 String get name { |
| 3276 _name ??= const fb.StringReader().vTableGet(_bp, 0, ''); | 3265 _name ??= const fb.StringReader().vTableGet(_bp, 0, ''); |
| 3277 return _name; | 3266 return _name; |
| 3278 } | 3267 } |
| 3279 | 3268 |
| 3280 @override | 3269 @override |
| 3281 int get nameOffset { | 3270 int get nameOffset { |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3331 return _isConst; | 3320 return _isConst; |
| 3332 } | 3321 } |
| 3333 | 3322 |
| 3334 @override | 3323 @override |
| 3335 bool get isFactory { | 3324 bool get isFactory { |
| 3336 _isFactory ??= const fb.BoolReader().vTableGet(_bp, 10, false); | 3325 _isFactory ??= const fb.BoolReader().vTableGet(_bp, 10, false); |
| 3337 return _isFactory; | 3326 return _isFactory; |
| 3338 } | 3327 } |
| 3339 | 3328 |
| 3340 @override | 3329 @override |
| 3341 bool get hasImplicitReturnType { | |
| 3342 _hasImplicitReturnType ??= const fb.BoolReader().vTableGet(_bp, 11, false); | |
| 3343 return _hasImplicitReturnType; | |
| 3344 } | |
| 3345 | |
| 3346 @override | |
| 3347 bool get isExternal { | 3330 bool get isExternal { |
| 3348 _isExternal ??= const fb.BoolReader().vTableGet(_bp, 12, false); | 3331 _isExternal ??= const fb.BoolReader().vTableGet(_bp, 11, false); |
| 3349 return _isExternal; | 3332 return _isExternal; |
| 3350 } | 3333 } |
| 3351 } | 3334 } |
| 3352 | 3335 |
| 3353 abstract class _UnlinkedExecutableMixin implements UnlinkedExecutable { | 3336 abstract class _UnlinkedExecutableMixin implements UnlinkedExecutable { |
| 3354 @override | 3337 @override |
| 3355 Map<String, Object> toMap() => { | 3338 Map<String, Object> toMap() => { |
| 3356 "name": name, | 3339 "name": name, |
| 3357 "nameOffset": nameOffset, | 3340 "nameOffset": nameOffset, |
| 3358 "documentationComment": documentationComment, | 3341 "documentationComment": documentationComment, |
| 3359 "typeParameters": typeParameters, | 3342 "typeParameters": typeParameters, |
| 3360 "returnType": returnType, | 3343 "returnType": returnType, |
| 3361 "parameters": parameters, | 3344 "parameters": parameters, |
| 3362 "kind": kind, | 3345 "kind": kind, |
| 3363 "isAbstract": isAbstract, | 3346 "isAbstract": isAbstract, |
| 3364 "isStatic": isStatic, | 3347 "isStatic": isStatic, |
| 3365 "isConst": isConst, | 3348 "isConst": isConst, |
| 3366 "isFactory": isFactory, | 3349 "isFactory": isFactory, |
| 3367 "hasImplicitReturnType": hasImplicitReturnType, | |
| 3368 "isExternal": isExternal, | 3350 "isExternal": isExternal, |
| 3369 }; | 3351 }; |
| 3370 } | 3352 } |
| 3371 | 3353 |
| 3372 class UnlinkedExportNonPublicBuilder extends Object with _UnlinkedExportNonPubli
cMixin implements UnlinkedExportNonPublic { | 3354 class UnlinkedExportNonPublicBuilder extends Object with _UnlinkedExportNonPubli
cMixin implements UnlinkedExportNonPublic { |
| 3373 bool _finished = false; | 3355 bool _finished = false; |
| 3374 | 3356 |
| 3375 int _offset; | 3357 int _offset; |
| 3376 int _uriOffset; | 3358 int _uriOffset; |
| 3377 int _uriEnd; | 3359 int _uriEnd; |
| (...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3942 class UnlinkedParamBuilder extends Object with _UnlinkedParamMixin implements Un
linkedParam { | 3924 class UnlinkedParamBuilder extends Object with _UnlinkedParamMixin implements Un
linkedParam { |
| 3943 bool _finished = false; | 3925 bool _finished = false; |
| 3944 | 3926 |
| 3945 String _name; | 3927 String _name; |
| 3946 int _nameOffset; | 3928 int _nameOffset; |
| 3947 EntityRefBuilder _type; | 3929 EntityRefBuilder _type; |
| 3948 List<UnlinkedParamBuilder> _parameters; | 3930 List<UnlinkedParamBuilder> _parameters; |
| 3949 UnlinkedParamKind _kind; | 3931 UnlinkedParamKind _kind; |
| 3950 bool _isFunctionTyped; | 3932 bool _isFunctionTyped; |
| 3951 bool _isInitializingFormal; | 3933 bool _isInitializingFormal; |
| 3952 bool _hasImplicitType; | |
| 3953 | 3934 |
| 3954 @override | 3935 @override |
| 3955 String get name => _name ??= ''; | 3936 String get name => _name ??= ''; |
| 3956 | 3937 |
| 3957 /** | 3938 /** |
| 3958 * Name of the parameter. | 3939 * Name of the parameter. |
| 3959 */ | 3940 */ |
| 3960 void set name(String _value) { | 3941 void set name(String _value) { |
| 3961 assert(!_finished); | 3942 assert(!_finished); |
| 3962 _name = _value; | 3943 _name = _value; |
| 3963 } | 3944 } |
| 3964 | 3945 |
| 3965 @override | 3946 @override |
| 3966 int get nameOffset => _nameOffset ??= 0; | 3947 int get nameOffset => _nameOffset ??= 0; |
| 3967 | 3948 |
| 3968 /** | 3949 /** |
| 3969 * Offset of the parameter name relative to the beginning of the file. | 3950 * Offset of the parameter name relative to the beginning of the file. |
| 3970 */ | 3951 */ |
| 3971 void set nameOffset(int _value) { | 3952 void set nameOffset(int _value) { |
| 3972 assert(!_finished); | 3953 assert(!_finished); |
| 3973 assert(_value == null || _value >= 0); | 3954 assert(_value == null || _value >= 0); |
| 3974 _nameOffset = _value; | 3955 _nameOffset = _value; |
| 3975 } | 3956 } |
| 3976 | 3957 |
| 3977 @override | 3958 @override |
| 3978 EntityRefBuilder get type => _type; | 3959 EntityRefBuilder get type => _type; |
| 3979 | 3960 |
| 3980 /** | 3961 /** |
| 3981 * If [isFunctionTyped] is `true`, the declared return type. If | 3962 * If [isFunctionTyped] is `true`, the declared return type. If |
| 3982 * [isFunctionTyped] is `false`, the declared type. | 3963 * [isFunctionTyped] is `false`, the declared type. Absent if the type is |
| 3964 * implicit. |
| 3983 */ | 3965 */ |
| 3984 void set type(EntityRefBuilder _value) { | 3966 void set type(EntityRefBuilder _value) { |
| 3985 assert(!_finished); | 3967 assert(!_finished); |
| 3986 _type = _value; | 3968 _type = _value; |
| 3987 } | 3969 } |
| 3988 | 3970 |
| 3989 @override | 3971 @override |
| 3990 List<UnlinkedParamBuilder> get parameters => _parameters ??= <UnlinkedParamBui
lder>[]; | 3972 List<UnlinkedParamBuilder> get parameters => _parameters ??= <UnlinkedParamBui
lder>[]; |
| 3991 | 3973 |
| 3992 /** | 3974 /** |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4024 | 4006 |
| 4025 /** | 4007 /** |
| 4026 * Indicates whether this is an initializing formal parameter (i.e. it is | 4008 * Indicates whether this is an initializing formal parameter (i.e. it is |
| 4027 * declared using `this.` syntax). | 4009 * declared using `this.` syntax). |
| 4028 */ | 4010 */ |
| 4029 void set isInitializingFormal(bool _value) { | 4011 void set isInitializingFormal(bool _value) { |
| 4030 assert(!_finished); | 4012 assert(!_finished); |
| 4031 _isInitializingFormal = _value; | 4013 _isInitializingFormal = _value; |
| 4032 } | 4014 } |
| 4033 | 4015 |
| 4034 @override | 4016 UnlinkedParamBuilder({String name, int nameOffset, EntityRefBuilder type, List
<UnlinkedParamBuilder> parameters, UnlinkedParamKind kind, bool isFunctionTyped,
bool isInitializingFormal}) |
| 4035 bool get hasImplicitType => _hasImplicitType ??= false; | |
| 4036 | |
| 4037 /** | |
| 4038 * Indicates whether this parameter lacks an explicit type declaration. | |
| 4039 * Always false for a function-typed parameter. | |
| 4040 */ | |
| 4041 void set hasImplicitType(bool _value) { | |
| 4042 assert(!_finished); | |
| 4043 _hasImplicitType = _value; | |
| 4044 } | |
| 4045 | |
| 4046 UnlinkedParamBuilder({String name, int nameOffset, EntityRefBuilder type, List
<UnlinkedParamBuilder> parameters, UnlinkedParamKind kind, bool isFunctionTyped,
bool isInitializingFormal, bool hasImplicitType}) | |
| 4047 : _name = name, | 4017 : _name = name, |
| 4048 _nameOffset = nameOffset, | 4018 _nameOffset = nameOffset, |
| 4049 _type = type, | 4019 _type = type, |
| 4050 _parameters = parameters, | 4020 _parameters = parameters, |
| 4051 _kind = kind, | 4021 _kind = kind, |
| 4052 _isFunctionTyped = isFunctionTyped, | 4022 _isFunctionTyped = isFunctionTyped, |
| 4053 _isInitializingFormal = isInitializingFormal, | 4023 _isInitializingFormal = isInitializingFormal; |
| 4054 _hasImplicitType = hasImplicitType; | |
| 4055 | 4024 |
| 4056 fb.Offset finish(fb.Builder fbBuilder) { | 4025 fb.Offset finish(fb.Builder fbBuilder) { |
| 4057 assert(!_finished); | 4026 assert(!_finished); |
| 4058 _finished = true; | 4027 _finished = true; |
| 4059 fb.Offset offset_name; | 4028 fb.Offset offset_name; |
| 4060 fb.Offset offset_type; | 4029 fb.Offset offset_type; |
| 4061 fb.Offset offset_parameters; | 4030 fb.Offset offset_parameters; |
| 4062 if (_name != null) { | 4031 if (_name != null) { |
| 4063 offset_name = fbBuilder.writeString(_name); | 4032 offset_name = fbBuilder.writeString(_name); |
| 4064 } | 4033 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 4083 } | 4052 } |
| 4084 if (_kind != null && _kind != UnlinkedParamKind.required) { | 4053 if (_kind != null && _kind != UnlinkedParamKind.required) { |
| 4085 fbBuilder.addUint32(4, _kind.index); | 4054 fbBuilder.addUint32(4, _kind.index); |
| 4086 } | 4055 } |
| 4087 if (_isFunctionTyped == true) { | 4056 if (_isFunctionTyped == true) { |
| 4088 fbBuilder.addBool(5, true); | 4057 fbBuilder.addBool(5, true); |
| 4089 } | 4058 } |
| 4090 if (_isInitializingFormal == true) { | 4059 if (_isInitializingFormal == true) { |
| 4091 fbBuilder.addBool(6, true); | 4060 fbBuilder.addBool(6, true); |
| 4092 } | 4061 } |
| 4093 if (_hasImplicitType == true) { | |
| 4094 fbBuilder.addBool(7, true); | |
| 4095 } | |
| 4096 return fbBuilder.endTable(); | 4062 return fbBuilder.endTable(); |
| 4097 } | 4063 } |
| 4098 } | 4064 } |
| 4099 | 4065 |
| 4100 /** | 4066 /** |
| 4101 * Unlinked summary information about a function parameter. | 4067 * Unlinked summary information about a function parameter. |
| 4102 */ | 4068 */ |
| 4103 abstract class UnlinkedParam extends base.SummaryClass { | 4069 abstract class UnlinkedParam extends base.SummaryClass { |
| 4104 | 4070 |
| 4105 /** | 4071 /** |
| 4106 * Name of the parameter. | 4072 * Name of the parameter. |
| 4107 */ | 4073 */ |
| 4108 String get name; | 4074 String get name; |
| 4109 | 4075 |
| 4110 /** | 4076 /** |
| 4111 * Offset of the parameter name relative to the beginning of the file. | 4077 * Offset of the parameter name relative to the beginning of the file. |
| 4112 */ | 4078 */ |
| 4113 int get nameOffset; | 4079 int get nameOffset; |
| 4114 | 4080 |
| 4115 /** | 4081 /** |
| 4116 * If [isFunctionTyped] is `true`, the declared return type. If | 4082 * If [isFunctionTyped] is `true`, the declared return type. If |
| 4117 * [isFunctionTyped] is `false`, the declared type. | 4083 * [isFunctionTyped] is `false`, the declared type. Absent if the type is |
| 4084 * implicit. |
| 4118 */ | 4085 */ |
| 4119 EntityRef get type; | 4086 EntityRef get type; |
| 4120 | 4087 |
| 4121 /** | 4088 /** |
| 4122 * If [isFunctionTyped] is `true`, the parameters of the function type. | 4089 * If [isFunctionTyped] is `true`, the parameters of the function type. |
| 4123 */ | 4090 */ |
| 4124 List<UnlinkedParam> get parameters; | 4091 List<UnlinkedParam> get parameters; |
| 4125 | 4092 |
| 4126 /** | 4093 /** |
| 4127 * Kind of the parameter. | 4094 * Kind of the parameter. |
| 4128 */ | 4095 */ |
| 4129 UnlinkedParamKind get kind; | 4096 UnlinkedParamKind get kind; |
| 4130 | 4097 |
| 4131 /** | 4098 /** |
| 4132 * Indicates whether this is a function-typed parameter. | 4099 * Indicates whether this is a function-typed parameter. |
| 4133 */ | 4100 */ |
| 4134 bool get isFunctionTyped; | 4101 bool get isFunctionTyped; |
| 4135 | 4102 |
| 4136 /** | 4103 /** |
| 4137 * Indicates whether this is an initializing formal parameter (i.e. it is | 4104 * Indicates whether this is an initializing formal parameter (i.e. it is |
| 4138 * declared using `this.` syntax). | 4105 * declared using `this.` syntax). |
| 4139 */ | 4106 */ |
| 4140 bool get isInitializingFormal; | 4107 bool get isInitializingFormal; |
| 4141 | |
| 4142 /** | |
| 4143 * Indicates whether this parameter lacks an explicit type declaration. | |
| 4144 * Always false for a function-typed parameter. | |
| 4145 */ | |
| 4146 bool get hasImplicitType; | |
| 4147 } | 4108 } |
| 4148 | 4109 |
| 4149 class _UnlinkedParamReader extends fb.TableReader<_UnlinkedParamImpl> { | 4110 class _UnlinkedParamReader extends fb.TableReader<_UnlinkedParamImpl> { |
| 4150 const _UnlinkedParamReader(); | 4111 const _UnlinkedParamReader(); |
| 4151 | 4112 |
| 4152 @override | 4113 @override |
| 4153 _UnlinkedParamImpl createObject(fb.BufferPointer bp) => new _UnlinkedParamImpl
(bp); | 4114 _UnlinkedParamImpl createObject(fb.BufferPointer bp) => new _UnlinkedParamImpl
(bp); |
| 4154 } | 4115 } |
| 4155 | 4116 |
| 4156 class _UnlinkedParamImpl extends Object with _UnlinkedParamMixin implements Unli
nkedParam { | 4117 class _UnlinkedParamImpl extends Object with _UnlinkedParamMixin implements Unli
nkedParam { |
| 4157 final fb.BufferPointer _bp; | 4118 final fb.BufferPointer _bp; |
| 4158 | 4119 |
| 4159 _UnlinkedParamImpl(this._bp); | 4120 _UnlinkedParamImpl(this._bp); |
| 4160 | 4121 |
| 4161 String _name; | 4122 String _name; |
| 4162 int _nameOffset; | 4123 int _nameOffset; |
| 4163 EntityRef _type; | 4124 EntityRef _type; |
| 4164 List<UnlinkedParam> _parameters; | 4125 List<UnlinkedParam> _parameters; |
| 4165 UnlinkedParamKind _kind; | 4126 UnlinkedParamKind _kind; |
| 4166 bool _isFunctionTyped; | 4127 bool _isFunctionTyped; |
| 4167 bool _isInitializingFormal; | 4128 bool _isInitializingFormal; |
| 4168 bool _hasImplicitType; | |
| 4169 | 4129 |
| 4170 @override | 4130 @override |
| 4171 String get name { | 4131 String get name { |
| 4172 _name ??= const fb.StringReader().vTableGet(_bp, 0, ''); | 4132 _name ??= const fb.StringReader().vTableGet(_bp, 0, ''); |
| 4173 return _name; | 4133 return _name; |
| 4174 } | 4134 } |
| 4175 | 4135 |
| 4176 @override | 4136 @override |
| 4177 int get nameOffset { | 4137 int get nameOffset { |
| 4178 _nameOffset ??= const fb.Uint32Reader().vTableGet(_bp, 1, 0); | 4138 _nameOffset ??= const fb.Uint32Reader().vTableGet(_bp, 1, 0); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 4201 bool get isFunctionTyped { | 4161 bool get isFunctionTyped { |
| 4202 _isFunctionTyped ??= const fb.BoolReader().vTableGet(_bp, 5, false); | 4162 _isFunctionTyped ??= const fb.BoolReader().vTableGet(_bp, 5, false); |
| 4203 return _isFunctionTyped; | 4163 return _isFunctionTyped; |
| 4204 } | 4164 } |
| 4205 | 4165 |
| 4206 @override | 4166 @override |
| 4207 bool get isInitializingFormal { | 4167 bool get isInitializingFormal { |
| 4208 _isInitializingFormal ??= const fb.BoolReader().vTableGet(_bp, 6, false); | 4168 _isInitializingFormal ??= const fb.BoolReader().vTableGet(_bp, 6, false); |
| 4209 return _isInitializingFormal; | 4169 return _isInitializingFormal; |
| 4210 } | 4170 } |
| 4211 | |
| 4212 @override | |
| 4213 bool get hasImplicitType { | |
| 4214 _hasImplicitType ??= const fb.BoolReader().vTableGet(_bp, 7, false); | |
| 4215 return _hasImplicitType; | |
| 4216 } | |
| 4217 } | 4171 } |
| 4218 | 4172 |
| 4219 abstract class _UnlinkedParamMixin implements UnlinkedParam { | 4173 abstract class _UnlinkedParamMixin implements UnlinkedParam { |
| 4220 @override | 4174 @override |
| 4221 Map<String, Object> toMap() => { | 4175 Map<String, Object> toMap() => { |
| 4222 "name": name, | 4176 "name": name, |
| 4223 "nameOffset": nameOffset, | 4177 "nameOffset": nameOffset, |
| 4224 "type": type, | 4178 "type": type, |
| 4225 "parameters": parameters, | 4179 "parameters": parameters, |
| 4226 "kind": kind, | 4180 "kind": kind, |
| 4227 "isFunctionTyped": isFunctionTyped, | 4181 "isFunctionTyped": isFunctionTyped, |
| 4228 "isInitializingFormal": isInitializingFormal, | 4182 "isInitializingFormal": isInitializingFormal, |
| 4229 "hasImplicitType": hasImplicitType, | |
| 4230 }; | 4183 }; |
| 4231 } | 4184 } |
| 4232 | 4185 |
| 4233 class UnlinkedPartBuilder extends Object with _UnlinkedPartMixin implements Unli
nkedPart { | 4186 class UnlinkedPartBuilder extends Object with _UnlinkedPartMixin implements Unli
nkedPart { |
| 4234 bool _finished = false; | 4187 bool _finished = false; |
| 4235 | 4188 |
| 4236 int _uriOffset; | 4189 int _uriOffset; |
| 4237 int _uriEnd; | 4190 int _uriEnd; |
| 4238 | 4191 |
| 4239 @override | 4192 @override |
| (...skipping 1411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5651 bool _finished = false; | 5604 bool _finished = false; |
| 5652 | 5605 |
| 5653 String _name; | 5606 String _name; |
| 5654 int _nameOffset; | 5607 int _nameOffset; |
| 5655 UnlinkedDocumentationCommentBuilder _documentationComment; | 5608 UnlinkedDocumentationCommentBuilder _documentationComment; |
| 5656 EntityRefBuilder _type; | 5609 EntityRefBuilder _type; |
| 5657 UnlinkedConstBuilder _constExpr; | 5610 UnlinkedConstBuilder _constExpr; |
| 5658 bool _isStatic; | 5611 bool _isStatic; |
| 5659 bool _isFinal; | 5612 bool _isFinal; |
| 5660 bool _isConst; | 5613 bool _isConst; |
| 5661 bool _hasImplicitType; | |
| 5662 int _propagatedTypeSlot; | 5614 int _propagatedTypeSlot; |
| 5663 | 5615 |
| 5664 @override | 5616 @override |
| 5665 String get name => _name ??= ''; | 5617 String get name => _name ??= ''; |
| 5666 | 5618 |
| 5667 /** | 5619 /** |
| 5668 * Name of the variable. | 5620 * Name of the variable. |
| 5669 */ | 5621 */ |
| 5670 void set name(String _value) { | 5622 void set name(String _value) { |
| 5671 assert(!_finished); | 5623 assert(!_finished); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 5693 */ | 5645 */ |
| 5694 void set documentationComment(UnlinkedDocumentationCommentBuilder _value) { | 5646 void set documentationComment(UnlinkedDocumentationCommentBuilder _value) { |
| 5695 assert(!_finished); | 5647 assert(!_finished); |
| 5696 _documentationComment = _value; | 5648 _documentationComment = _value; |
| 5697 } | 5649 } |
| 5698 | 5650 |
| 5699 @override | 5651 @override |
| 5700 EntityRefBuilder get type => _type; | 5652 EntityRefBuilder get type => _type; |
| 5701 | 5653 |
| 5702 /** | 5654 /** |
| 5703 * Declared type of the variable. Note that when strong mode is enabled, the | 5655 * Declared type of the variable. Absent if the type is implicit. |
| 5704 * actual type of the variable may be different due to type inference. | |
| 5705 */ | 5656 */ |
| 5706 void set type(EntityRefBuilder _value) { | 5657 void set type(EntityRefBuilder _value) { |
| 5707 assert(!_finished); | 5658 assert(!_finished); |
| 5708 _type = _value; | 5659 _type = _value; |
| 5709 } | 5660 } |
| 5710 | 5661 |
| 5711 @override | 5662 @override |
| 5712 UnlinkedConstBuilder get constExpr => _constExpr; | 5663 UnlinkedConstBuilder get constExpr => _constExpr; |
| 5713 | 5664 |
| 5714 /** | 5665 /** |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5751 | 5702 |
| 5752 /** | 5703 /** |
| 5753 * Indicates whether the variable is declared using the `const` keyword. | 5704 * Indicates whether the variable is declared using the `const` keyword. |
| 5754 */ | 5705 */ |
| 5755 void set isConst(bool _value) { | 5706 void set isConst(bool _value) { |
| 5756 assert(!_finished); | 5707 assert(!_finished); |
| 5757 _isConst = _value; | 5708 _isConst = _value; |
| 5758 } | 5709 } |
| 5759 | 5710 |
| 5760 @override | 5711 @override |
| 5761 bool get hasImplicitType => _hasImplicitType ??= false; | |
| 5762 | |
| 5763 /** | |
| 5764 * Indicates whether this variable lacks an explicit type declaration. | |
| 5765 */ | |
| 5766 void set hasImplicitType(bool _value) { | |
| 5767 assert(!_finished); | |
| 5768 _hasImplicitType = _value; | |
| 5769 } | |
| 5770 | |
| 5771 @override | |
| 5772 int get propagatedTypeSlot => _propagatedTypeSlot ??= 0; | 5712 int get propagatedTypeSlot => _propagatedTypeSlot ??= 0; |
| 5773 | 5713 |
| 5774 /** | 5714 /** |
| 5775 * If this variable is propagable, nonzero slot id identifying which entry in | 5715 * If this variable is propagable, nonzero slot id identifying which entry in |
| 5776 * [LinkedLibrary.types] contains the propagated type for this variable. If | 5716 * [LinkedLibrary.types] contains the propagated type for this variable. If |
| 5777 * there is no matching entry in [LinkedLibrary.types], then this variable's | 5717 * there is no matching entry in [LinkedLibrary.types], then this variable's |
| 5778 * propagated type is the same as its declared type. | 5718 * propagated type is the same as its declared type. |
| 5779 * | 5719 * |
| 5780 * Non-propagable variables have a [propagatedTypeSlot] of zero. | 5720 * Non-propagable variables have a [propagatedTypeSlot] of zero. |
| 5781 */ | 5721 */ |
| 5782 void set propagatedTypeSlot(int _value) { | 5722 void set propagatedTypeSlot(int _value) { |
| 5783 assert(!_finished); | 5723 assert(!_finished); |
| 5784 assert(_value == null || _value >= 0); | 5724 assert(_value == null || _value >= 0); |
| 5785 _propagatedTypeSlot = _value; | 5725 _propagatedTypeSlot = _value; |
| 5786 } | 5726 } |
| 5787 | 5727 |
| 5788 UnlinkedVariableBuilder({String name, int nameOffset, UnlinkedDocumentationCom
mentBuilder documentationComment, EntityRefBuilder type, UnlinkedConstBuilder co
nstExpr, bool isStatic, bool isFinal, bool isConst, bool hasImplicitType, int pr
opagatedTypeSlot}) | 5728 UnlinkedVariableBuilder({String name, int nameOffset, UnlinkedDocumentationCom
mentBuilder documentationComment, EntityRefBuilder type, UnlinkedConstBuilder co
nstExpr, bool isStatic, bool isFinal, bool isConst, int propagatedTypeSlot}) |
| 5789 : _name = name, | 5729 : _name = name, |
| 5790 _nameOffset = nameOffset, | 5730 _nameOffset = nameOffset, |
| 5791 _documentationComment = documentationComment, | 5731 _documentationComment = documentationComment, |
| 5792 _type = type, | 5732 _type = type, |
| 5793 _constExpr = constExpr, | 5733 _constExpr = constExpr, |
| 5794 _isStatic = isStatic, | 5734 _isStatic = isStatic, |
| 5795 _isFinal = isFinal, | 5735 _isFinal = isFinal, |
| 5796 _isConst = isConst, | 5736 _isConst = isConst, |
| 5797 _hasImplicitType = hasImplicitType, | |
| 5798 _propagatedTypeSlot = propagatedTypeSlot; | 5737 _propagatedTypeSlot = propagatedTypeSlot; |
| 5799 | 5738 |
| 5800 fb.Offset finish(fb.Builder fbBuilder) { | 5739 fb.Offset finish(fb.Builder fbBuilder) { |
| 5801 assert(!_finished); | 5740 assert(!_finished); |
| 5802 _finished = true; | 5741 _finished = true; |
| 5803 fb.Offset offset_name; | 5742 fb.Offset offset_name; |
| 5804 fb.Offset offset_documentationComment; | 5743 fb.Offset offset_documentationComment; |
| 5805 fb.Offset offset_type; | 5744 fb.Offset offset_type; |
| 5806 fb.Offset offset_constExpr; | 5745 fb.Offset offset_constExpr; |
| 5807 if (_name != null) { | 5746 if (_name != null) { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 5834 } | 5773 } |
| 5835 if (_isStatic == true) { | 5774 if (_isStatic == true) { |
| 5836 fbBuilder.addBool(5, true); | 5775 fbBuilder.addBool(5, true); |
| 5837 } | 5776 } |
| 5838 if (_isFinal == true) { | 5777 if (_isFinal == true) { |
| 5839 fbBuilder.addBool(6, true); | 5778 fbBuilder.addBool(6, true); |
| 5840 } | 5779 } |
| 5841 if (_isConst == true) { | 5780 if (_isConst == true) { |
| 5842 fbBuilder.addBool(7, true); | 5781 fbBuilder.addBool(7, true); |
| 5843 } | 5782 } |
| 5844 if (_hasImplicitType == true) { | |
| 5845 fbBuilder.addBool(8, true); | |
| 5846 } | |
| 5847 if (_propagatedTypeSlot != null && _propagatedTypeSlot != 0) { | 5783 if (_propagatedTypeSlot != null && _propagatedTypeSlot != 0) { |
| 5848 fbBuilder.addUint32(9, _propagatedTypeSlot); | 5784 fbBuilder.addUint32(8, _propagatedTypeSlot); |
| 5849 } | 5785 } |
| 5850 return fbBuilder.endTable(); | 5786 return fbBuilder.endTable(); |
| 5851 } | 5787 } |
| 5852 } | 5788 } |
| 5853 | 5789 |
| 5854 /** | 5790 /** |
| 5855 * Unlinked summary information about a top level variable, local variable, or | 5791 * Unlinked summary information about a top level variable, local variable, or |
| 5856 * a field. | 5792 * a field. |
| 5857 */ | 5793 */ |
| 5858 abstract class UnlinkedVariable extends base.SummaryClass { | 5794 abstract class UnlinkedVariable extends base.SummaryClass { |
| 5859 | 5795 |
| 5860 /** | 5796 /** |
| 5861 * Name of the variable. | 5797 * Name of the variable. |
| 5862 */ | 5798 */ |
| 5863 String get name; | 5799 String get name; |
| 5864 | 5800 |
| 5865 /** | 5801 /** |
| 5866 * Offset of the variable name relative to the beginning of the file. | 5802 * Offset of the variable name relative to the beginning of the file. |
| 5867 */ | 5803 */ |
| 5868 int get nameOffset; | 5804 int get nameOffset; |
| 5869 | 5805 |
| 5870 /** | 5806 /** |
| 5871 * Documentation comment for the variable, or `null` if there is no | 5807 * Documentation comment for the variable, or `null` if there is no |
| 5872 * documentation comment. | 5808 * documentation comment. |
| 5873 */ | 5809 */ |
| 5874 UnlinkedDocumentationComment get documentationComment; | 5810 UnlinkedDocumentationComment get documentationComment; |
| 5875 | 5811 |
| 5876 /** | 5812 /** |
| 5877 * Declared type of the variable. Note that when strong mode is enabled, the | 5813 * Declared type of the variable. Absent if the type is implicit. |
| 5878 * actual type of the variable may be different due to type inference. | |
| 5879 */ | 5814 */ |
| 5880 EntityRef get type; | 5815 EntityRef get type; |
| 5881 | 5816 |
| 5882 /** | 5817 /** |
| 5883 * If [isConst] is true, and the variable has an initializer, the constant | 5818 * If [isConst] is true, and the variable has an initializer, the constant |
| 5884 * expression in the initializer. | 5819 * expression in the initializer. |
| 5885 */ | 5820 */ |
| 5886 UnlinkedConst get constExpr; | 5821 UnlinkedConst get constExpr; |
| 5887 | 5822 |
| 5888 /** | 5823 /** |
| 5889 * Indicates whether the variable is declared using the `static` keyword. | 5824 * Indicates whether the variable is declared using the `static` keyword. |
| 5890 * | 5825 * |
| 5891 * Note that for top level variables, this flag is false, since they are not | 5826 * Note that for top level variables, this flag is false, since they are not |
| 5892 * declared using the `static` keyword (even though they are considered | 5827 * declared using the `static` keyword (even though they are considered |
| 5893 * static for semantic purposes). | 5828 * static for semantic purposes). |
| 5894 */ | 5829 */ |
| 5895 bool get isStatic; | 5830 bool get isStatic; |
| 5896 | 5831 |
| 5897 /** | 5832 /** |
| 5898 * Indicates whether the variable is declared using the `final` keyword. | 5833 * Indicates whether the variable is declared using the `final` keyword. |
| 5899 */ | 5834 */ |
| 5900 bool get isFinal; | 5835 bool get isFinal; |
| 5901 | 5836 |
| 5902 /** | 5837 /** |
| 5903 * Indicates whether the variable is declared using the `const` keyword. | 5838 * Indicates whether the variable is declared using the `const` keyword. |
| 5904 */ | 5839 */ |
| 5905 bool get isConst; | 5840 bool get isConst; |
| 5906 | 5841 |
| 5907 /** | 5842 /** |
| 5908 * Indicates whether this variable lacks an explicit type declaration. | |
| 5909 */ | |
| 5910 bool get hasImplicitType; | |
| 5911 | |
| 5912 /** | |
| 5913 * If this variable is propagable, nonzero slot id identifying which entry in | 5843 * If this variable is propagable, nonzero slot id identifying which entry in |
| 5914 * [LinkedLibrary.types] contains the propagated type for this variable. If | 5844 * [LinkedLibrary.types] contains the propagated type for this variable. If |
| 5915 * there is no matching entry in [LinkedLibrary.types], then this variable's | 5845 * there is no matching entry in [LinkedLibrary.types], then this variable's |
| 5916 * propagated type is the same as its declared type. | 5846 * propagated type is the same as its declared type. |
| 5917 * | 5847 * |
| 5918 * Non-propagable variables have a [propagatedTypeSlot] of zero. | 5848 * Non-propagable variables have a [propagatedTypeSlot] of zero. |
| 5919 */ | 5849 */ |
| 5920 int get propagatedTypeSlot; | 5850 int get propagatedTypeSlot; |
| 5921 } | 5851 } |
| 5922 | 5852 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 5933 _UnlinkedVariableImpl(this._bp); | 5863 _UnlinkedVariableImpl(this._bp); |
| 5934 | 5864 |
| 5935 String _name; | 5865 String _name; |
| 5936 int _nameOffset; | 5866 int _nameOffset; |
| 5937 UnlinkedDocumentationComment _documentationComment; | 5867 UnlinkedDocumentationComment _documentationComment; |
| 5938 EntityRef _type; | 5868 EntityRef _type; |
| 5939 UnlinkedConst _constExpr; | 5869 UnlinkedConst _constExpr; |
| 5940 bool _isStatic; | 5870 bool _isStatic; |
| 5941 bool _isFinal; | 5871 bool _isFinal; |
| 5942 bool _isConst; | 5872 bool _isConst; |
| 5943 bool _hasImplicitType; | |
| 5944 int _propagatedTypeSlot; | 5873 int _propagatedTypeSlot; |
| 5945 | 5874 |
| 5946 @override | 5875 @override |
| 5947 String get name { | 5876 String get name { |
| 5948 _name ??= const fb.StringReader().vTableGet(_bp, 0, ''); | 5877 _name ??= const fb.StringReader().vTableGet(_bp, 0, ''); |
| 5949 return _name; | 5878 return _name; |
| 5950 } | 5879 } |
| 5951 | 5880 |
| 5952 @override | 5881 @override |
| 5953 int get nameOffset { | 5882 int get nameOffset { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5985 return _isFinal; | 5914 return _isFinal; |
| 5986 } | 5915 } |
| 5987 | 5916 |
| 5988 @override | 5917 @override |
| 5989 bool get isConst { | 5918 bool get isConst { |
| 5990 _isConst ??= const fb.BoolReader().vTableGet(_bp, 7, false); | 5919 _isConst ??= const fb.BoolReader().vTableGet(_bp, 7, false); |
| 5991 return _isConst; | 5920 return _isConst; |
| 5992 } | 5921 } |
| 5993 | 5922 |
| 5994 @override | 5923 @override |
| 5995 bool get hasImplicitType { | |
| 5996 _hasImplicitType ??= const fb.BoolReader().vTableGet(_bp, 8, false); | |
| 5997 return _hasImplicitType; | |
| 5998 } | |
| 5999 | |
| 6000 @override | |
| 6001 int get propagatedTypeSlot { | 5924 int get propagatedTypeSlot { |
| 6002 _propagatedTypeSlot ??= const fb.Uint32Reader().vTableGet(_bp, 9, 0); | 5925 _propagatedTypeSlot ??= const fb.Uint32Reader().vTableGet(_bp, 8, 0); |
| 6003 return _propagatedTypeSlot; | 5926 return _propagatedTypeSlot; |
| 6004 } | 5927 } |
| 6005 } | 5928 } |
| 6006 | 5929 |
| 6007 abstract class _UnlinkedVariableMixin implements UnlinkedVariable { | 5930 abstract class _UnlinkedVariableMixin implements UnlinkedVariable { |
| 6008 @override | 5931 @override |
| 6009 Map<String, Object> toMap() => { | 5932 Map<String, Object> toMap() => { |
| 6010 "name": name, | 5933 "name": name, |
| 6011 "nameOffset": nameOffset, | 5934 "nameOffset": nameOffset, |
| 6012 "documentationComment": documentationComment, | 5935 "documentationComment": documentationComment, |
| 6013 "type": type, | 5936 "type": type, |
| 6014 "constExpr": constExpr, | 5937 "constExpr": constExpr, |
| 6015 "isStatic": isStatic, | 5938 "isStatic": isStatic, |
| 6016 "isFinal": isFinal, | 5939 "isFinal": isFinal, |
| 6017 "isConst": isConst, | 5940 "isConst": isConst, |
| 6018 "hasImplicitType": hasImplicitType, | |
| 6019 "propagatedTypeSlot": propagatedTypeSlot, | 5941 "propagatedTypeSlot": propagatedTypeSlot, |
| 6020 }; | 5942 }; |
| 6021 } | 5943 } |
| 6022 | 5944 |
| OLD | NEW |