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 'flat_buffers.dart' as fb; | 10 import 'flat_buffers.dart' as fb; |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 @override | 122 @override |
123 int get size => 1; | 123 int get size => 1; |
124 | 124 |
125 @override | 125 @override |
126 idl.UnlinkedParamKind read(fb.BufferContext bc, int offset) { | 126 idl.UnlinkedParamKind read(fb.BufferContext bc, int offset) { |
127 int index = const fb.Uint8Reader().read(bc, offset); | 127 int index = const fb.Uint8Reader().read(bc, offset); |
128 return index < idl.UnlinkedParamKind.values.length ? idl.UnlinkedParamKind.v
alues[index] : idl.UnlinkedParamKind.required; | 128 return index < idl.UnlinkedParamKind.values.length ? idl.UnlinkedParamKind.v
alues[index] : idl.UnlinkedParamKind.required; |
129 } | 129 } |
130 } | 130 } |
131 | 131 |
| 132 class AnalysisDriverResolvedUnitBuilder extends Object with _AnalysisDriverResol
vedUnitMixin implements idl.AnalysisDriverResolvedUnit { |
| 133 List<AnalysisDriverUnitErrorBuilder> _errors; |
| 134 |
| 135 @override |
| 136 List<AnalysisDriverUnitErrorBuilder> get errors => _errors ??= <AnalysisDriver
UnitErrorBuilder>[]; |
| 137 |
| 138 /** |
| 139 * The full list of analysis errors, both syntactic and semantic. |
| 140 */ |
| 141 void set errors(List<AnalysisDriverUnitErrorBuilder> value) { |
| 142 this._errors = value; |
| 143 } |
| 144 |
| 145 AnalysisDriverResolvedUnitBuilder({List<AnalysisDriverUnitErrorBuilder> errors
}) |
| 146 : _errors = errors; |
| 147 |
| 148 /** |
| 149 * Flush [informative] data recursively. |
| 150 */ |
| 151 void flushInformative() { |
| 152 _errors?.forEach((b) => b.flushInformative()); |
| 153 } |
| 154 |
| 155 /** |
| 156 * Accumulate non-[informative] data into [signature]. |
| 157 */ |
| 158 void collectApiSignature(api_sig.ApiSignature signature) { |
| 159 if (this._errors == null) { |
| 160 signature.addInt(0); |
| 161 } else { |
| 162 signature.addInt(this._errors.length); |
| 163 for (var x in this._errors) { |
| 164 x?.collectApiSignature(signature); |
| 165 } |
| 166 } |
| 167 } |
| 168 |
| 169 List<int> toBuffer() { |
| 170 fb.Builder fbBuilder = new fb.Builder(); |
| 171 return fbBuilder.finish(finish(fbBuilder), "ADRU"); |
| 172 } |
| 173 |
| 174 fb.Offset finish(fb.Builder fbBuilder) { |
| 175 fb.Offset offset_errors; |
| 176 if (!(_errors == null || _errors.isEmpty)) { |
| 177 offset_errors = fbBuilder.writeList(_errors.map((b) => b.finish(fbBuilder)
).toList()); |
| 178 } |
| 179 fbBuilder.startTable(); |
| 180 if (offset_errors != null) { |
| 181 fbBuilder.addOffset(0, offset_errors); |
| 182 } |
| 183 return fbBuilder.endTable(); |
| 184 } |
| 185 } |
| 186 |
| 187 idl.AnalysisDriverResolvedUnit readAnalysisDriverResolvedUnit(List<int> buffer)
{ |
| 188 fb.BufferContext rootRef = new fb.BufferContext.fromBytes(buffer); |
| 189 return const _AnalysisDriverResolvedUnitReader().read(rootRef, 0); |
| 190 } |
| 191 |
| 192 class _AnalysisDriverResolvedUnitReader extends fb.TableReader<_AnalysisDriverRe
solvedUnitImpl> { |
| 193 const _AnalysisDriverResolvedUnitReader(); |
| 194 |
| 195 @override |
| 196 _AnalysisDriverResolvedUnitImpl createObject(fb.BufferContext bc, int offset)
=> new _AnalysisDriverResolvedUnitImpl(bc, offset); |
| 197 } |
| 198 |
| 199 class _AnalysisDriverResolvedUnitImpl extends Object with _AnalysisDriverResolve
dUnitMixin implements idl.AnalysisDriverResolvedUnit { |
| 200 final fb.BufferContext _bc; |
| 201 final int _bcOffset; |
| 202 |
| 203 _AnalysisDriverResolvedUnitImpl(this._bc, this._bcOffset); |
| 204 |
| 205 List<idl.AnalysisDriverUnitError> _errors; |
| 206 |
| 207 @override |
| 208 List<idl.AnalysisDriverUnitError> get errors { |
| 209 _errors ??= const fb.ListReader<idl.AnalysisDriverUnitError>(const _Analysis
DriverUnitErrorReader()).vTableGet(_bc, _bcOffset, 0, const <idl.AnalysisDriverU
nitError>[]); |
| 210 return _errors; |
| 211 } |
| 212 } |
| 213 |
| 214 abstract class _AnalysisDriverResolvedUnitMixin implements idl.AnalysisDriverRes
olvedUnit { |
| 215 @override |
| 216 Map<String, Object> toJson() { |
| 217 Map<String, Object> _result = <String, Object>{}; |
| 218 if (errors.isNotEmpty) _result["errors"] = errors.map((_value) => _value.toJ
son()).toList(); |
| 219 return _result; |
| 220 } |
| 221 |
| 222 @override |
| 223 Map<String, Object> toMap() => { |
| 224 "errors": errors, |
| 225 }; |
| 226 |
| 227 @override |
| 228 String toString() => convert.JSON.encode(toJson()); |
| 229 } |
| 230 |
| 231 class AnalysisDriverUnitErrorBuilder extends Object with _AnalysisDriverUnitErro
rMixin implements idl.AnalysisDriverUnitError { |
| 232 String _correction; |
| 233 int _length; |
| 234 String _message; |
| 235 int _offset; |
| 236 String _uniqueName; |
| 237 |
| 238 @override |
| 239 String get correction => _correction ??= ''; |
| 240 |
| 241 /** |
| 242 * The optional correction hint for the error. |
| 243 */ |
| 244 void set correction(String value) { |
| 245 this._correction = value; |
| 246 } |
| 247 |
| 248 @override |
| 249 int get length => _length ??= 0; |
| 250 |
| 251 /** |
| 252 * The length of the error in the file. |
| 253 */ |
| 254 void set length(int value) { |
| 255 assert(value == null || value >= 0); |
| 256 this._length = value; |
| 257 } |
| 258 |
| 259 @override |
| 260 String get message => _message ??= ''; |
| 261 |
| 262 /** |
| 263 * The message of the error. |
| 264 */ |
| 265 void set message(String value) { |
| 266 this._message = value; |
| 267 } |
| 268 |
| 269 @override |
| 270 int get offset => _offset ??= 0; |
| 271 |
| 272 /** |
| 273 * The offset from the beginning of the file. |
| 274 */ |
| 275 void set offset(int value) { |
| 276 assert(value == null || value >= 0); |
| 277 this._offset = value; |
| 278 } |
| 279 |
| 280 @override |
| 281 String get uniqueName => _uniqueName ??= ''; |
| 282 |
| 283 /** |
| 284 * The unique name of the error code. |
| 285 */ |
| 286 void set uniqueName(String value) { |
| 287 this._uniqueName = value; |
| 288 } |
| 289 |
| 290 AnalysisDriverUnitErrorBuilder({String correction, int length, String message,
int offset, String uniqueName}) |
| 291 : _correction = correction, |
| 292 _length = length, |
| 293 _message = message, |
| 294 _offset = offset, |
| 295 _uniqueName = uniqueName; |
| 296 |
| 297 /** |
| 298 * Flush [informative] data recursively. |
| 299 */ |
| 300 void flushInformative() { |
| 301 } |
| 302 |
| 303 /** |
| 304 * Accumulate non-[informative] data into [signature]. |
| 305 */ |
| 306 void collectApiSignature(api_sig.ApiSignature signature) { |
| 307 signature.addInt(this._offset ?? 0); |
| 308 signature.addInt(this._length ?? 0); |
| 309 signature.addString(this._uniqueName ?? ''); |
| 310 signature.addString(this._message ?? ''); |
| 311 signature.addString(this._correction ?? ''); |
| 312 } |
| 313 |
| 314 fb.Offset finish(fb.Builder fbBuilder) { |
| 315 fb.Offset offset_correction; |
| 316 fb.Offset offset_message; |
| 317 fb.Offset offset_uniqueName; |
| 318 if (_correction != null) { |
| 319 offset_correction = fbBuilder.writeString(_correction); |
| 320 } |
| 321 if (_message != null) { |
| 322 offset_message = fbBuilder.writeString(_message); |
| 323 } |
| 324 if (_uniqueName != null) { |
| 325 offset_uniqueName = fbBuilder.writeString(_uniqueName); |
| 326 } |
| 327 fbBuilder.startTable(); |
| 328 if (offset_correction != null) { |
| 329 fbBuilder.addOffset(4, offset_correction); |
| 330 } |
| 331 if (_length != null && _length != 0) { |
| 332 fbBuilder.addUint32(1, _length); |
| 333 } |
| 334 if (offset_message != null) { |
| 335 fbBuilder.addOffset(3, offset_message); |
| 336 } |
| 337 if (_offset != null && _offset != 0) { |
| 338 fbBuilder.addUint32(0, _offset); |
| 339 } |
| 340 if (offset_uniqueName != null) { |
| 341 fbBuilder.addOffset(2, offset_uniqueName); |
| 342 } |
| 343 return fbBuilder.endTable(); |
| 344 } |
| 345 } |
| 346 |
| 347 class _AnalysisDriverUnitErrorReader extends fb.TableReader<_AnalysisDriverUnitE
rrorImpl> { |
| 348 const _AnalysisDriverUnitErrorReader(); |
| 349 |
| 350 @override |
| 351 _AnalysisDriverUnitErrorImpl createObject(fb.BufferContext bc, int offset) =>
new _AnalysisDriverUnitErrorImpl(bc, offset); |
| 352 } |
| 353 |
| 354 class _AnalysisDriverUnitErrorImpl extends Object with _AnalysisDriverUnitErrorM
ixin implements idl.AnalysisDriverUnitError { |
| 355 final fb.BufferContext _bc; |
| 356 final int _bcOffset; |
| 357 |
| 358 _AnalysisDriverUnitErrorImpl(this._bc, this._bcOffset); |
| 359 |
| 360 String _correction; |
| 361 int _length; |
| 362 String _message; |
| 363 int _offset; |
| 364 String _uniqueName; |
| 365 |
| 366 @override |
| 367 String get correction { |
| 368 _correction ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 4, ''); |
| 369 return _correction; |
| 370 } |
| 371 |
| 372 @override |
| 373 int get length { |
| 374 _length ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 1, 0); |
| 375 return _length; |
| 376 } |
| 377 |
| 378 @override |
| 379 String get message { |
| 380 _message ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 3, ''); |
| 381 return _message; |
| 382 } |
| 383 |
| 384 @override |
| 385 int get offset { |
| 386 _offset ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 0, 0); |
| 387 return _offset; |
| 388 } |
| 389 |
| 390 @override |
| 391 String get uniqueName { |
| 392 _uniqueName ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 2, ''); |
| 393 return _uniqueName; |
| 394 } |
| 395 } |
| 396 |
| 397 abstract class _AnalysisDriverUnitErrorMixin implements idl.AnalysisDriverUnitEr
ror { |
| 398 @override |
| 399 Map<String, Object> toJson() { |
| 400 Map<String, Object> _result = <String, Object>{}; |
| 401 if (correction != '') _result["correction"] = correction; |
| 402 if (length != 0) _result["length"] = length; |
| 403 if (message != '') _result["message"] = message; |
| 404 if (offset != 0) _result["offset"] = offset; |
| 405 if (uniqueName != '') _result["uniqueName"] = uniqueName; |
| 406 return _result; |
| 407 } |
| 408 |
| 409 @override |
| 410 Map<String, Object> toMap() => { |
| 411 "correction": correction, |
| 412 "length": length, |
| 413 "message": message, |
| 414 "offset": offset, |
| 415 "uniqueName": uniqueName, |
| 416 }; |
| 417 |
| 418 @override |
| 419 String toString() => convert.JSON.encode(toJson()); |
| 420 } |
| 421 |
132 class CodeRangeBuilder extends Object with _CodeRangeMixin implements idl.CodeRa
nge { | 422 class CodeRangeBuilder extends Object with _CodeRangeMixin implements idl.CodeRa
nge { |
133 int _length; | 423 int _length; |
134 int _offset; | 424 int _offset; |
135 | 425 |
136 @override | 426 @override |
137 int get length => _length ??= 0; | 427 int get length => _length ??= 0; |
138 | 428 |
139 /** | 429 /** |
140 * Length of the element code. | 430 * Length of the element code. |
141 */ | 431 */ |
(...skipping 9352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9494 "propagatedTypeSlot": propagatedTypeSlot, | 9784 "propagatedTypeSlot": propagatedTypeSlot, |
9495 "type": type, | 9785 "type": type, |
9496 "visibleLength": visibleLength, | 9786 "visibleLength": visibleLength, |
9497 "visibleOffset": visibleOffset, | 9787 "visibleOffset": visibleOffset, |
9498 }; | 9788 }; |
9499 | 9789 |
9500 @override | 9790 @override |
9501 String toString() => convert.JSON.encode(toJson()); | 9791 String toString() => convert.JSON.encode(toJson()); |
9502 } | 9792 } |
9503 | 9793 |
OLD | NEW |