Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(407)

Side by Side Diff: pkg/analyzer/lib/src/summary/format.dart

Issue 2010993002: Migrate UnlinkedParam.defaultValue to UnlinkedExecutable.bodyExpr. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/analyzer/lib/src/dart/element/element.dart ('k') | pkg/analyzer/lib/src/summary/format.fbs » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 'flat_buffers.dart' as fb; 10 import 'flat_buffers.dart' as fb;
(...skipping 5907 matching lines...) Expand 10 before | Expand all | Expand 10 after
5918 5918
5919 @override 5919 @override
5920 String toString() => convert.JSON.encode(toJson()); 5920 String toString() => convert.JSON.encode(toJson());
5921 } 5921 }
5922 5922
5923 class UnlinkedParamBuilder extends Object with _UnlinkedParamMixin implements id l.UnlinkedParam { 5923 class UnlinkedParamBuilder extends Object with _UnlinkedParamMixin implements id l.UnlinkedParam {
5924 bool _finished = false; 5924 bool _finished = false;
5925 5925
5926 List<UnlinkedConstBuilder> _annotations; 5926 List<UnlinkedConstBuilder> _annotations;
5927 CodeRangeBuilder _codeRange; 5927 CodeRangeBuilder _codeRange;
5928 UnlinkedConstBuilder _defaultValue;
5929 String _defaultValueCode; 5928 String _defaultValueCode;
5930 int _inferredTypeSlot; 5929 int _inferredTypeSlot;
5931 UnlinkedExecutableBuilder _initializer; 5930 UnlinkedExecutableBuilder _initializer;
5932 bool _isFunctionTyped; 5931 bool _isFunctionTyped;
5933 bool _isInitializingFormal; 5932 bool _isInitializingFormal;
5934 idl.UnlinkedParamKind _kind; 5933 idl.UnlinkedParamKind _kind;
5935 String _name; 5934 String _name;
5936 int _nameOffset; 5935 int _nameOffset;
5937 List<UnlinkedParamBuilder> _parameters; 5936 List<UnlinkedParamBuilder> _parameters;
5938 EntityRefBuilder _type; 5937 EntityRefBuilder _type;
(...skipping 16 matching lines...) Expand all
5955 5954
5956 /** 5955 /**
5957 * Code range of the parameter. 5956 * Code range of the parameter.
5958 */ 5957 */
5959 void set codeRange(CodeRangeBuilder _value) { 5958 void set codeRange(CodeRangeBuilder _value) {
5960 assert(!_finished); 5959 assert(!_finished);
5961 _codeRange = _value; 5960 _codeRange = _value;
5962 } 5961 }
5963 5962
5964 @override 5963 @override
5965 UnlinkedConstBuilder get defaultValue => _defaultValue;
5966
5967 /**
5968 * If the parameter has a default value, the constant expression in the
5969 * default value. Note that the presence of this expression does not mean
5970 * that it is a valid, check [UnlinkedConst.isInvalid].
5971 */
5972 void set defaultValue(UnlinkedConstBuilder _value) {
5973 assert(!_finished);
5974 _defaultValue = _value;
5975 }
5976
5977 @override
5978 String get defaultValueCode => _defaultValueCode ??= ''; 5964 String get defaultValueCode => _defaultValueCode ??= '';
5979 5965
5980 /** 5966 /**
5981 * If the parameter has a default value, the source text of the constant 5967 * If the parameter has a default value, the source text of the constant
5982 * expression in the default value. Otherwise the empty string. 5968 * expression in the default value. Otherwise the empty string.
5983 */ 5969 */
5984 void set defaultValueCode(String _value) { 5970 void set defaultValueCode(String _value) {
5985 assert(!_finished); 5971 assert(!_finished);
5986 _defaultValueCode = _value; 5972 _defaultValueCode = _value;
5987 } 5973 }
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
6116 6102
6117 /** 6103 /**
6118 * The beginning of the visible range. 6104 * The beginning of the visible range.
6119 */ 6105 */
6120 void set visibleOffset(int _value) { 6106 void set visibleOffset(int _value) {
6121 assert(!_finished); 6107 assert(!_finished);
6122 assert(_value == null || _value >= 0); 6108 assert(_value == null || _value >= 0);
6123 _visibleOffset = _value; 6109 _visibleOffset = _value;
6124 } 6110 }
6125 6111
6126 UnlinkedParamBuilder({List<UnlinkedConstBuilder> annotations, CodeRangeBuilder codeRange, UnlinkedConstBuilder defaultValue, String defaultValueCode, int infe rredTypeSlot, UnlinkedExecutableBuilder initializer, bool isFunctionTyped, bool isInitializingFormal, idl.UnlinkedParamKind kind, String name, int nameOffset, L ist<UnlinkedParamBuilder> parameters, EntityRefBuilder type, int visibleLength, int visibleOffset}) 6112 UnlinkedParamBuilder({List<UnlinkedConstBuilder> annotations, CodeRangeBuilder codeRange, String defaultValueCode, int inferredTypeSlot, UnlinkedExecutableBui lder initializer, bool isFunctionTyped, bool isInitializingFormal, idl.UnlinkedP aramKind kind, String name, int nameOffset, List<UnlinkedParamBuilder> parameter s, EntityRefBuilder type, int visibleLength, int visibleOffset})
6127 : _annotations = annotations, 6113 : _annotations = annotations,
6128 _codeRange = codeRange, 6114 _codeRange = codeRange,
6129 _defaultValue = defaultValue,
6130 _defaultValueCode = defaultValueCode, 6115 _defaultValueCode = defaultValueCode,
6131 _inferredTypeSlot = inferredTypeSlot, 6116 _inferredTypeSlot = inferredTypeSlot,
6132 _initializer = initializer, 6117 _initializer = initializer,
6133 _isFunctionTyped = isFunctionTyped, 6118 _isFunctionTyped = isFunctionTyped,
6134 _isInitializingFormal = isInitializingFormal, 6119 _isInitializingFormal = isInitializingFormal,
6135 _kind = kind, 6120 _kind = kind,
6136 _name = name, 6121 _name = name,
6137 _nameOffset = nameOffset, 6122 _nameOffset = nameOffset,
6138 _parameters = parameters, 6123 _parameters = parameters,
6139 _type = type, 6124 _type = type,
6140 _visibleLength = visibleLength, 6125 _visibleLength = visibleLength,
6141 _visibleOffset = visibleOffset; 6126 _visibleOffset = visibleOffset;
6142 6127
6143 /** 6128 /**
6144 * Flush [informative] data recursively. 6129 * Flush [informative] data recursively.
6145 */ 6130 */
6146 void flushInformative() { 6131 void flushInformative() {
6147 _annotations?.forEach((b) => b.flushInformative()); 6132 _annotations?.forEach((b) => b.flushInformative());
6148 _codeRange = null; 6133 _codeRange = null;
6149 _defaultValue?.flushInformative();
6150 _defaultValueCode = null; 6134 _defaultValueCode = null;
6151 _initializer?.flushInformative(); 6135 _initializer?.flushInformative();
6152 _nameOffset = null; 6136 _nameOffset = null;
6153 _parameters?.forEach((b) => b.flushInformative()); 6137 _parameters?.forEach((b) => b.flushInformative());
6154 _type?.flushInformative(); 6138 _type?.flushInformative();
6155 } 6139 }
6156 6140
6157 fb.Offset finish(fb.Builder fbBuilder) { 6141 fb.Offset finish(fb.Builder fbBuilder) {
6158 assert(!_finished); 6142 assert(!_finished);
6159 _finished = true; 6143 _finished = true;
6160 fb.Offset offset_annotations; 6144 fb.Offset offset_annotations;
6161 fb.Offset offset_codeRange; 6145 fb.Offset offset_codeRange;
6162 fb.Offset offset_defaultValue;
6163 fb.Offset offset_defaultValueCode; 6146 fb.Offset offset_defaultValueCode;
6164 fb.Offset offset_initializer; 6147 fb.Offset offset_initializer;
6165 fb.Offset offset_name; 6148 fb.Offset offset_name;
6166 fb.Offset offset_parameters; 6149 fb.Offset offset_parameters;
6167 fb.Offset offset_type; 6150 fb.Offset offset_type;
6168 if (!(_annotations == null || _annotations.isEmpty)) { 6151 if (!(_annotations == null || _annotations.isEmpty)) {
6169 offset_annotations = fbBuilder.writeList(_annotations.map((b) => b.finish( fbBuilder)).toList()); 6152 offset_annotations = fbBuilder.writeList(_annotations.map((b) => b.finish( fbBuilder)).toList());
6170 } 6153 }
6171 if (_codeRange != null) { 6154 if (_codeRange != null) {
6172 offset_codeRange = _codeRange.finish(fbBuilder); 6155 offset_codeRange = _codeRange.finish(fbBuilder);
6173 } 6156 }
6174 if (_defaultValue != null) {
6175 offset_defaultValue = _defaultValue.finish(fbBuilder);
6176 }
6177 if (_defaultValueCode != null) { 6157 if (_defaultValueCode != null) {
6178 offset_defaultValueCode = fbBuilder.writeString(_defaultValueCode); 6158 offset_defaultValueCode = fbBuilder.writeString(_defaultValueCode);
6179 } 6159 }
6180 if (_initializer != null) { 6160 if (_initializer != null) {
6181 offset_initializer = _initializer.finish(fbBuilder); 6161 offset_initializer = _initializer.finish(fbBuilder);
6182 } 6162 }
6183 if (_name != null) { 6163 if (_name != null) {
6184 offset_name = fbBuilder.writeString(_name); 6164 offset_name = fbBuilder.writeString(_name);
6185 } 6165 }
6186 if (!(_parameters == null || _parameters.isEmpty)) { 6166 if (!(_parameters == null || _parameters.isEmpty)) {
6187 offset_parameters = fbBuilder.writeList(_parameters.map((b) => b.finish(fb Builder)).toList()); 6167 offset_parameters = fbBuilder.writeList(_parameters.map((b) => b.finish(fb Builder)).toList());
6188 } 6168 }
6189 if (_type != null) { 6169 if (_type != null) {
6190 offset_type = _type.finish(fbBuilder); 6170 offset_type = _type.finish(fbBuilder);
6191 } 6171 }
6192 fbBuilder.startTable(); 6172 fbBuilder.startTable();
6193 if (offset_annotations != null) { 6173 if (offset_annotations != null) {
6194 fbBuilder.addOffset(9, offset_annotations); 6174 fbBuilder.addOffset(9, offset_annotations);
6195 } 6175 }
6196 if (offset_codeRange != null) { 6176 if (offset_codeRange != null) {
6197 fbBuilder.addOffset(14, offset_codeRange); 6177 fbBuilder.addOffset(7, offset_codeRange);
6198 }
6199 if (offset_defaultValue != null) {
6200 fbBuilder.addOffset(7, offset_defaultValue);
6201 } 6178 }
6202 if (offset_defaultValueCode != null) { 6179 if (offset_defaultValueCode != null) {
6203 fbBuilder.addOffset(13, offset_defaultValueCode); 6180 fbBuilder.addOffset(13, offset_defaultValueCode);
6204 } 6181 }
6205 if (_inferredTypeSlot != null && _inferredTypeSlot != 0) { 6182 if (_inferredTypeSlot != null && _inferredTypeSlot != 0) {
6206 fbBuilder.addUint32(2, _inferredTypeSlot); 6183 fbBuilder.addUint32(2, _inferredTypeSlot);
6207 } 6184 }
6208 if (offset_initializer != null) { 6185 if (offset_initializer != null) {
6209 fbBuilder.addOffset(12, offset_initializer); 6186 fbBuilder.addOffset(12, offset_initializer);
6210 } 6187 }
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
6247 } 6224 }
6248 6225
6249 class _UnlinkedParamImpl extends Object with _UnlinkedParamMixin implements idl. UnlinkedParam { 6226 class _UnlinkedParamImpl extends Object with _UnlinkedParamMixin implements idl. UnlinkedParam {
6250 final fb.BufferContext _bc; 6227 final fb.BufferContext _bc;
6251 final int _bcOffset; 6228 final int _bcOffset;
6252 6229
6253 _UnlinkedParamImpl(this._bc, this._bcOffset); 6230 _UnlinkedParamImpl(this._bc, this._bcOffset);
6254 6231
6255 List<idl.UnlinkedConst> _annotations; 6232 List<idl.UnlinkedConst> _annotations;
6256 idl.CodeRange _codeRange; 6233 idl.CodeRange _codeRange;
6257 idl.UnlinkedConst _defaultValue;
6258 String _defaultValueCode; 6234 String _defaultValueCode;
6259 int _inferredTypeSlot; 6235 int _inferredTypeSlot;
6260 idl.UnlinkedExecutable _initializer; 6236 idl.UnlinkedExecutable _initializer;
6261 bool _isFunctionTyped; 6237 bool _isFunctionTyped;
6262 bool _isInitializingFormal; 6238 bool _isInitializingFormal;
6263 idl.UnlinkedParamKind _kind; 6239 idl.UnlinkedParamKind _kind;
6264 String _name; 6240 String _name;
6265 int _nameOffset; 6241 int _nameOffset;
6266 List<idl.UnlinkedParam> _parameters; 6242 List<idl.UnlinkedParam> _parameters;
6267 idl.EntityRef _type; 6243 idl.EntityRef _type;
6268 int _visibleLength; 6244 int _visibleLength;
6269 int _visibleOffset; 6245 int _visibleOffset;
6270 6246
6271 @override 6247 @override
6272 List<idl.UnlinkedConst> get annotations { 6248 List<idl.UnlinkedConst> get annotations {
6273 _annotations ??= const fb.ListReader<idl.UnlinkedConst>(const _UnlinkedConst Reader()).vTableGet(_bc, _bcOffset, 9, const <idl.UnlinkedConst>[]); 6249 _annotations ??= const fb.ListReader<idl.UnlinkedConst>(const _UnlinkedConst Reader()).vTableGet(_bc, _bcOffset, 9, const <idl.UnlinkedConst>[]);
6274 return _annotations; 6250 return _annotations;
6275 } 6251 }
6276 6252
6277 @override 6253 @override
6278 idl.CodeRange get codeRange { 6254 idl.CodeRange get codeRange {
6279 _codeRange ??= const _CodeRangeReader().vTableGet(_bc, _bcOffset, 14, null); 6255 _codeRange ??= const _CodeRangeReader().vTableGet(_bc, _bcOffset, 7, null);
6280 return _codeRange; 6256 return _codeRange;
6281 } 6257 }
6282 6258
6283 @override 6259 @override
6284 idl.UnlinkedConst get defaultValue {
6285 _defaultValue ??= const _UnlinkedConstReader().vTableGet(_bc, _bcOffset, 7, null);
6286 return _defaultValue;
6287 }
6288
6289 @override
6290 String get defaultValueCode { 6260 String get defaultValueCode {
6291 _defaultValueCode ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 13, ''); 6261 _defaultValueCode ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 13, '');
6292 return _defaultValueCode; 6262 return _defaultValueCode;
6293 } 6263 }
6294 6264
6295 @override 6265 @override
6296 int get inferredTypeSlot { 6266 int get inferredTypeSlot {
6297 _inferredTypeSlot ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 2, 0 ); 6267 _inferredTypeSlot ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 2, 0 );
6298 return _inferredTypeSlot; 6268 return _inferredTypeSlot;
6299 } 6269 }
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
6358 return _visibleOffset; 6328 return _visibleOffset;
6359 } 6329 }
6360 } 6330 }
6361 6331
6362 abstract class _UnlinkedParamMixin implements idl.UnlinkedParam { 6332 abstract class _UnlinkedParamMixin implements idl.UnlinkedParam {
6363 @override 6333 @override
6364 Map<String, Object> toJson() { 6334 Map<String, Object> toJson() {
6365 Map<String, Object> _result = <String, Object>{}; 6335 Map<String, Object> _result = <String, Object>{};
6366 if (annotations.isNotEmpty) _result["annotations"] = annotations.map((_value ) => _value.toJson()).toList(); 6336 if (annotations.isNotEmpty) _result["annotations"] = annotations.map((_value ) => _value.toJson()).toList();
6367 if (codeRange != null) _result["codeRange"] = codeRange.toJson(); 6337 if (codeRange != null) _result["codeRange"] = codeRange.toJson();
6368 if (defaultValue != null) _result["defaultValue"] = defaultValue.toJson();
6369 if (defaultValueCode != '') _result["defaultValueCode"] = defaultValueCode; 6338 if (defaultValueCode != '') _result["defaultValueCode"] = defaultValueCode;
6370 if (inferredTypeSlot != 0) _result["inferredTypeSlot"] = inferredTypeSlot; 6339 if (inferredTypeSlot != 0) _result["inferredTypeSlot"] = inferredTypeSlot;
6371 if (initializer != null) _result["initializer"] = initializer.toJson(); 6340 if (initializer != null) _result["initializer"] = initializer.toJson();
6372 if (isFunctionTyped != false) _result["isFunctionTyped"] = isFunctionTyped; 6341 if (isFunctionTyped != false) _result["isFunctionTyped"] = isFunctionTyped;
6373 if (isInitializingFormal != false) _result["isInitializingFormal"] = isIniti alizingFormal; 6342 if (isInitializingFormal != false) _result["isInitializingFormal"] = isIniti alizingFormal;
6374 if (kind != idl.UnlinkedParamKind.required) _result["kind"] = kind.toString( ).split('.')[1]; 6343 if (kind != idl.UnlinkedParamKind.required) _result["kind"] = kind.toString( ).split('.')[1];
6375 if (name != '') _result["name"] = name; 6344 if (name != '') _result["name"] = name;
6376 if (nameOffset != 0) _result["nameOffset"] = nameOffset; 6345 if (nameOffset != 0) _result["nameOffset"] = nameOffset;
6377 if (parameters.isNotEmpty) _result["parameters"] = parameters.map((_value) = > _value.toJson()).toList(); 6346 if (parameters.isNotEmpty) _result["parameters"] = parameters.map((_value) = > _value.toJson()).toList();
6378 if (type != null) _result["type"] = type.toJson(); 6347 if (type != null) _result["type"] = type.toJson();
6379 if (visibleLength != 0) _result["visibleLength"] = visibleLength; 6348 if (visibleLength != 0) _result["visibleLength"] = visibleLength;
6380 if (visibleOffset != 0) _result["visibleOffset"] = visibleOffset; 6349 if (visibleOffset != 0) _result["visibleOffset"] = visibleOffset;
6381 return _result; 6350 return _result;
6382 } 6351 }
6383 6352
6384 @override 6353 @override
6385 Map<String, Object> toMap() => { 6354 Map<String, Object> toMap() => {
6386 "annotations": annotations, 6355 "annotations": annotations,
6387 "codeRange": codeRange, 6356 "codeRange": codeRange,
6388 "defaultValue": defaultValue,
6389 "defaultValueCode": defaultValueCode, 6357 "defaultValueCode": defaultValueCode,
6390 "inferredTypeSlot": inferredTypeSlot, 6358 "inferredTypeSlot": inferredTypeSlot,
6391 "initializer": initializer, 6359 "initializer": initializer,
6392 "isFunctionTyped": isFunctionTyped, 6360 "isFunctionTyped": isFunctionTyped,
6393 "isInitializingFormal": isInitializingFormal, 6361 "isInitializingFormal": isInitializingFormal,
6394 "kind": kind, 6362 "kind": kind,
6395 "name": name, 6363 "name": name,
6396 "nameOffset": nameOffset, 6364 "nameOffset": nameOffset,
6397 "parameters": parameters, 6365 "parameters": parameters,
6398 "type": type, 6366 "type": type,
(...skipping 2072 matching lines...) Expand 10 before | Expand all | Expand 10 after
8471 "propagatedTypeSlot": propagatedTypeSlot, 8439 "propagatedTypeSlot": propagatedTypeSlot,
8472 "type": type, 8440 "type": type,
8473 "visibleLength": visibleLength, 8441 "visibleLength": visibleLength,
8474 "visibleOffset": visibleOffset, 8442 "visibleOffset": visibleOffset,
8475 }; 8443 };
8476 8444
8477 @override 8445 @override
8478 String toString() => convert.JSON.encode(toJson()); 8446 String toString() => convert.JSON.encode(toJson());
8479 } 8447 }
8480 8448
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/dart/element/element.dart ('k') | pkg/analyzer/lib/src/summary/format.fbs » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698