| 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 int get size => 1; | 135 int get size => 1; |
| 136 | 136 |
| 137 @override | 137 @override |
| 138 idl.UnlinkedParamKind read(fb.BufferContext bc, int offset) { | 138 idl.UnlinkedParamKind read(fb.BufferContext bc, int offset) { |
| 139 int index = const fb.Uint8Reader().read(bc, offset); | 139 int index = const fb.Uint8Reader().read(bc, offset); |
| 140 return index < idl.UnlinkedParamKind.values.length ? idl.UnlinkedParamKind.v
alues[index] : idl.UnlinkedParamKind.required; | 140 return index < idl.UnlinkedParamKind.values.length ? idl.UnlinkedParamKind.v
alues[index] : idl.UnlinkedParamKind.required; |
| 141 } | 141 } |
| 142 } | 142 } |
| 143 | 143 |
| 144 class CacheAnalysisErrorBuilder extends Object with _CacheAnalysisErrorMixin imp
lements idl.CacheAnalysisError { | 144 class CacheAnalysisErrorBuilder extends Object with _CacheAnalysisErrorMixin imp
lements idl.CacheAnalysisError { |
| 145 bool _finished = false; | |
| 146 | |
| 147 String _correction; | 145 String _correction; |
| 148 String _errorCodeUniqueName; | 146 String _errorCodeUniqueName; |
| 149 int _length; | 147 int _length; |
| 150 String _message; | 148 String _message; |
| 151 int _offset; | 149 int _offset; |
| 152 | 150 |
| 153 @override | 151 @override |
| 154 String get correction => _correction ??= ''; | 152 String get correction => _correction ??= ''; |
| 155 | 153 |
| 156 /** | 154 /** |
| 157 * The correction to be displayed for this error, or `null` if there is no | 155 * The correction to be displayed for this error, or `null` if there is no |
| 158 * correction information for this error. The correction should indicate how | 156 * correction information for this error. The correction should indicate how |
| 159 * the user can fix the error. | 157 * the user can fix the error. |
| 160 */ | 158 */ |
| 161 void set correction(String _value) { | 159 void set correction(String _value) { |
| 162 assert(!_finished); | |
| 163 _correction = _value; | 160 _correction = _value; |
| 164 } | 161 } |
| 165 | 162 |
| 166 @override | 163 @override |
| 167 String get errorCodeUniqueName => _errorCodeUniqueName ??= ''; | 164 String get errorCodeUniqueName => _errorCodeUniqueName ??= ''; |
| 168 | 165 |
| 169 /** | 166 /** |
| 170 * The unique name of the error code. | 167 * The unique name of the error code. |
| 171 */ | 168 */ |
| 172 void set errorCodeUniqueName(String _value) { | 169 void set errorCodeUniqueName(String _value) { |
| 173 assert(!_finished); | |
| 174 _errorCodeUniqueName = _value; | 170 _errorCodeUniqueName = _value; |
| 175 } | 171 } |
| 176 | 172 |
| 177 @override | 173 @override |
| 178 int get length => _length ??= 0; | 174 int get length => _length ??= 0; |
| 179 | 175 |
| 180 /** | 176 /** |
| 181 * Length of the error range. | 177 * Length of the error range. |
| 182 */ | 178 */ |
| 183 void set length(int _value) { | 179 void set length(int _value) { |
| 184 assert(!_finished); | |
| 185 assert(_value == null || _value >= 0); | 180 assert(_value == null || _value >= 0); |
| 186 _length = _value; | 181 _length = _value; |
| 187 } | 182 } |
| 188 | 183 |
| 189 @override | 184 @override |
| 190 String get message => _message ??= ''; | 185 String get message => _message ??= ''; |
| 191 | 186 |
| 192 /** | 187 /** |
| 193 * The message to be displayed for this error. The message should indicate | 188 * The message to be displayed for this error. The message should indicate |
| 194 * what is wrong and why it is wrong. | 189 * what is wrong and why it is wrong. |
| 195 */ | 190 */ |
| 196 void set message(String _value) { | 191 void set message(String _value) { |
| 197 assert(!_finished); | |
| 198 _message = _value; | 192 _message = _value; |
| 199 } | 193 } |
| 200 | 194 |
| 201 @override | 195 @override |
| 202 int get offset => _offset ??= 0; | 196 int get offset => _offset ??= 0; |
| 203 | 197 |
| 204 /** | 198 /** |
| 205 * Offset of the error range relative to the beginning of the file. | 199 * Offset of the error range relative to the beginning of the file. |
| 206 */ | 200 */ |
| 207 void set offset(int _value) { | 201 void set offset(int _value) { |
| 208 assert(!_finished); | |
| 209 assert(_value == null || _value >= 0); | 202 assert(_value == null || _value >= 0); |
| 210 _offset = _value; | 203 _offset = _value; |
| 211 } | 204 } |
| 212 | 205 |
| 213 CacheAnalysisErrorBuilder({String correction, String errorCodeUniqueName, int
length, String message, int offset}) | 206 CacheAnalysisErrorBuilder({String correction, String errorCodeUniqueName, int
length, String message, int offset}) |
| 214 : _correction = correction, | 207 : _correction = correction, |
| 215 _errorCodeUniqueName = errorCodeUniqueName, | 208 _errorCodeUniqueName = errorCodeUniqueName, |
| 216 _length = length, | 209 _length = length, |
| 217 _message = message, | 210 _message = message, |
| 218 _offset = offset; | 211 _offset = offset; |
| 219 | 212 |
| 220 /** | 213 /** |
| 221 * Flush [informative] data recursively. | 214 * Flush [informative] data recursively. |
| 222 */ | 215 */ |
| 223 void flushInformative() { | 216 void flushInformative() { |
| 224 } | 217 } |
| 225 | 218 |
| 226 fb.Offset finish(fb.Builder fbBuilder) { | 219 fb.Offset finish(fb.Builder fbBuilder) { |
| 227 assert(!_finished); | |
| 228 _finished = true; | |
| 229 fb.Offset offset_correction; | 220 fb.Offset offset_correction; |
| 230 fb.Offset offset_errorCodeUniqueName; | 221 fb.Offset offset_errorCodeUniqueName; |
| 231 fb.Offset offset_message; | 222 fb.Offset offset_message; |
| 232 if (_correction != null) { | 223 if (_correction != null) { |
| 233 offset_correction = fbBuilder.writeString(_correction); | 224 offset_correction = fbBuilder.writeString(_correction); |
| 234 } | 225 } |
| 235 if (_errorCodeUniqueName != null) { | 226 if (_errorCodeUniqueName != null) { |
| 236 offset_errorCodeUniqueName = fbBuilder.writeString(_errorCodeUniqueName); | 227 offset_errorCodeUniqueName = fbBuilder.writeString(_errorCodeUniqueName); |
| 237 } | 228 } |
| 238 if (_message != null) { | 229 if (_message != null) { |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 "length": length, | 318 "length": length, |
| 328 "message": message, | 319 "message": message, |
| 329 "offset": offset, | 320 "offset": offset, |
| 330 }; | 321 }; |
| 331 | 322 |
| 332 @override | 323 @override |
| 333 String toString() => convert.JSON.encode(toJson()); | 324 String toString() => convert.JSON.encode(toJson()); |
| 334 } | 325 } |
| 335 | 326 |
| 336 class CacheSourceContentBuilder extends Object with _CacheSourceContentMixin imp
lements idl.CacheSourceContent { | 327 class CacheSourceContentBuilder extends Object with _CacheSourceContentMixin imp
lements idl.CacheSourceContent { |
| 337 bool _finished = false; | |
| 338 | |
| 339 List<String> _exportedUris; | 328 List<String> _exportedUris; |
| 340 List<String> _importedUris; | 329 List<String> _importedUris; |
| 341 idl.CacheSourceKind _kind; | 330 idl.CacheSourceKind _kind; |
| 342 List<String> _partUris; | 331 List<String> _partUris; |
| 343 | 332 |
| 344 @override | 333 @override |
| 345 List<String> get exportedUris => _exportedUris ??= <String>[]; | 334 List<String> get exportedUris => _exportedUris ??= <String>[]; |
| 346 | 335 |
| 347 /** | 336 /** |
| 348 * The list of exported URIs, e.g. `dart:core`, or `foo/bar.dart`, | 337 * The list of exported URIs, e.g. `dart:core`, or `foo/bar.dart`, |
| 349 * or `package:foo/bar.dart`. Empty if [kind] is [CacheSourceKind.part]. | 338 * or `package:foo/bar.dart`. Empty if [kind] is [CacheSourceKind.part]. |
| 350 */ | 339 */ |
| 351 void set exportedUris(List<String> _value) { | 340 void set exportedUris(List<String> _value) { |
| 352 assert(!_finished); | |
| 353 _exportedUris = _value; | 341 _exportedUris = _value; |
| 354 } | 342 } |
| 355 | 343 |
| 356 @override | 344 @override |
| 357 List<String> get importedUris => _importedUris ??= <String>[]; | 345 List<String> get importedUris => _importedUris ??= <String>[]; |
| 358 | 346 |
| 359 /** | 347 /** |
| 360 * The list of explicitly imported URIs, e.g. `dart:core`, or `foo/bar.dart`, | 348 * The list of explicitly imported URIs, e.g. `dart:core`, or `foo/bar.dart`, |
| 361 * or `package:foo/bar.dart`. Empty if [kind] is [CacheSourceKind.part]. | 349 * or `package:foo/bar.dart`. Empty if [kind] is [CacheSourceKind.part]. |
| 362 */ | 350 */ |
| 363 void set importedUris(List<String> _value) { | 351 void set importedUris(List<String> _value) { |
| 364 assert(!_finished); | |
| 365 _importedUris = _value; | 352 _importedUris = _value; |
| 366 } | 353 } |
| 367 | 354 |
| 368 @override | 355 @override |
| 369 idl.CacheSourceKind get kind => _kind ??= idl.CacheSourceKind.library; | 356 idl.CacheSourceKind get kind => _kind ??= idl.CacheSourceKind.library; |
| 370 | 357 |
| 371 /** | 358 /** |
| 372 * The kind of the source. | 359 * The kind of the source. |
| 373 */ | 360 */ |
| 374 void set kind(idl.CacheSourceKind _value) { | 361 void set kind(idl.CacheSourceKind _value) { |
| 375 assert(!_finished); | |
| 376 _kind = _value; | 362 _kind = _value; |
| 377 } | 363 } |
| 378 | 364 |
| 379 @override | 365 @override |
| 380 List<String> get partUris => _partUris ??= <String>[]; | 366 List<String> get partUris => _partUris ??= <String>[]; |
| 381 | 367 |
| 382 /** | 368 /** |
| 383 * The list of part URIs, e.g. `foo/bar.dart`. Empty if [kind] is | 369 * The list of part URIs, e.g. `foo/bar.dart`. Empty if [kind] is |
| 384 * [CacheSourceKind.part]. | 370 * [CacheSourceKind.part]. |
| 385 */ | 371 */ |
| 386 void set partUris(List<String> _value) { | 372 void set partUris(List<String> _value) { |
| 387 assert(!_finished); | |
| 388 _partUris = _value; | 373 _partUris = _value; |
| 389 } | 374 } |
| 390 | 375 |
| 391 CacheSourceContentBuilder({List<String> exportedUris, List<String> importedUri
s, idl.CacheSourceKind kind, List<String> partUris}) | 376 CacheSourceContentBuilder({List<String> exportedUris, List<String> importedUri
s, idl.CacheSourceKind kind, List<String> partUris}) |
| 392 : _exportedUris = exportedUris, | 377 : _exportedUris = exportedUris, |
| 393 _importedUris = importedUris, | 378 _importedUris = importedUris, |
| 394 _kind = kind, | 379 _kind = kind, |
| 395 _partUris = partUris; | 380 _partUris = partUris; |
| 396 | 381 |
| 397 /** | 382 /** |
| 398 * Flush [informative] data recursively. | 383 * Flush [informative] data recursively. |
| 399 */ | 384 */ |
| 400 void flushInformative() { | 385 void flushInformative() { |
| 401 } | 386 } |
| 402 | 387 |
| 403 List<int> toBuffer() { | 388 List<int> toBuffer() { |
| 404 fb.Builder fbBuilder = new fb.Builder(); | 389 fb.Builder fbBuilder = new fb.Builder(); |
| 405 return fbBuilder.finish(finish(fbBuilder), "CaSS"); | 390 return fbBuilder.finish(finish(fbBuilder), "CaSS"); |
| 406 } | 391 } |
| 407 | 392 |
| 408 fb.Offset finish(fb.Builder fbBuilder) { | 393 fb.Offset finish(fb.Builder fbBuilder) { |
| 409 assert(!_finished); | |
| 410 _finished = true; | |
| 411 fb.Offset offset_exportedUris; | 394 fb.Offset offset_exportedUris; |
| 412 fb.Offset offset_importedUris; | 395 fb.Offset offset_importedUris; |
| 413 fb.Offset offset_partUris; | 396 fb.Offset offset_partUris; |
| 414 if (!(_exportedUris == null || _exportedUris.isEmpty)) { | 397 if (!(_exportedUris == null || _exportedUris.isEmpty)) { |
| 415 offset_exportedUris = fbBuilder.writeList(_exportedUris.map((b) => fbBuild
er.writeString(b)).toList()); | 398 offset_exportedUris = fbBuilder.writeList(_exportedUris.map((b) => fbBuild
er.writeString(b)).toList()); |
| 416 } | 399 } |
| 417 if (!(_importedUris == null || _importedUris.isEmpty)) { | 400 if (!(_importedUris == null || _importedUris.isEmpty)) { |
| 418 offset_importedUris = fbBuilder.writeList(_importedUris.map((b) => fbBuild
er.writeString(b)).toList()); | 401 offset_importedUris = fbBuilder.writeList(_importedUris.map((b) => fbBuild
er.writeString(b)).toList()); |
| 419 } | 402 } |
| 420 if (!(_partUris == null || _partUris.isEmpty)) { | 403 if (!(_partUris == null || _partUris.isEmpty)) { |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 "importedUris": importedUris, | 485 "importedUris": importedUris, |
| 503 "kind": kind, | 486 "kind": kind, |
| 504 "partUris": partUris, | 487 "partUris": partUris, |
| 505 }; | 488 }; |
| 506 | 489 |
| 507 @override | 490 @override |
| 508 String toString() => convert.JSON.encode(toJson()); | 491 String toString() => convert.JSON.encode(toJson()); |
| 509 } | 492 } |
| 510 | 493 |
| 511 class CacheSourceErrorsInLibraryBuilder extends Object with _CacheSourceErrorsIn
LibraryMixin implements idl.CacheSourceErrorsInLibrary { | 494 class CacheSourceErrorsInLibraryBuilder extends Object with _CacheSourceErrorsIn
LibraryMixin implements idl.CacheSourceErrorsInLibrary { |
| 512 bool _finished = false; | |
| 513 | |
| 514 List<CacheAnalysisErrorBuilder> _errors; | 495 List<CacheAnalysisErrorBuilder> _errors; |
| 515 | 496 |
| 516 @override | 497 @override |
| 517 List<CacheAnalysisErrorBuilder> get errors => _errors ??= <CacheAnalysisErrorB
uilder>[]; | 498 List<CacheAnalysisErrorBuilder> get errors => _errors ??= <CacheAnalysisErrorB
uilder>[]; |
| 518 | 499 |
| 519 /** | 500 /** |
| 520 * The list of errors in the source in the library. | 501 * The list of errors in the source in the library. |
| 521 */ | 502 */ |
| 522 void set errors(List<CacheAnalysisErrorBuilder> _value) { | 503 void set errors(List<CacheAnalysisErrorBuilder> _value) { |
| 523 assert(!_finished); | |
| 524 _errors = _value; | 504 _errors = _value; |
| 525 } | 505 } |
| 526 | 506 |
| 527 CacheSourceErrorsInLibraryBuilder({List<CacheAnalysisErrorBuilder> errors}) | 507 CacheSourceErrorsInLibraryBuilder({List<CacheAnalysisErrorBuilder> errors}) |
| 528 : _errors = errors; | 508 : _errors = errors; |
| 529 | 509 |
| 530 /** | 510 /** |
| 531 * Flush [informative] data recursively. | 511 * Flush [informative] data recursively. |
| 532 */ | 512 */ |
| 533 void flushInformative() { | 513 void flushInformative() { |
| 534 _errors?.forEach((b) => b.flushInformative()); | 514 _errors?.forEach((b) => b.flushInformative()); |
| 535 } | 515 } |
| 536 | 516 |
| 537 List<int> toBuffer() { | 517 List<int> toBuffer() { |
| 538 fb.Builder fbBuilder = new fb.Builder(); | 518 fb.Builder fbBuilder = new fb.Builder(); |
| 539 return fbBuilder.finish(finish(fbBuilder), "CSEL"); | 519 return fbBuilder.finish(finish(fbBuilder), "CSEL"); |
| 540 } | 520 } |
| 541 | 521 |
| 542 fb.Offset finish(fb.Builder fbBuilder) { | 522 fb.Offset finish(fb.Builder fbBuilder) { |
| 543 assert(!_finished); | |
| 544 _finished = true; | |
| 545 fb.Offset offset_errors; | 523 fb.Offset offset_errors; |
| 546 if (!(_errors == null || _errors.isEmpty)) { | 524 if (!(_errors == null || _errors.isEmpty)) { |
| 547 offset_errors = fbBuilder.writeList(_errors.map((b) => b.finish(fbBuilder)
).toList()); | 525 offset_errors = fbBuilder.writeList(_errors.map((b) => b.finish(fbBuilder)
).toList()); |
| 548 } | 526 } |
| 549 fbBuilder.startTable(); | 527 fbBuilder.startTable(); |
| 550 if (offset_errors != null) { | 528 if (offset_errors != null) { |
| 551 fbBuilder.addOffset(0, offset_errors); | 529 fbBuilder.addOffset(0, offset_errors); |
| 552 } | 530 } |
| 553 return fbBuilder.endTable(); | 531 return fbBuilder.endTable(); |
| 554 } | 532 } |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 592 @override | 570 @override |
| 593 Map<String, Object> toMap() => { | 571 Map<String, Object> toMap() => { |
| 594 "errors": errors, | 572 "errors": errors, |
| 595 }; | 573 }; |
| 596 | 574 |
| 597 @override | 575 @override |
| 598 String toString() => convert.JSON.encode(toJson()); | 576 String toString() => convert.JSON.encode(toJson()); |
| 599 } | 577 } |
| 600 | 578 |
| 601 class CodeRangeBuilder extends Object with _CodeRangeMixin implements idl.CodeRa
nge { | 579 class CodeRangeBuilder extends Object with _CodeRangeMixin implements idl.CodeRa
nge { |
| 602 bool _finished = false; | |
| 603 | |
| 604 int _length; | 580 int _length; |
| 605 int _offset; | 581 int _offset; |
| 606 | 582 |
| 607 @override | 583 @override |
| 608 int get length => _length ??= 0; | 584 int get length => _length ??= 0; |
| 609 | 585 |
| 610 /** | 586 /** |
| 611 * Length of the element code. | 587 * Length of the element code. |
| 612 */ | 588 */ |
| 613 void set length(int _value) { | 589 void set length(int _value) { |
| 614 assert(!_finished); | |
| 615 assert(_value == null || _value >= 0); | 590 assert(_value == null || _value >= 0); |
| 616 _length = _value; | 591 _length = _value; |
| 617 } | 592 } |
| 618 | 593 |
| 619 @override | 594 @override |
| 620 int get offset => _offset ??= 0; | 595 int get offset => _offset ??= 0; |
| 621 | 596 |
| 622 /** | 597 /** |
| 623 * Offset of the element code relative to the beginning of the file. | 598 * Offset of the element code relative to the beginning of the file. |
| 624 */ | 599 */ |
| 625 void set offset(int _value) { | 600 void set offset(int _value) { |
| 626 assert(!_finished); | |
| 627 assert(_value == null || _value >= 0); | 601 assert(_value == null || _value >= 0); |
| 628 _offset = _value; | 602 _offset = _value; |
| 629 } | 603 } |
| 630 | 604 |
| 631 CodeRangeBuilder({int length, int offset}) | 605 CodeRangeBuilder({int length, int offset}) |
| 632 : _length = length, | 606 : _length = length, |
| 633 _offset = offset; | 607 _offset = offset; |
| 634 | 608 |
| 635 /** | 609 /** |
| 636 * Flush [informative] data recursively. | 610 * Flush [informative] data recursively. |
| 637 */ | 611 */ |
| 638 void flushInformative() { | 612 void flushInformative() { |
| 639 } | 613 } |
| 640 | 614 |
| 641 fb.Offset finish(fb.Builder fbBuilder) { | 615 fb.Offset finish(fb.Builder fbBuilder) { |
| 642 assert(!_finished); | |
| 643 _finished = true; | |
| 644 fbBuilder.startTable(); | 616 fbBuilder.startTable(); |
| 645 if (_length != null && _length != 0) { | 617 if (_length != null && _length != 0) { |
| 646 fbBuilder.addUint32(1, _length); | 618 fbBuilder.addUint32(1, _length); |
| 647 } | 619 } |
| 648 if (_offset != null && _offset != 0) { | 620 if (_offset != null && _offset != 0) { |
| 649 fbBuilder.addUint32(0, _offset); | 621 fbBuilder.addUint32(0, _offset); |
| 650 } | 622 } |
| 651 return fbBuilder.endTable(); | 623 return fbBuilder.endTable(); |
| 652 } | 624 } |
| 653 } | 625 } |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 694 Map<String, Object> toMap() => { | 666 Map<String, Object> toMap() => { |
| 695 "length": length, | 667 "length": length, |
| 696 "offset": offset, | 668 "offset": offset, |
| 697 }; | 669 }; |
| 698 | 670 |
| 699 @override | 671 @override |
| 700 String toString() => convert.JSON.encode(toJson()); | 672 String toString() => convert.JSON.encode(toJson()); |
| 701 } | 673 } |
| 702 | 674 |
| 703 class EntityRefBuilder extends Object with _EntityRefMixin implements idl.Entity
Ref { | 675 class EntityRefBuilder extends Object with _EntityRefMixin implements idl.Entity
Ref { |
| 704 bool _finished = false; | |
| 705 | |
| 706 List<int> _implicitFunctionTypeIndices; | 676 List<int> _implicitFunctionTypeIndices; |
| 707 int _paramReference; | 677 int _paramReference; |
| 708 int _reference; | 678 int _reference; |
| 709 int _slot; | 679 int _slot; |
| 710 List<UnlinkedParamBuilder> _syntheticParams; | 680 List<UnlinkedParamBuilder> _syntheticParams; |
| 711 EntityRefBuilder _syntheticReturnType; | 681 EntityRefBuilder _syntheticReturnType; |
| 712 List<EntityRefBuilder> _typeArguments; | 682 List<EntityRefBuilder> _typeArguments; |
| 713 | 683 |
| 714 @override | 684 @override |
| 715 List<int> get implicitFunctionTypeIndices => _implicitFunctionTypeIndices ??=
<int>[]; | 685 List<int> get implicitFunctionTypeIndices => _implicitFunctionTypeIndices ??=
<int>[]; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 730 * | 700 * |
| 731 * Then to refer to the function type implicitly defined by parameter `h` | 701 * Then to refer to the function type implicitly defined by parameter `h` |
| 732 * (which is parameter 2 of parameter 1 of `f`), then | 702 * (which is parameter 2 of parameter 1 of `f`), then |
| 733 * [implicitFunctionTypeIndices] should be [1, 2]. | 703 * [implicitFunctionTypeIndices] should be [1, 2]. |
| 734 * | 704 * |
| 735 * Note that if the entity being referred to is a generic method inside a | 705 * Note that if the entity being referred to is a generic method inside a |
| 736 * generic class, then the type arguments in [typeArguments] are applied | 706 * generic class, then the type arguments in [typeArguments] are applied |
| 737 * first to the class and then to the method. | 707 * first to the class and then to the method. |
| 738 */ | 708 */ |
| 739 void set implicitFunctionTypeIndices(List<int> _value) { | 709 void set implicitFunctionTypeIndices(List<int> _value) { |
| 740 assert(!_finished); | |
| 741 assert(_value == null || _value.every((e) => e >= 0)); | 710 assert(_value == null || _value.every((e) => e >= 0)); |
| 742 _implicitFunctionTypeIndices = _value; | 711 _implicitFunctionTypeIndices = _value; |
| 743 } | 712 } |
| 744 | 713 |
| 745 @override | 714 @override |
| 746 int get paramReference => _paramReference ??= 0; | 715 int get paramReference => _paramReference ??= 0; |
| 747 | 716 |
| 748 /** | 717 /** |
| 749 * If this is a reference to a type parameter, one-based index into the list | 718 * If this is a reference to a type parameter, one-based index into the list |
| 750 * of [UnlinkedTypeParam]s currently in effect. Indexing is done using De | 719 * of [UnlinkedTypeParam]s currently in effect. Indexing is done using De |
| 751 * Bruijn index conventions; that is, innermost parameters come first, and | 720 * Bruijn index conventions; that is, innermost parameters come first, and |
| 752 * if a class or method has multiple parameters, they are indexed from right | 721 * if a class or method has multiple parameters, they are indexed from right |
| 753 * to left. So for instance, if the enclosing declaration is | 722 * to left. So for instance, if the enclosing declaration is |
| 754 * | 723 * |
| 755 * class C<T,U> { | 724 * class C<T,U> { |
| 756 * m<V,W> { | 725 * m<V,W> { |
| 757 * ... | 726 * ... |
| 758 * } | 727 * } |
| 759 * } | 728 * } |
| 760 * | 729 * |
| 761 * Then [paramReference] values of 1, 2, 3, and 4 represent W, V, U, and T, | 730 * Then [paramReference] values of 1, 2, 3, and 4 represent W, V, U, and T, |
| 762 * respectively. | 731 * respectively. |
| 763 * | 732 * |
| 764 * If the type being referred to is not a type parameter, [paramReference] is | 733 * If the type being referred to is not a type parameter, [paramReference] is |
| 765 * zero. | 734 * zero. |
| 766 */ | 735 */ |
| 767 void set paramReference(int _value) { | 736 void set paramReference(int _value) { |
| 768 assert(!_finished); | |
| 769 assert(_value == null || _value >= 0); | 737 assert(_value == null || _value >= 0); |
| 770 _paramReference = _value; | 738 _paramReference = _value; |
| 771 } | 739 } |
| 772 | 740 |
| 773 @override | 741 @override |
| 774 int get reference => _reference ??= 0; | 742 int get reference => _reference ??= 0; |
| 775 | 743 |
| 776 /** | 744 /** |
| 777 * Index into [UnlinkedUnit.references] for the entity being referred to, or | 745 * Index into [UnlinkedUnit.references] for the entity being referred to, or |
| 778 * zero if this is a reference to a type parameter. | 746 * zero if this is a reference to a type parameter. |
| 779 */ | 747 */ |
| 780 void set reference(int _value) { | 748 void set reference(int _value) { |
| 781 assert(!_finished); | |
| 782 assert(_value == null || _value >= 0); | 749 assert(_value == null || _value >= 0); |
| 783 _reference = _value; | 750 _reference = _value; |
| 784 } | 751 } |
| 785 | 752 |
| 786 @override | 753 @override |
| 787 int get slot => _slot ??= 0; | 754 int get slot => _slot ??= 0; |
| 788 | 755 |
| 789 /** | 756 /** |
| 790 * If this [EntityRef] is contained within [LinkedUnit.types], slot id (which | 757 * If this [EntityRef] is contained within [LinkedUnit.types], slot id (which |
| 791 * is unique within the compilation unit) identifying the target of type | 758 * is unique within the compilation unit) identifying the target of type |
| 792 * propagation or type inference with which this [EntityRef] is associated. | 759 * propagation or type inference with which this [EntityRef] is associated. |
| 793 * | 760 * |
| 794 * Otherwise zero. | 761 * Otherwise zero. |
| 795 */ | 762 */ |
| 796 void set slot(int _value) { | 763 void set slot(int _value) { |
| 797 assert(!_finished); | |
| 798 assert(_value == null || _value >= 0); | 764 assert(_value == null || _value >= 0); |
| 799 _slot = _value; | 765 _slot = _value; |
| 800 } | 766 } |
| 801 | 767 |
| 802 @override | 768 @override |
| 803 List<UnlinkedParamBuilder> get syntheticParams => _syntheticParams ??= <Unlink
edParamBuilder>[]; | 769 List<UnlinkedParamBuilder> get syntheticParams => _syntheticParams ??= <Unlink
edParamBuilder>[]; |
| 804 | 770 |
| 805 /** | 771 /** |
| 806 * If this [EntityRef] is a reference to a function type whose | 772 * If this [EntityRef] is a reference to a function type whose |
| 807 * [FunctionElement] is not in any library (e.g. a function type that was | 773 * [FunctionElement] is not in any library (e.g. a function type that was |
| 808 * synthesized by a LUB computation), the function parameters. Otherwise | 774 * synthesized by a LUB computation), the function parameters. Otherwise |
| 809 * empty. | 775 * empty. |
| 810 */ | 776 */ |
| 811 void set syntheticParams(List<UnlinkedParamBuilder> _value) { | 777 void set syntheticParams(List<UnlinkedParamBuilder> _value) { |
| 812 assert(!_finished); | |
| 813 _syntheticParams = _value; | 778 _syntheticParams = _value; |
| 814 } | 779 } |
| 815 | 780 |
| 816 @override | 781 @override |
| 817 EntityRefBuilder get syntheticReturnType => _syntheticReturnType; | 782 EntityRefBuilder get syntheticReturnType => _syntheticReturnType; |
| 818 | 783 |
| 819 /** | 784 /** |
| 820 * If this [EntityRef] is a reference to a function type whose | 785 * If this [EntityRef] is a reference to a function type whose |
| 821 * [FunctionElement] is not in any library (e.g. a function type that was | 786 * [FunctionElement] is not in any library (e.g. a function type that was |
| 822 * synthesized by a LUB computation), the return type of the function. | 787 * synthesized by a LUB computation), the return type of the function. |
| 823 * Otherwise `null`. | 788 * Otherwise `null`. |
| 824 */ | 789 */ |
| 825 void set syntheticReturnType(EntityRefBuilder _value) { | 790 void set syntheticReturnType(EntityRefBuilder _value) { |
| 826 assert(!_finished); | |
| 827 _syntheticReturnType = _value; | 791 _syntheticReturnType = _value; |
| 828 } | 792 } |
| 829 | 793 |
| 830 @override | 794 @override |
| 831 List<EntityRefBuilder> get typeArguments => _typeArguments ??= <EntityRefBuild
er>[]; | 795 List<EntityRefBuilder> get typeArguments => _typeArguments ??= <EntityRefBuild
er>[]; |
| 832 | 796 |
| 833 /** | 797 /** |
| 834 * If this is an instantiation of a generic type or generic executable, the | 798 * If this is an instantiation of a generic type or generic executable, the |
| 835 * type arguments used to instantiate it (if any). | 799 * type arguments used to instantiate it (if any). |
| 836 */ | 800 */ |
| 837 void set typeArguments(List<EntityRefBuilder> _value) { | 801 void set typeArguments(List<EntityRefBuilder> _value) { |
| 838 assert(!_finished); | |
| 839 _typeArguments = _value; | 802 _typeArguments = _value; |
| 840 } | 803 } |
| 841 | 804 |
| 842 EntityRefBuilder({List<int> implicitFunctionTypeIndices, int paramReference, i
nt reference, int slot, List<UnlinkedParamBuilder> syntheticParams, EntityRefBui
lder syntheticReturnType, List<EntityRefBuilder> typeArguments}) | 805 EntityRefBuilder({List<int> implicitFunctionTypeIndices, int paramReference, i
nt reference, int slot, List<UnlinkedParamBuilder> syntheticParams, EntityRefBui
lder syntheticReturnType, List<EntityRefBuilder> typeArguments}) |
| 843 : _implicitFunctionTypeIndices = implicitFunctionTypeIndices, | 806 : _implicitFunctionTypeIndices = implicitFunctionTypeIndices, |
| 844 _paramReference = paramReference, | 807 _paramReference = paramReference, |
| 845 _reference = reference, | 808 _reference = reference, |
| 846 _slot = slot, | 809 _slot = slot, |
| 847 _syntheticParams = syntheticParams, | 810 _syntheticParams = syntheticParams, |
| 848 _syntheticReturnType = syntheticReturnType, | 811 _syntheticReturnType = syntheticReturnType, |
| 849 _typeArguments = typeArguments; | 812 _typeArguments = typeArguments; |
| 850 | 813 |
| 851 /** | 814 /** |
| 852 * Flush [informative] data recursively. | 815 * Flush [informative] data recursively. |
| 853 */ | 816 */ |
| 854 void flushInformative() { | 817 void flushInformative() { |
| 855 _syntheticParams?.forEach((b) => b.flushInformative()); | 818 _syntheticParams?.forEach((b) => b.flushInformative()); |
| 856 _syntheticReturnType?.flushInformative(); | 819 _syntheticReturnType?.flushInformative(); |
| 857 _typeArguments?.forEach((b) => b.flushInformative()); | 820 _typeArguments?.forEach((b) => b.flushInformative()); |
| 858 } | 821 } |
| 859 | 822 |
| 860 fb.Offset finish(fb.Builder fbBuilder) { | 823 fb.Offset finish(fb.Builder fbBuilder) { |
| 861 assert(!_finished); | |
| 862 _finished = true; | |
| 863 fb.Offset offset_implicitFunctionTypeIndices; | 824 fb.Offset offset_implicitFunctionTypeIndices; |
| 864 fb.Offset offset_syntheticParams; | 825 fb.Offset offset_syntheticParams; |
| 865 fb.Offset offset_syntheticReturnType; | 826 fb.Offset offset_syntheticReturnType; |
| 866 fb.Offset offset_typeArguments; | 827 fb.Offset offset_typeArguments; |
| 867 if (!(_implicitFunctionTypeIndices == null || _implicitFunctionTypeIndices.i
sEmpty)) { | 828 if (!(_implicitFunctionTypeIndices == null || _implicitFunctionTypeIndices.i
sEmpty)) { |
| 868 offset_implicitFunctionTypeIndices = fbBuilder.writeListUint32(_implicitFu
nctionTypeIndices); | 829 offset_implicitFunctionTypeIndices = fbBuilder.writeListUint32(_implicitFu
nctionTypeIndices); |
| 869 } | 830 } |
| 870 if (!(_syntheticParams == null || _syntheticParams.isEmpty)) { | 831 if (!(_syntheticParams == null || _syntheticParams.isEmpty)) { |
| 871 offset_syntheticParams = fbBuilder.writeList(_syntheticParams.map((b) => b
.finish(fbBuilder)).toList()); | 832 offset_syntheticParams = fbBuilder.writeList(_syntheticParams.map((b) => b
.finish(fbBuilder)).toList()); |
| 872 } | 833 } |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 989 "syntheticParams": syntheticParams, | 950 "syntheticParams": syntheticParams, |
| 990 "syntheticReturnType": syntheticReturnType, | 951 "syntheticReturnType": syntheticReturnType, |
| 991 "typeArguments": typeArguments, | 952 "typeArguments": typeArguments, |
| 992 }; | 953 }; |
| 993 | 954 |
| 994 @override | 955 @override |
| 995 String toString() => convert.JSON.encode(toJson()); | 956 String toString() => convert.JSON.encode(toJson()); |
| 996 } | 957 } |
| 997 | 958 |
| 998 class LinkedDependencyBuilder extends Object with _LinkedDependencyMixin impleme
nts idl.LinkedDependency { | 959 class LinkedDependencyBuilder extends Object with _LinkedDependencyMixin impleme
nts idl.LinkedDependency { |
| 999 bool _finished = false; | |
| 1000 | |
| 1001 List<String> _parts; | 960 List<String> _parts; |
| 1002 String _uri; | 961 String _uri; |
| 1003 | 962 |
| 1004 @override | 963 @override |
| 1005 List<String> get parts => _parts ??= <String>[]; | 964 List<String> get parts => _parts ??= <String>[]; |
| 1006 | 965 |
| 1007 /** | 966 /** |
| 1008 * URI for the compilation units listed in the library's `part` declarations. | 967 * URI for the compilation units listed in the library's `part` declarations. |
| 1009 * These URIs are relative to the importing library. | 968 * These URIs are relative to the importing library. |
| 1010 */ | 969 */ |
| 1011 void set parts(List<String> _value) { | 970 void set parts(List<String> _value) { |
| 1012 assert(!_finished); | |
| 1013 _parts = _value; | 971 _parts = _value; |
| 1014 } | 972 } |
| 1015 | 973 |
| 1016 @override | 974 @override |
| 1017 String get uri => _uri ??= ''; | 975 String get uri => _uri ??= ''; |
| 1018 | 976 |
| 1019 /** | 977 /** |
| 1020 * The relative URI of the dependent library. This URI is relative to the | 978 * The relative URI of the dependent library. This URI is relative to the |
| 1021 * importing library, even if there are intervening `export` declarations. | 979 * importing library, even if there are intervening `export` declarations. |
| 1022 * So, for example, if `a.dart` imports `b/c.dart` and `b/c.dart` exports | 980 * So, for example, if `a.dart` imports `b/c.dart` and `b/c.dart` exports |
| 1023 * `d/e.dart`, the URI listed for `a.dart`'s dependency on `e.dart` will be | 981 * `d/e.dart`, the URI listed for `a.dart`'s dependency on `e.dart` will be |
| 1024 * `b/d/e.dart`. | 982 * `b/d/e.dart`. |
| 1025 */ | 983 */ |
| 1026 void set uri(String _value) { | 984 void set uri(String _value) { |
| 1027 assert(!_finished); | |
| 1028 _uri = _value; | 985 _uri = _value; |
| 1029 } | 986 } |
| 1030 | 987 |
| 1031 LinkedDependencyBuilder({List<String> parts, String uri}) | 988 LinkedDependencyBuilder({List<String> parts, String uri}) |
| 1032 : _parts = parts, | 989 : _parts = parts, |
| 1033 _uri = uri; | 990 _uri = uri; |
| 1034 | 991 |
| 1035 /** | 992 /** |
| 1036 * Flush [informative] data recursively. | 993 * Flush [informative] data recursively. |
| 1037 */ | 994 */ |
| 1038 void flushInformative() { | 995 void flushInformative() { |
| 1039 } | 996 } |
| 1040 | 997 |
| 1041 fb.Offset finish(fb.Builder fbBuilder) { | 998 fb.Offset finish(fb.Builder fbBuilder) { |
| 1042 assert(!_finished); | |
| 1043 _finished = true; | |
| 1044 fb.Offset offset_parts; | 999 fb.Offset offset_parts; |
| 1045 fb.Offset offset_uri; | 1000 fb.Offset offset_uri; |
| 1046 if (!(_parts == null || _parts.isEmpty)) { | 1001 if (!(_parts == null || _parts.isEmpty)) { |
| 1047 offset_parts = fbBuilder.writeList(_parts.map((b) => fbBuilder.writeString
(b)).toList()); | 1002 offset_parts = fbBuilder.writeList(_parts.map((b) => fbBuilder.writeString
(b)).toList()); |
| 1048 } | 1003 } |
| 1049 if (_uri != null) { | 1004 if (_uri != null) { |
| 1050 offset_uri = fbBuilder.writeString(_uri); | 1005 offset_uri = fbBuilder.writeString(_uri); |
| 1051 } | 1006 } |
| 1052 fbBuilder.startTable(); | 1007 fbBuilder.startTable(); |
| 1053 if (offset_parts != null) { | 1008 if (offset_parts != null) { |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1102 Map<String, Object> toMap() => { | 1057 Map<String, Object> toMap() => { |
| 1103 "parts": parts, | 1058 "parts": parts, |
| 1104 "uri": uri, | 1059 "uri": uri, |
| 1105 }; | 1060 }; |
| 1106 | 1061 |
| 1107 @override | 1062 @override |
| 1108 String toString() => convert.JSON.encode(toJson()); | 1063 String toString() => convert.JSON.encode(toJson()); |
| 1109 } | 1064 } |
| 1110 | 1065 |
| 1111 class LinkedExportNameBuilder extends Object with _LinkedExportNameMixin impleme
nts idl.LinkedExportName { | 1066 class LinkedExportNameBuilder extends Object with _LinkedExportNameMixin impleme
nts idl.LinkedExportName { |
| 1112 bool _finished = false; | |
| 1113 | |
| 1114 int _dependency; | 1067 int _dependency; |
| 1115 idl.ReferenceKind _kind; | 1068 idl.ReferenceKind _kind; |
| 1116 String _name; | 1069 String _name; |
| 1117 int _unit; | 1070 int _unit; |
| 1118 | 1071 |
| 1119 @override | 1072 @override |
| 1120 int get dependency => _dependency ??= 0; | 1073 int get dependency => _dependency ??= 0; |
| 1121 | 1074 |
| 1122 /** | 1075 /** |
| 1123 * Index into [LinkedLibrary.dependencies] for the library in which the | 1076 * Index into [LinkedLibrary.dependencies] for the library in which the |
| 1124 * entity is defined. | 1077 * entity is defined. |
| 1125 */ | 1078 */ |
| 1126 void set dependency(int _value) { | 1079 void set dependency(int _value) { |
| 1127 assert(!_finished); | |
| 1128 assert(_value == null || _value >= 0); | 1080 assert(_value == null || _value >= 0); |
| 1129 _dependency = _value; | 1081 _dependency = _value; |
| 1130 } | 1082 } |
| 1131 | 1083 |
| 1132 @override | 1084 @override |
| 1133 idl.ReferenceKind get kind => _kind ??= idl.ReferenceKind.classOrEnum; | 1085 idl.ReferenceKind get kind => _kind ??= idl.ReferenceKind.classOrEnum; |
| 1134 | 1086 |
| 1135 /** | 1087 /** |
| 1136 * The kind of the entity being referred to. | 1088 * The kind of the entity being referred to. |
| 1137 */ | 1089 */ |
| 1138 void set kind(idl.ReferenceKind _value) { | 1090 void set kind(idl.ReferenceKind _value) { |
| 1139 assert(!_finished); | |
| 1140 _kind = _value; | 1091 _kind = _value; |
| 1141 } | 1092 } |
| 1142 | 1093 |
| 1143 @override | 1094 @override |
| 1144 String get name => _name ??= ''; | 1095 String get name => _name ??= ''; |
| 1145 | 1096 |
| 1146 /** | 1097 /** |
| 1147 * Name of the exported entity. For an exported setter, this name includes | 1098 * Name of the exported entity. For an exported setter, this name includes |
| 1148 * the trailing '='. | 1099 * the trailing '='. |
| 1149 */ | 1100 */ |
| 1150 void set name(String _value) { | 1101 void set name(String _value) { |
| 1151 assert(!_finished); | |
| 1152 _name = _value; | 1102 _name = _value; |
| 1153 } | 1103 } |
| 1154 | 1104 |
| 1155 @override | 1105 @override |
| 1156 int get unit => _unit ??= 0; | 1106 int get unit => _unit ??= 0; |
| 1157 | 1107 |
| 1158 /** | 1108 /** |
| 1159 * Integer index indicating which unit in the exported library contains the | 1109 * Integer index indicating which unit in the exported library contains the |
| 1160 * definition of the entity. As with indices into [LinkedLibrary.units], | 1110 * definition of the entity. As with indices into [LinkedLibrary.units], |
| 1161 * zero represents the defining compilation unit, and nonzero values | 1111 * zero represents the defining compilation unit, and nonzero values |
| 1162 * represent parts in the order of the corresponding `part` declarations. | 1112 * represent parts in the order of the corresponding `part` declarations. |
| 1163 */ | 1113 */ |
| 1164 void set unit(int _value) { | 1114 void set unit(int _value) { |
| 1165 assert(!_finished); | |
| 1166 assert(_value == null || _value >= 0); | 1115 assert(_value == null || _value >= 0); |
| 1167 _unit = _value; | 1116 _unit = _value; |
| 1168 } | 1117 } |
| 1169 | 1118 |
| 1170 LinkedExportNameBuilder({int dependency, idl.ReferenceKind kind, String name,
int unit}) | 1119 LinkedExportNameBuilder({int dependency, idl.ReferenceKind kind, String name,
int unit}) |
| 1171 : _dependency = dependency, | 1120 : _dependency = dependency, |
| 1172 _kind = kind, | 1121 _kind = kind, |
| 1173 _name = name, | 1122 _name = name, |
| 1174 _unit = unit; | 1123 _unit = unit; |
| 1175 | 1124 |
| 1176 /** | 1125 /** |
| 1177 * Flush [informative] data recursively. | 1126 * Flush [informative] data recursively. |
| 1178 */ | 1127 */ |
| 1179 void flushInformative() { | 1128 void flushInformative() { |
| 1180 } | 1129 } |
| 1181 | 1130 |
| 1182 fb.Offset finish(fb.Builder fbBuilder) { | 1131 fb.Offset finish(fb.Builder fbBuilder) { |
| 1183 assert(!_finished); | |
| 1184 _finished = true; | |
| 1185 fb.Offset offset_name; | 1132 fb.Offset offset_name; |
| 1186 if (_name != null) { | 1133 if (_name != null) { |
| 1187 offset_name = fbBuilder.writeString(_name); | 1134 offset_name = fbBuilder.writeString(_name); |
| 1188 } | 1135 } |
| 1189 fbBuilder.startTable(); | 1136 fbBuilder.startTable(); |
| 1190 if (_dependency != null && _dependency != 0) { | 1137 if (_dependency != null && _dependency != 0) { |
| 1191 fbBuilder.addUint32(0, _dependency); | 1138 fbBuilder.addUint32(0, _dependency); |
| 1192 } | 1139 } |
| 1193 if (_kind != null && _kind != idl.ReferenceKind.classOrEnum) { | 1140 if (_kind != null && _kind != idl.ReferenceKind.classOrEnum) { |
| 1194 fbBuilder.addUint8(3, _kind.index); | 1141 fbBuilder.addUint8(3, _kind.index); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1263 "kind": kind, | 1210 "kind": kind, |
| 1264 "name": name, | 1211 "name": name, |
| 1265 "unit": unit, | 1212 "unit": unit, |
| 1266 }; | 1213 }; |
| 1267 | 1214 |
| 1268 @override | 1215 @override |
| 1269 String toString() => convert.JSON.encode(toJson()); | 1216 String toString() => convert.JSON.encode(toJson()); |
| 1270 } | 1217 } |
| 1271 | 1218 |
| 1272 class LinkedLibraryBuilder extends Object with _LinkedLibraryMixin implements id
l.LinkedLibrary { | 1219 class LinkedLibraryBuilder extends Object with _LinkedLibraryMixin implements id
l.LinkedLibrary { |
| 1273 bool _finished = false; | |
| 1274 | |
| 1275 List<LinkedDependencyBuilder> _dependencies; | 1220 List<LinkedDependencyBuilder> _dependencies; |
| 1276 List<int> _exportDependencies; | 1221 List<int> _exportDependencies; |
| 1277 List<LinkedExportNameBuilder> _exportNames; | 1222 List<LinkedExportNameBuilder> _exportNames; |
| 1278 bool _fallbackMode; | 1223 bool _fallbackMode; |
| 1279 List<int> _importDependencies; | 1224 List<int> _importDependencies; |
| 1280 int _numPrelinkedDependencies; | 1225 int _numPrelinkedDependencies; |
| 1281 List<LinkedUnitBuilder> _units; | 1226 List<LinkedUnitBuilder> _units; |
| 1282 | 1227 |
| 1283 @override | 1228 @override |
| 1284 List<LinkedDependencyBuilder> get dependencies => _dependencies ??= <LinkedDep
endencyBuilder>[]; | 1229 List<LinkedDependencyBuilder> get dependencies => _dependencies ??= <LinkedDep
endencyBuilder>[]; |
| 1285 | 1230 |
| 1286 /** | 1231 /** |
| 1287 * The libraries that this library depends on (either via an explicit import | 1232 * The libraries that this library depends on (either via an explicit import |
| 1288 * statement or via the implicit dependencies on `dart:core` and | 1233 * statement or via the implicit dependencies on `dart:core` and |
| 1289 * `dart:async`). The first element of this array is a pseudo-dependency | 1234 * `dart:async`). The first element of this array is a pseudo-dependency |
| 1290 * representing the library itself (it is also used for `dynamic` and | 1235 * representing the library itself (it is also used for `dynamic` and |
| 1291 * `void`). This is followed by elements representing "prelinked" | 1236 * `void`). This is followed by elements representing "prelinked" |
| 1292 * dependencies (direct imports and the transitive closure of exports). | 1237 * dependencies (direct imports and the transitive closure of exports). |
| 1293 * After the prelinked dependencies are elements representing "linked" | 1238 * After the prelinked dependencies are elements representing "linked" |
| 1294 * dependencies. | 1239 * dependencies. |
| 1295 * | 1240 * |
| 1296 * A library is only included as a "linked" dependency if it is a true | 1241 * A library is only included as a "linked" dependency if it is a true |
| 1297 * dependency (e.g. a propagated or inferred type or constant value | 1242 * dependency (e.g. a propagated or inferred type or constant value |
| 1298 * implicitly refers to an element declared in the library) or | 1243 * implicitly refers to an element declared in the library) or |
| 1299 * anti-dependency (e.g. the result of type propagation or type inference | 1244 * anti-dependency (e.g. the result of type propagation or type inference |
| 1300 * depends on the lack of a certain declaration in the library). | 1245 * depends on the lack of a certain declaration in the library). |
| 1301 */ | 1246 */ |
| 1302 void set dependencies(List<LinkedDependencyBuilder> _value) { | 1247 void set dependencies(List<LinkedDependencyBuilder> _value) { |
| 1303 assert(!_finished); | |
| 1304 _dependencies = _value; | 1248 _dependencies = _value; |
| 1305 } | 1249 } |
| 1306 | 1250 |
| 1307 @override | 1251 @override |
| 1308 List<int> get exportDependencies => _exportDependencies ??= <int>[]; | 1252 List<int> get exportDependencies => _exportDependencies ??= <int>[]; |
| 1309 | 1253 |
| 1310 /** | 1254 /** |
| 1311 * For each export in [UnlinkedUnit.exports], an index into [dependencies] | 1255 * For each export in [UnlinkedUnit.exports], an index into [dependencies] |
| 1312 * of the library being exported. | 1256 * of the library being exported. |
| 1313 */ | 1257 */ |
| 1314 void set exportDependencies(List<int> _value) { | 1258 void set exportDependencies(List<int> _value) { |
| 1315 assert(!_finished); | |
| 1316 assert(_value == null || _value.every((e) => e >= 0)); | 1259 assert(_value == null || _value.every((e) => e >= 0)); |
| 1317 _exportDependencies = _value; | 1260 _exportDependencies = _value; |
| 1318 } | 1261 } |
| 1319 | 1262 |
| 1320 @override | 1263 @override |
| 1321 List<LinkedExportNameBuilder> get exportNames => _exportNames ??= <LinkedExpor
tNameBuilder>[]; | 1264 List<LinkedExportNameBuilder> get exportNames => _exportNames ??= <LinkedExpor
tNameBuilder>[]; |
| 1322 | 1265 |
| 1323 /** | 1266 /** |
| 1324 * Information about entities in the export namespace of the library that are | 1267 * Information about entities in the export namespace of the library that are |
| 1325 * not in the public namespace of the library (that is, entities that are | 1268 * not in the public namespace of the library (that is, entities that are |
| 1326 * brought into the namespace via `export` directives). | 1269 * brought into the namespace via `export` directives). |
| 1327 * | 1270 * |
| 1328 * Sorted by name. | 1271 * Sorted by name. |
| 1329 */ | 1272 */ |
| 1330 void set exportNames(List<LinkedExportNameBuilder> _value) { | 1273 void set exportNames(List<LinkedExportNameBuilder> _value) { |
| 1331 assert(!_finished); | |
| 1332 _exportNames = _value; | 1274 _exportNames = _value; |
| 1333 } | 1275 } |
| 1334 | 1276 |
| 1335 @override | 1277 @override |
| 1336 bool get fallbackMode => _fallbackMode ??= false; | 1278 bool get fallbackMode => _fallbackMode ??= false; |
| 1337 | 1279 |
| 1338 /** | 1280 /** |
| 1339 * Indicates whether this library was summarized in "fallback mode". If | 1281 * Indicates whether this library was summarized in "fallback mode". If |
| 1340 * true, all other fields in the data structure have their default values. | 1282 * true, all other fields in the data structure have their default values. |
| 1341 */ | 1283 */ |
| 1342 void set fallbackMode(bool _value) { | 1284 void set fallbackMode(bool _value) { |
| 1343 assert(!_finished); | |
| 1344 _fallbackMode = _value; | 1285 _fallbackMode = _value; |
| 1345 } | 1286 } |
| 1346 | 1287 |
| 1347 @override | 1288 @override |
| 1348 List<int> get importDependencies => _importDependencies ??= <int>[]; | 1289 List<int> get importDependencies => _importDependencies ??= <int>[]; |
| 1349 | 1290 |
| 1350 /** | 1291 /** |
| 1351 * For each import in [UnlinkedUnit.imports], an index into [dependencies] | 1292 * For each import in [UnlinkedUnit.imports], an index into [dependencies] |
| 1352 * of the library being imported. | 1293 * of the library being imported. |
| 1353 */ | 1294 */ |
| 1354 void set importDependencies(List<int> _value) { | 1295 void set importDependencies(List<int> _value) { |
| 1355 assert(!_finished); | |
| 1356 assert(_value == null || _value.every((e) => e >= 0)); | 1296 assert(_value == null || _value.every((e) => e >= 0)); |
| 1357 _importDependencies = _value; | 1297 _importDependencies = _value; |
| 1358 } | 1298 } |
| 1359 | 1299 |
| 1360 @override | 1300 @override |
| 1361 int get numPrelinkedDependencies => _numPrelinkedDependencies ??= 0; | 1301 int get numPrelinkedDependencies => _numPrelinkedDependencies ??= 0; |
| 1362 | 1302 |
| 1363 /** | 1303 /** |
| 1364 * The number of elements in [dependencies] which are not "linked" | 1304 * The number of elements in [dependencies] which are not "linked" |
| 1365 * dependencies (that is, the number of libraries in the direct imports plus | 1305 * dependencies (that is, the number of libraries in the direct imports plus |
| 1366 * the transitive closure of exports, plus the library itself). | 1306 * the transitive closure of exports, plus the library itself). |
| 1367 */ | 1307 */ |
| 1368 void set numPrelinkedDependencies(int _value) { | 1308 void set numPrelinkedDependencies(int _value) { |
| 1369 assert(!_finished); | |
| 1370 assert(_value == null || _value >= 0); | 1309 assert(_value == null || _value >= 0); |
| 1371 _numPrelinkedDependencies = _value; | 1310 _numPrelinkedDependencies = _value; |
| 1372 } | 1311 } |
| 1373 | 1312 |
| 1374 @override | 1313 @override |
| 1375 List<LinkedUnitBuilder> get units => _units ??= <LinkedUnitBuilder>[]; | 1314 List<LinkedUnitBuilder> get units => _units ??= <LinkedUnitBuilder>[]; |
| 1376 | 1315 |
| 1377 /** | 1316 /** |
| 1378 * The linked summary of all the compilation units constituting the | 1317 * The linked summary of all the compilation units constituting the |
| 1379 * library. The summary of the defining compilation unit is listed first, | 1318 * library. The summary of the defining compilation unit is listed first, |
| 1380 * followed by the summary of each part, in the order of the `part` | 1319 * followed by the summary of each part, in the order of the `part` |
| 1381 * declarations in the defining compilation unit. | 1320 * declarations in the defining compilation unit. |
| 1382 */ | 1321 */ |
| 1383 void set units(List<LinkedUnitBuilder> _value) { | 1322 void set units(List<LinkedUnitBuilder> _value) { |
| 1384 assert(!_finished); | |
| 1385 _units = _value; | 1323 _units = _value; |
| 1386 } | 1324 } |
| 1387 | 1325 |
| 1388 LinkedLibraryBuilder({List<LinkedDependencyBuilder> dependencies, List<int> ex
portDependencies, List<LinkedExportNameBuilder> exportNames, bool fallbackMode,
List<int> importDependencies, int numPrelinkedDependencies, List<LinkedUnitBuild
er> units}) | 1326 LinkedLibraryBuilder({List<LinkedDependencyBuilder> dependencies, List<int> ex
portDependencies, List<LinkedExportNameBuilder> exportNames, bool fallbackMode,
List<int> importDependencies, int numPrelinkedDependencies, List<LinkedUnitBuild
er> units}) |
| 1389 : _dependencies = dependencies, | 1327 : _dependencies = dependencies, |
| 1390 _exportDependencies = exportDependencies, | 1328 _exportDependencies = exportDependencies, |
| 1391 _exportNames = exportNames, | 1329 _exportNames = exportNames, |
| 1392 _fallbackMode = fallbackMode, | 1330 _fallbackMode = fallbackMode, |
| 1393 _importDependencies = importDependencies, | 1331 _importDependencies = importDependencies, |
| 1394 _numPrelinkedDependencies = numPrelinkedDependencies, | 1332 _numPrelinkedDependencies = numPrelinkedDependencies, |
| 1395 _units = units; | 1333 _units = units; |
| 1396 | 1334 |
| 1397 /** | 1335 /** |
| 1398 * Flush [informative] data recursively. | 1336 * Flush [informative] data recursively. |
| 1399 */ | 1337 */ |
| 1400 void flushInformative() { | 1338 void flushInformative() { |
| 1401 _dependencies?.forEach((b) => b.flushInformative()); | 1339 _dependencies?.forEach((b) => b.flushInformative()); |
| 1402 _exportNames?.forEach((b) => b.flushInformative()); | 1340 _exportNames?.forEach((b) => b.flushInformative()); |
| 1403 _units?.forEach((b) => b.flushInformative()); | 1341 _units?.forEach((b) => b.flushInformative()); |
| 1404 } | 1342 } |
| 1405 | 1343 |
| 1406 List<int> toBuffer() { | 1344 List<int> toBuffer() { |
| 1407 fb.Builder fbBuilder = new fb.Builder(); | 1345 fb.Builder fbBuilder = new fb.Builder(); |
| 1408 return fbBuilder.finish(finish(fbBuilder), "LLib"); | 1346 return fbBuilder.finish(finish(fbBuilder), "LLib"); |
| 1409 } | 1347 } |
| 1410 | 1348 |
| 1411 fb.Offset finish(fb.Builder fbBuilder) { | 1349 fb.Offset finish(fb.Builder fbBuilder) { |
| 1412 assert(!_finished); | |
| 1413 _finished = true; | |
| 1414 fb.Offset offset_dependencies; | 1350 fb.Offset offset_dependencies; |
| 1415 fb.Offset offset_exportDependencies; | 1351 fb.Offset offset_exportDependencies; |
| 1416 fb.Offset offset_exportNames; | 1352 fb.Offset offset_exportNames; |
| 1417 fb.Offset offset_importDependencies; | 1353 fb.Offset offset_importDependencies; |
| 1418 fb.Offset offset_units; | 1354 fb.Offset offset_units; |
| 1419 if (!(_dependencies == null || _dependencies.isEmpty)) { | 1355 if (!(_dependencies == null || _dependencies.isEmpty)) { |
| 1420 offset_dependencies = fbBuilder.writeList(_dependencies.map((b) => b.finis
h(fbBuilder)).toList()); | 1356 offset_dependencies = fbBuilder.writeList(_dependencies.map((b) => b.finis
h(fbBuilder)).toList()); |
| 1421 } | 1357 } |
| 1422 if (!(_exportDependencies == null || _exportDependencies.isEmpty)) { | 1358 if (!(_exportDependencies == null || _exportDependencies.isEmpty)) { |
| 1423 offset_exportDependencies = fbBuilder.writeListUint32(_exportDependencies)
; | 1359 offset_exportDependencies = fbBuilder.writeListUint32(_exportDependencies)
; |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1549 "importDependencies": importDependencies, | 1485 "importDependencies": importDependencies, |
| 1550 "numPrelinkedDependencies": numPrelinkedDependencies, | 1486 "numPrelinkedDependencies": numPrelinkedDependencies, |
| 1551 "units": units, | 1487 "units": units, |
| 1552 }; | 1488 }; |
| 1553 | 1489 |
| 1554 @override | 1490 @override |
| 1555 String toString() => convert.JSON.encode(toJson()); | 1491 String toString() => convert.JSON.encode(toJson()); |
| 1556 } | 1492 } |
| 1557 | 1493 |
| 1558 class LinkedReferenceBuilder extends Object with _LinkedReferenceMixin implement
s idl.LinkedReference { | 1494 class LinkedReferenceBuilder extends Object with _LinkedReferenceMixin implement
s idl.LinkedReference { |
| 1559 bool _finished = false; | |
| 1560 | |
| 1561 int _containingReference; | 1495 int _containingReference; |
| 1562 int _dependency; | 1496 int _dependency; |
| 1563 idl.ReferenceKind _kind; | 1497 idl.ReferenceKind _kind; |
| 1564 int _localIndex; | 1498 int _localIndex; |
| 1565 String _name; | 1499 String _name; |
| 1566 int _numTypeParameters; | 1500 int _numTypeParameters; |
| 1567 int _unit; | 1501 int _unit; |
| 1568 | 1502 |
| 1569 @override | 1503 @override |
| 1570 int get containingReference => _containingReference ??= 0; | 1504 int get containingReference => _containingReference ??= 0; |
| 1571 | 1505 |
| 1572 /** | 1506 /** |
| 1573 * If this [LinkedReference] doesn't have an associated [UnlinkedReference], | 1507 * If this [LinkedReference] doesn't have an associated [UnlinkedReference], |
| 1574 * and the entity being referred to is contained within another entity, index | 1508 * and the entity being referred to is contained within another entity, index |
| 1575 * of the containing entity. This behaves similarly to | 1509 * of the containing entity. This behaves similarly to |
| 1576 * [UnlinkedReference.prefixReference], however it is only used for class | 1510 * [UnlinkedReference.prefixReference], however it is only used for class |
| 1577 * members, not for prefixed imports. | 1511 * members, not for prefixed imports. |
| 1578 * | 1512 * |
| 1579 * Containing references must always point backward; that is, for all i, if | 1513 * Containing references must always point backward; that is, for all i, if |
| 1580 * LinkedUnit.references[i].containingReference != 0, then | 1514 * LinkedUnit.references[i].containingReference != 0, then |
| 1581 * LinkedUnit.references[i].containingReference < i. | 1515 * LinkedUnit.references[i].containingReference < i. |
| 1582 */ | 1516 */ |
| 1583 void set containingReference(int _value) { | 1517 void set containingReference(int _value) { |
| 1584 assert(!_finished); | |
| 1585 assert(_value == null || _value >= 0); | 1518 assert(_value == null || _value >= 0); |
| 1586 _containingReference = _value; | 1519 _containingReference = _value; |
| 1587 } | 1520 } |
| 1588 | 1521 |
| 1589 @override | 1522 @override |
| 1590 int get dependency => _dependency ??= 0; | 1523 int get dependency => _dependency ??= 0; |
| 1591 | 1524 |
| 1592 /** | 1525 /** |
| 1593 * Index into [LinkedLibrary.dependencies] indicating which imported library | 1526 * Index into [LinkedLibrary.dependencies] indicating which imported library |
| 1594 * declares the entity being referred to. | 1527 * declares the entity being referred to. |
| 1595 * | 1528 * |
| 1596 * Zero if this entity is contained within another entity (e.g. a class | 1529 * Zero if this entity is contained within another entity (e.g. a class |
| 1597 * member), or if [kind] is [ReferenceKind.prefix]. | 1530 * member), or if [kind] is [ReferenceKind.prefix]. |
| 1598 */ | 1531 */ |
| 1599 void set dependency(int _value) { | 1532 void set dependency(int _value) { |
| 1600 assert(!_finished); | |
| 1601 assert(_value == null || _value >= 0); | 1533 assert(_value == null || _value >= 0); |
| 1602 _dependency = _value; | 1534 _dependency = _value; |
| 1603 } | 1535 } |
| 1604 | 1536 |
| 1605 @override | 1537 @override |
| 1606 idl.ReferenceKind get kind => _kind ??= idl.ReferenceKind.classOrEnum; | 1538 idl.ReferenceKind get kind => _kind ??= idl.ReferenceKind.classOrEnum; |
| 1607 | 1539 |
| 1608 /** | 1540 /** |
| 1609 * The kind of the entity being referred to. For the pseudo-types `dynamic` | 1541 * The kind of the entity being referred to. For the pseudo-types `dynamic` |
| 1610 * and `void`, the kind is [ReferenceKind.classOrEnum]. | 1542 * and `void`, the kind is [ReferenceKind.classOrEnum]. |
| 1611 */ | 1543 */ |
| 1612 void set kind(idl.ReferenceKind _value) { | 1544 void set kind(idl.ReferenceKind _value) { |
| 1613 assert(!_finished); | |
| 1614 _kind = _value; | 1545 _kind = _value; |
| 1615 } | 1546 } |
| 1616 | 1547 |
| 1617 @override | 1548 @override |
| 1618 int get localIndex => _localIndex ??= 0; | 1549 int get localIndex => _localIndex ??= 0; |
| 1619 | 1550 |
| 1620 /** | 1551 /** |
| 1621 * If [kind] is [ReferenceKind.function] (that is, the entity being referred | 1552 * If [kind] is [ReferenceKind.function] (that is, the entity being referred |
| 1622 * to is a local function), the index of the function within | 1553 * to is a local function), the index of the function within |
| 1623 * [UnlinkedExecutable.localFunctions]. If [kind] is | 1554 * [UnlinkedExecutable.localFunctions]. If [kind] is |
| 1624 * [ReferenceKind.variable], the index of the variable within | 1555 * [ReferenceKind.variable], the index of the variable within |
| 1625 * [UnlinkedExecutable.localVariables]. Otherwise zero. | 1556 * [UnlinkedExecutable.localVariables]. Otherwise zero. |
| 1626 */ | 1557 */ |
| 1627 void set localIndex(int _value) { | 1558 void set localIndex(int _value) { |
| 1628 assert(!_finished); | |
| 1629 assert(_value == null || _value >= 0); | 1559 assert(_value == null || _value >= 0); |
| 1630 _localIndex = _value; | 1560 _localIndex = _value; |
| 1631 } | 1561 } |
| 1632 | 1562 |
| 1633 @override | 1563 @override |
| 1634 String get name => _name ??= ''; | 1564 String get name => _name ??= ''; |
| 1635 | 1565 |
| 1636 /** | 1566 /** |
| 1637 * If this [LinkedReference] doesn't have an associated [UnlinkedReference], | 1567 * If this [LinkedReference] doesn't have an associated [UnlinkedReference], |
| 1638 * name of the entity being referred to. For the pseudo-type `dynamic`, the | 1568 * name of the entity being referred to. For the pseudo-type `dynamic`, the |
| 1639 * string is "dynamic". For the pseudo-type `void`, the string is "void". | 1569 * string is "dynamic". For the pseudo-type `void`, the string is "void". |
| 1640 */ | 1570 */ |
| 1641 void set name(String _value) { | 1571 void set name(String _value) { |
| 1642 assert(!_finished); | |
| 1643 _name = _value; | 1572 _name = _value; |
| 1644 } | 1573 } |
| 1645 | 1574 |
| 1646 @override | 1575 @override |
| 1647 int get numTypeParameters => _numTypeParameters ??= 0; | 1576 int get numTypeParameters => _numTypeParameters ??= 0; |
| 1648 | 1577 |
| 1649 /** | 1578 /** |
| 1650 * If the entity being referred to is generic, the number of type parameters | 1579 * If the entity being referred to is generic, the number of type parameters |
| 1651 * it declares (does not include type parameters of enclosing entities). | 1580 * it declares (does not include type parameters of enclosing entities). |
| 1652 * Otherwise zero. | 1581 * Otherwise zero. |
| 1653 */ | 1582 */ |
| 1654 void set numTypeParameters(int _value) { | 1583 void set numTypeParameters(int _value) { |
| 1655 assert(!_finished); | |
| 1656 assert(_value == null || _value >= 0); | 1584 assert(_value == null || _value >= 0); |
| 1657 _numTypeParameters = _value; | 1585 _numTypeParameters = _value; |
| 1658 } | 1586 } |
| 1659 | 1587 |
| 1660 @override | 1588 @override |
| 1661 int get unit => _unit ??= 0; | 1589 int get unit => _unit ??= 0; |
| 1662 | 1590 |
| 1663 /** | 1591 /** |
| 1664 * Integer index indicating which unit in the imported library contains the | 1592 * Integer index indicating which unit in the imported library contains the |
| 1665 * definition of the entity. As with indices into [LinkedLibrary.units], | 1593 * definition of the entity. As with indices into [LinkedLibrary.units], |
| 1666 * zero represents the defining compilation unit, and nonzero values | 1594 * zero represents the defining compilation unit, and nonzero values |
| 1667 * represent parts in the order of the corresponding `part` declarations. | 1595 * represent parts in the order of the corresponding `part` declarations. |
| 1668 * | 1596 * |
| 1669 * Zero if this entity is contained within another entity (e.g. a class | 1597 * Zero if this entity is contained within another entity (e.g. a class |
| 1670 * member). | 1598 * member). |
| 1671 */ | 1599 */ |
| 1672 void set unit(int _value) { | 1600 void set unit(int _value) { |
| 1673 assert(!_finished); | |
| 1674 assert(_value == null || _value >= 0); | 1601 assert(_value == null || _value >= 0); |
| 1675 _unit = _value; | 1602 _unit = _value; |
| 1676 } | 1603 } |
| 1677 | 1604 |
| 1678 LinkedReferenceBuilder({int containingReference, int dependency, idl.Reference
Kind kind, int localIndex, String name, int numTypeParameters, int unit}) | 1605 LinkedReferenceBuilder({int containingReference, int dependency, idl.Reference
Kind kind, int localIndex, String name, int numTypeParameters, int unit}) |
| 1679 : _containingReference = containingReference, | 1606 : _containingReference = containingReference, |
| 1680 _dependency = dependency, | 1607 _dependency = dependency, |
| 1681 _kind = kind, | 1608 _kind = kind, |
| 1682 _localIndex = localIndex, | 1609 _localIndex = localIndex, |
| 1683 _name = name, | 1610 _name = name, |
| 1684 _numTypeParameters = numTypeParameters, | 1611 _numTypeParameters = numTypeParameters, |
| 1685 _unit = unit; | 1612 _unit = unit; |
| 1686 | 1613 |
| 1687 /** | 1614 /** |
| 1688 * Flush [informative] data recursively. | 1615 * Flush [informative] data recursively. |
| 1689 */ | 1616 */ |
| 1690 void flushInformative() { | 1617 void flushInformative() { |
| 1691 } | 1618 } |
| 1692 | 1619 |
| 1693 fb.Offset finish(fb.Builder fbBuilder) { | 1620 fb.Offset finish(fb.Builder fbBuilder) { |
| 1694 assert(!_finished); | |
| 1695 _finished = true; | |
| 1696 fb.Offset offset_name; | 1621 fb.Offset offset_name; |
| 1697 if (_name != null) { | 1622 if (_name != null) { |
| 1698 offset_name = fbBuilder.writeString(_name); | 1623 offset_name = fbBuilder.writeString(_name); |
| 1699 } | 1624 } |
| 1700 fbBuilder.startTable(); | 1625 fbBuilder.startTable(); |
| 1701 if (_containingReference != null && _containingReference != 0) { | 1626 if (_containingReference != null && _containingReference != 0) { |
| 1702 fbBuilder.addUint32(5, _containingReference); | 1627 fbBuilder.addUint32(5, _containingReference); |
| 1703 } | 1628 } |
| 1704 if (_dependency != null && _dependency != 0) { | 1629 if (_dependency != null && _dependency != 0) { |
| 1705 fbBuilder.addUint32(1, _dependency); | 1630 fbBuilder.addUint32(1, _dependency); |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1810 "name": name, | 1735 "name": name, |
| 1811 "numTypeParameters": numTypeParameters, | 1736 "numTypeParameters": numTypeParameters, |
| 1812 "unit": unit, | 1737 "unit": unit, |
| 1813 }; | 1738 }; |
| 1814 | 1739 |
| 1815 @override | 1740 @override |
| 1816 String toString() => convert.JSON.encode(toJson()); | 1741 String toString() => convert.JSON.encode(toJson()); |
| 1817 } | 1742 } |
| 1818 | 1743 |
| 1819 class LinkedUnitBuilder extends Object with _LinkedUnitMixin implements idl.Link
edUnit { | 1744 class LinkedUnitBuilder extends Object with _LinkedUnitMixin implements idl.Link
edUnit { |
| 1820 bool _finished = false; | |
| 1821 | |
| 1822 List<int> _constCycles; | 1745 List<int> _constCycles; |
| 1823 List<LinkedReferenceBuilder> _references; | 1746 List<LinkedReferenceBuilder> _references; |
| 1824 List<EntityRefBuilder> _types; | 1747 List<EntityRefBuilder> _types; |
| 1825 | 1748 |
| 1826 @override | 1749 @override |
| 1827 List<int> get constCycles => _constCycles ??= <int>[]; | 1750 List<int> get constCycles => _constCycles ??= <int>[]; |
| 1828 | 1751 |
| 1829 /** | 1752 /** |
| 1830 * List of slot ids (referring to [UnlinkedExecutable.constCycleSlot]) | 1753 * List of slot ids (referring to [UnlinkedExecutable.constCycleSlot]) |
| 1831 * corresponding to const constructors that are part of cycles. | 1754 * corresponding to const constructors that are part of cycles. |
| 1832 */ | 1755 */ |
| 1833 void set constCycles(List<int> _value) { | 1756 void set constCycles(List<int> _value) { |
| 1834 assert(!_finished); | |
| 1835 assert(_value == null || _value.every((e) => e >= 0)); | 1757 assert(_value == null || _value.every((e) => e >= 0)); |
| 1836 _constCycles = _value; | 1758 _constCycles = _value; |
| 1837 } | 1759 } |
| 1838 | 1760 |
| 1839 @override | 1761 @override |
| 1840 List<LinkedReferenceBuilder> get references => _references ??= <LinkedReferenc
eBuilder>[]; | 1762 List<LinkedReferenceBuilder> get references => _references ??= <LinkedReferenc
eBuilder>[]; |
| 1841 | 1763 |
| 1842 /** | 1764 /** |
| 1843 * Information about the resolution of references within the compilation | 1765 * Information about the resolution of references within the compilation |
| 1844 * unit. Each element of [UnlinkedUnit.references] has a corresponding | 1766 * unit. Each element of [UnlinkedUnit.references] has a corresponding |
| 1845 * element in this list (at the same index). If this list has additional | 1767 * element in this list (at the same index). If this list has additional |
| 1846 * elements beyond the number of elements in [UnlinkedUnit.references], those | 1768 * elements beyond the number of elements in [UnlinkedUnit.references], those |
| 1847 * additional elements are references that are only referred to implicitly | 1769 * additional elements are references that are only referred to implicitly |
| 1848 * (e.g. elements involved in inferred or propagated types). | 1770 * (e.g. elements involved in inferred or propagated types). |
| 1849 */ | 1771 */ |
| 1850 void set references(List<LinkedReferenceBuilder> _value) { | 1772 void set references(List<LinkedReferenceBuilder> _value) { |
| 1851 assert(!_finished); | |
| 1852 _references = _value; | 1773 _references = _value; |
| 1853 } | 1774 } |
| 1854 | 1775 |
| 1855 @override | 1776 @override |
| 1856 List<EntityRefBuilder> get types => _types ??= <EntityRefBuilder>[]; | 1777 List<EntityRefBuilder> get types => _types ??= <EntityRefBuilder>[]; |
| 1857 | 1778 |
| 1858 /** | 1779 /** |
| 1859 * List associating slot ids found inside the unlinked summary for the | 1780 * List associating slot ids found inside the unlinked summary for the |
| 1860 * compilation unit with propagated and inferred types. | 1781 * compilation unit with propagated and inferred types. |
| 1861 */ | 1782 */ |
| 1862 void set types(List<EntityRefBuilder> _value) { | 1783 void set types(List<EntityRefBuilder> _value) { |
| 1863 assert(!_finished); | |
| 1864 _types = _value; | 1784 _types = _value; |
| 1865 } | 1785 } |
| 1866 | 1786 |
| 1867 LinkedUnitBuilder({List<int> constCycles, List<LinkedReferenceBuilder> referen
ces, List<EntityRefBuilder> types}) | 1787 LinkedUnitBuilder({List<int> constCycles, List<LinkedReferenceBuilder> referen
ces, List<EntityRefBuilder> types}) |
| 1868 : _constCycles = constCycles, | 1788 : _constCycles = constCycles, |
| 1869 _references = references, | 1789 _references = references, |
| 1870 _types = types; | 1790 _types = types; |
| 1871 | 1791 |
| 1872 /** | 1792 /** |
| 1873 * Flush [informative] data recursively. | 1793 * Flush [informative] data recursively. |
| 1874 */ | 1794 */ |
| 1875 void flushInformative() { | 1795 void flushInformative() { |
| 1876 _references?.forEach((b) => b.flushInformative()); | 1796 _references?.forEach((b) => b.flushInformative()); |
| 1877 _types?.forEach((b) => b.flushInformative()); | 1797 _types?.forEach((b) => b.flushInformative()); |
| 1878 } | 1798 } |
| 1879 | 1799 |
| 1880 fb.Offset finish(fb.Builder fbBuilder) { | 1800 fb.Offset finish(fb.Builder fbBuilder) { |
| 1881 assert(!_finished); | |
| 1882 _finished = true; | |
| 1883 fb.Offset offset_constCycles; | 1801 fb.Offset offset_constCycles; |
| 1884 fb.Offset offset_references; | 1802 fb.Offset offset_references; |
| 1885 fb.Offset offset_types; | 1803 fb.Offset offset_types; |
| 1886 if (!(_constCycles == null || _constCycles.isEmpty)) { | 1804 if (!(_constCycles == null || _constCycles.isEmpty)) { |
| 1887 offset_constCycles = fbBuilder.writeListUint32(_constCycles); | 1805 offset_constCycles = fbBuilder.writeListUint32(_constCycles); |
| 1888 } | 1806 } |
| 1889 if (!(_references == null || _references.isEmpty)) { | 1807 if (!(_references == null || _references.isEmpty)) { |
| 1890 offset_references = fbBuilder.writeList(_references.map((b) => b.finish(fb
Builder)).toList()); | 1808 offset_references = fbBuilder.writeList(_references.map((b) => b.finish(fb
Builder)).toList()); |
| 1891 } | 1809 } |
| 1892 if (!(_types == null || _types.isEmpty)) { | 1810 if (!(_types == null || _types.isEmpty)) { |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1957 "constCycles": constCycles, | 1875 "constCycles": constCycles, |
| 1958 "references": references, | 1876 "references": references, |
| 1959 "types": types, | 1877 "types": types, |
| 1960 }; | 1878 }; |
| 1961 | 1879 |
| 1962 @override | 1880 @override |
| 1963 String toString() => convert.JSON.encode(toJson()); | 1881 String toString() => convert.JSON.encode(toJson()); |
| 1964 } | 1882 } |
| 1965 | 1883 |
| 1966 class PackageBundleBuilder extends Object with _PackageBundleMixin implements id
l.PackageBundle { | 1884 class PackageBundleBuilder extends Object with _PackageBundleMixin implements id
l.PackageBundle { |
| 1967 bool _finished = false; | |
| 1968 | |
| 1969 List<LinkedLibraryBuilder> _linkedLibraries; | 1885 List<LinkedLibraryBuilder> _linkedLibraries; |
| 1970 List<String> _linkedLibraryUris; | 1886 List<String> _linkedLibraryUris; |
| 1971 int _majorVersion; | 1887 int _majorVersion; |
| 1972 int _minorVersion; | 1888 int _minorVersion; |
| 1973 List<String> _unlinkedUnitHashes; | 1889 List<String> _unlinkedUnitHashes; |
| 1974 List<UnlinkedUnitBuilder> _unlinkedUnits; | 1890 List<UnlinkedUnitBuilder> _unlinkedUnits; |
| 1975 List<String> _unlinkedUnitUris; | 1891 List<String> _unlinkedUnitUris; |
| 1976 | 1892 |
| 1977 @override | 1893 @override |
| 1978 List<LinkedLibraryBuilder> get linkedLibraries => _linkedLibraries ??= <Linked
LibraryBuilder>[]; | 1894 List<LinkedLibraryBuilder> get linkedLibraries => _linkedLibraries ??= <Linked
LibraryBuilder>[]; |
| 1979 | 1895 |
| 1980 /** | 1896 /** |
| 1981 * Linked libraries. | 1897 * Linked libraries. |
| 1982 */ | 1898 */ |
| 1983 void set linkedLibraries(List<LinkedLibraryBuilder> _value) { | 1899 void set linkedLibraries(List<LinkedLibraryBuilder> _value) { |
| 1984 assert(!_finished); | |
| 1985 _linkedLibraries = _value; | 1900 _linkedLibraries = _value; |
| 1986 } | 1901 } |
| 1987 | 1902 |
| 1988 @override | 1903 @override |
| 1989 List<String> get linkedLibraryUris => _linkedLibraryUris ??= <String>[]; | 1904 List<String> get linkedLibraryUris => _linkedLibraryUris ??= <String>[]; |
| 1990 | 1905 |
| 1991 /** | 1906 /** |
| 1992 * The list of URIs of items in [linkedLibraries], e.g. `dart:core` or | 1907 * The list of URIs of items in [linkedLibraries], e.g. `dart:core` or |
| 1993 * `package:foo/bar.dart`. | 1908 * `package:foo/bar.dart`. |
| 1994 */ | 1909 */ |
| 1995 void set linkedLibraryUris(List<String> _value) { | 1910 void set linkedLibraryUris(List<String> _value) { |
| 1996 assert(!_finished); | |
| 1997 _linkedLibraryUris = _value; | 1911 _linkedLibraryUris = _value; |
| 1998 } | 1912 } |
| 1999 | 1913 |
| 2000 @override | 1914 @override |
| 2001 int get majorVersion => _majorVersion ??= 0; | 1915 int get majorVersion => _majorVersion ??= 0; |
| 2002 | 1916 |
| 2003 /** | 1917 /** |
| 2004 * Major version of the summary format. See | 1918 * Major version of the summary format. See |
| 2005 * [PackageBundleAssembler.currentMajorVersion]. | 1919 * [PackageBundleAssembler.currentMajorVersion]. |
| 2006 */ | 1920 */ |
| 2007 void set majorVersion(int _value) { | 1921 void set majorVersion(int _value) { |
| 2008 assert(!_finished); | |
| 2009 assert(_value == null || _value >= 0); | 1922 assert(_value == null || _value >= 0); |
| 2010 _majorVersion = _value; | 1923 _majorVersion = _value; |
| 2011 } | 1924 } |
| 2012 | 1925 |
| 2013 @override | 1926 @override |
| 2014 int get minorVersion => _minorVersion ??= 0; | 1927 int get minorVersion => _minorVersion ??= 0; |
| 2015 | 1928 |
| 2016 /** | 1929 /** |
| 2017 * Minor version of the summary format. See | 1930 * Minor version of the summary format. See |
| 2018 * [PackageBundleAssembler.currentMinorVersion]. | 1931 * [PackageBundleAssembler.currentMinorVersion]. |
| 2019 */ | 1932 */ |
| 2020 void set minorVersion(int _value) { | 1933 void set minorVersion(int _value) { |
| 2021 assert(!_finished); | |
| 2022 assert(_value == null || _value >= 0); | 1934 assert(_value == null || _value >= 0); |
| 2023 _minorVersion = _value; | 1935 _minorVersion = _value; |
| 2024 } | 1936 } |
| 2025 | 1937 |
| 2026 @override | 1938 @override |
| 2027 List<String> get unlinkedUnitHashes => _unlinkedUnitHashes ??= <String>[]; | 1939 List<String> get unlinkedUnitHashes => _unlinkedUnitHashes ??= <String>[]; |
| 2028 | 1940 |
| 2029 /** | 1941 /** |
| 2030 * List of MD5 hashes of the files listed in [unlinkedUnitUris]. Each hash | 1942 * List of MD5 hashes of the files listed in [unlinkedUnitUris]. Each hash |
| 2031 * is encoded as a hexadecimal string using lower case letters. | 1943 * is encoded as a hexadecimal string using lower case letters. |
| 2032 */ | 1944 */ |
| 2033 void set unlinkedUnitHashes(List<String> _value) { | 1945 void set unlinkedUnitHashes(List<String> _value) { |
| 2034 assert(!_finished); | |
| 2035 _unlinkedUnitHashes = _value; | 1946 _unlinkedUnitHashes = _value; |
| 2036 } | 1947 } |
| 2037 | 1948 |
| 2038 @override | 1949 @override |
| 2039 List<UnlinkedUnitBuilder> get unlinkedUnits => _unlinkedUnits ??= <UnlinkedUni
tBuilder>[]; | 1950 List<UnlinkedUnitBuilder> get unlinkedUnits => _unlinkedUnits ??= <UnlinkedUni
tBuilder>[]; |
| 2040 | 1951 |
| 2041 /** | 1952 /** |
| 2042 * Unlinked information for the compilation units constituting the package. | 1953 * Unlinked information for the compilation units constituting the package. |
| 2043 */ | 1954 */ |
| 2044 void set unlinkedUnits(List<UnlinkedUnitBuilder> _value) { | 1955 void set unlinkedUnits(List<UnlinkedUnitBuilder> _value) { |
| 2045 assert(!_finished); | |
| 2046 _unlinkedUnits = _value; | 1956 _unlinkedUnits = _value; |
| 2047 } | 1957 } |
| 2048 | 1958 |
| 2049 @override | 1959 @override |
| 2050 List<String> get unlinkedUnitUris => _unlinkedUnitUris ??= <String>[]; | 1960 List<String> get unlinkedUnitUris => _unlinkedUnitUris ??= <String>[]; |
| 2051 | 1961 |
| 2052 /** | 1962 /** |
| 2053 * The list of URIs of items in [unlinkedUnits], e.g. `dart:core/bool.dart`. | 1963 * The list of URIs of items in [unlinkedUnits], e.g. `dart:core/bool.dart`. |
| 2054 */ | 1964 */ |
| 2055 void set unlinkedUnitUris(List<String> _value) { | 1965 void set unlinkedUnitUris(List<String> _value) { |
| 2056 assert(!_finished); | |
| 2057 _unlinkedUnitUris = _value; | 1966 _unlinkedUnitUris = _value; |
| 2058 } | 1967 } |
| 2059 | 1968 |
| 2060 PackageBundleBuilder({List<LinkedLibraryBuilder> linkedLibraries, List<String>
linkedLibraryUris, int majorVersion, int minorVersion, List<String> unlinkedUni
tHashes, List<UnlinkedUnitBuilder> unlinkedUnits, List<String> unlinkedUnitUris}
) | 1969 PackageBundleBuilder({List<LinkedLibraryBuilder> linkedLibraries, List<String>
linkedLibraryUris, int majorVersion, int minorVersion, List<String> unlinkedUni
tHashes, List<UnlinkedUnitBuilder> unlinkedUnits, List<String> unlinkedUnitUris}
) |
| 2061 : _linkedLibraries = linkedLibraries, | 1970 : _linkedLibraries = linkedLibraries, |
| 2062 _linkedLibraryUris = linkedLibraryUris, | 1971 _linkedLibraryUris = linkedLibraryUris, |
| 2063 _majorVersion = majorVersion, | 1972 _majorVersion = majorVersion, |
| 2064 _minorVersion = minorVersion, | 1973 _minorVersion = minorVersion, |
| 2065 _unlinkedUnitHashes = unlinkedUnitHashes, | 1974 _unlinkedUnitHashes = unlinkedUnitHashes, |
| 2066 _unlinkedUnits = unlinkedUnits, | 1975 _unlinkedUnits = unlinkedUnits, |
| 2067 _unlinkedUnitUris = unlinkedUnitUris; | 1976 _unlinkedUnitUris = unlinkedUnitUris; |
| 2068 | 1977 |
| 2069 /** | 1978 /** |
| 2070 * Flush [informative] data recursively. | 1979 * Flush [informative] data recursively. |
| 2071 */ | 1980 */ |
| 2072 void flushInformative() { | 1981 void flushInformative() { |
| 2073 _linkedLibraries?.forEach((b) => b.flushInformative()); | 1982 _linkedLibraries?.forEach((b) => b.flushInformative()); |
| 2074 _unlinkedUnitHashes = null; | 1983 _unlinkedUnitHashes = null; |
| 2075 _unlinkedUnits?.forEach((b) => b.flushInformative()); | 1984 _unlinkedUnits?.forEach((b) => b.flushInformative()); |
| 2076 } | 1985 } |
| 2077 | 1986 |
| 2078 List<int> toBuffer() { | 1987 List<int> toBuffer() { |
| 2079 fb.Builder fbBuilder = new fb.Builder(); | 1988 fb.Builder fbBuilder = new fb.Builder(); |
| 2080 return fbBuilder.finish(finish(fbBuilder), "PBdl"); | 1989 return fbBuilder.finish(finish(fbBuilder), "PBdl"); |
| 2081 } | 1990 } |
| 2082 | 1991 |
| 2083 fb.Offset finish(fb.Builder fbBuilder) { | 1992 fb.Offset finish(fb.Builder fbBuilder) { |
| 2084 assert(!_finished); | |
| 2085 _finished = true; | |
| 2086 fb.Offset offset_linkedLibraries; | 1993 fb.Offset offset_linkedLibraries; |
| 2087 fb.Offset offset_linkedLibraryUris; | 1994 fb.Offset offset_linkedLibraryUris; |
| 2088 fb.Offset offset_unlinkedUnitHashes; | 1995 fb.Offset offset_unlinkedUnitHashes; |
| 2089 fb.Offset offset_unlinkedUnits; | 1996 fb.Offset offset_unlinkedUnits; |
| 2090 fb.Offset offset_unlinkedUnitUris; | 1997 fb.Offset offset_unlinkedUnitUris; |
| 2091 if (!(_linkedLibraries == null || _linkedLibraries.isEmpty)) { | 1998 if (!(_linkedLibraries == null || _linkedLibraries.isEmpty)) { |
| 2092 offset_linkedLibraries = fbBuilder.writeList(_linkedLibraries.map((b) => b
.finish(fbBuilder)).toList()); | 1999 offset_linkedLibraries = fbBuilder.writeList(_linkedLibraries.map((b) => b
.finish(fbBuilder)).toList()); |
| 2093 } | 2000 } |
| 2094 if (!(_linkedLibraryUris == null || _linkedLibraryUris.isEmpty)) { | 2001 if (!(_linkedLibraryUris == null || _linkedLibraryUris.isEmpty)) { |
| 2095 offset_linkedLibraryUris = fbBuilder.writeList(_linkedLibraryUris.map((b)
=> fbBuilder.writeString(b)).toList()); | 2002 offset_linkedLibraryUris = fbBuilder.writeList(_linkedLibraryUris.map((b)
=> fbBuilder.writeString(b)).toList()); |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2221 "unlinkedUnitHashes": unlinkedUnitHashes, | 2128 "unlinkedUnitHashes": unlinkedUnitHashes, |
| 2222 "unlinkedUnits": unlinkedUnits, | 2129 "unlinkedUnits": unlinkedUnits, |
| 2223 "unlinkedUnitUris": unlinkedUnitUris, | 2130 "unlinkedUnitUris": unlinkedUnitUris, |
| 2224 }; | 2131 }; |
| 2225 | 2132 |
| 2226 @override | 2133 @override |
| 2227 String toString() => convert.JSON.encode(toJson()); | 2134 String toString() => convert.JSON.encode(toJson()); |
| 2228 } | 2135 } |
| 2229 | 2136 |
| 2230 class PackageIndexBuilder extends Object with _PackageIndexMixin implements idl.
PackageIndex { | 2137 class PackageIndexBuilder extends Object with _PackageIndexMixin implements idl.
PackageIndex { |
| 2231 bool _finished = false; | |
| 2232 | |
| 2233 List<idl.IndexSyntheticElementKind> _elementKinds; | 2138 List<idl.IndexSyntheticElementKind> _elementKinds; |
| 2234 List<int> _elementOffsets; | 2139 List<int> _elementOffsets; |
| 2235 List<int> _elementUnits; | 2140 List<int> _elementUnits; |
| 2236 List<String> _strings; | 2141 List<String> _strings; |
| 2237 List<int> _unitLibraryUris; | 2142 List<int> _unitLibraryUris; |
| 2238 List<UnitIndexBuilder> _units; | 2143 List<UnitIndexBuilder> _units; |
| 2239 List<int> _unitUnitUris; | 2144 List<int> _unitUnitUris; |
| 2240 | 2145 |
| 2241 @override | 2146 @override |
| 2242 List<idl.IndexSyntheticElementKind> get elementKinds => _elementKinds ??= <idl
.IndexSyntheticElementKind>[]; | 2147 List<idl.IndexSyntheticElementKind> get elementKinds => _elementKinds ??= <idl
.IndexSyntheticElementKind>[]; |
| 2243 | 2148 |
| 2244 /** | 2149 /** |
| 2245 * Each item of this list corresponds to a unique referenced element. It is | 2150 * Each item of this list corresponds to a unique referenced element. It is |
| 2246 * the kind of the synthetic element. | 2151 * the kind of the synthetic element. |
| 2247 */ | 2152 */ |
| 2248 void set elementKinds(List<idl.IndexSyntheticElementKind> _value) { | 2153 void set elementKinds(List<idl.IndexSyntheticElementKind> _value) { |
| 2249 assert(!_finished); | |
| 2250 _elementKinds = _value; | 2154 _elementKinds = _value; |
| 2251 } | 2155 } |
| 2252 | 2156 |
| 2253 @override | 2157 @override |
| 2254 List<int> get elementOffsets => _elementOffsets ??= <int>[]; | 2158 List<int> get elementOffsets => _elementOffsets ??= <int>[]; |
| 2255 | 2159 |
| 2256 /** | 2160 /** |
| 2257 * Each item of this list corresponds to a unique referenced element. It is | 2161 * Each item of this list corresponds to a unique referenced element. It is |
| 2258 * the offset of the element name relative to the beginning of the file. The | 2162 * the offset of the element name relative to the beginning of the file. The |
| 2259 * list is sorted in ascending order, so that the client can quickly check | 2163 * list is sorted in ascending order, so that the client can quickly check |
| 2260 * whether an element is referenced in this [PackageIndex]. | 2164 * whether an element is referenced in this [PackageIndex]. |
| 2261 */ | 2165 */ |
| 2262 void set elementOffsets(List<int> _value) { | 2166 void set elementOffsets(List<int> _value) { |
| 2263 assert(!_finished); | |
| 2264 assert(_value == null || _value.every((e) => e >= 0)); | 2167 assert(_value == null || _value.every((e) => e >= 0)); |
| 2265 _elementOffsets = _value; | 2168 _elementOffsets = _value; |
| 2266 } | 2169 } |
| 2267 | 2170 |
| 2268 @override | 2171 @override |
| 2269 List<int> get elementUnits => _elementUnits ??= <int>[]; | 2172 List<int> get elementUnits => _elementUnits ??= <int>[]; |
| 2270 | 2173 |
| 2271 /** | 2174 /** |
| 2272 * Each item of this list corresponds to a unique referenced element. It is | 2175 * Each item of this list corresponds to a unique referenced element. It is |
| 2273 * the index into [unitLibraryUris] and [unitUnitUris] for the library | 2176 * the index into [unitLibraryUris] and [unitUnitUris] for the library |
| 2274 * specific unit where the element is declared. | 2177 * specific unit where the element is declared. |
| 2275 */ | 2178 */ |
| 2276 void set elementUnits(List<int> _value) { | 2179 void set elementUnits(List<int> _value) { |
| 2277 assert(!_finished); | |
| 2278 assert(_value == null || _value.every((e) => e >= 0)); | 2180 assert(_value == null || _value.every((e) => e >= 0)); |
| 2279 _elementUnits = _value; | 2181 _elementUnits = _value; |
| 2280 } | 2182 } |
| 2281 | 2183 |
| 2282 @override | 2184 @override |
| 2283 List<String> get strings => _strings ??= <String>[]; | 2185 List<String> get strings => _strings ??= <String>[]; |
| 2284 | 2186 |
| 2285 /** | 2187 /** |
| 2286 * List of unique element strings used in this [PackageIndex]. The list is | 2188 * List of unique element strings used in this [PackageIndex]. The list is |
| 2287 * sorted in ascending order, so that the client can quickly check the | 2189 * sorted in ascending order, so that the client can quickly check the |
| 2288 * presence of a string in this [PackageIndex]. | 2190 * presence of a string in this [PackageIndex]. |
| 2289 */ | 2191 */ |
| 2290 void set strings(List<String> _value) { | 2192 void set strings(List<String> _value) { |
| 2291 assert(!_finished); | |
| 2292 _strings = _value; | 2193 _strings = _value; |
| 2293 } | 2194 } |
| 2294 | 2195 |
| 2295 @override | 2196 @override |
| 2296 List<int> get unitLibraryUris => _unitLibraryUris ??= <int>[]; | 2197 List<int> get unitLibraryUris => _unitLibraryUris ??= <int>[]; |
| 2297 | 2198 |
| 2298 /** | 2199 /** |
| 2299 * Each item of this list corresponds to the library URI of a unique library | 2200 * Each item of this list corresponds to the library URI of a unique library |
| 2300 * specific unit referenced in the [PackageIndex]. It is an index into | 2201 * specific unit referenced in the [PackageIndex]. It is an index into |
| 2301 * [strings] list. | 2202 * [strings] list. |
| 2302 */ | 2203 */ |
| 2303 void set unitLibraryUris(List<int> _value) { | 2204 void set unitLibraryUris(List<int> _value) { |
| 2304 assert(!_finished); | |
| 2305 assert(_value == null || _value.every((e) => e >= 0)); | 2205 assert(_value == null || _value.every((e) => e >= 0)); |
| 2306 _unitLibraryUris = _value; | 2206 _unitLibraryUris = _value; |
| 2307 } | 2207 } |
| 2308 | 2208 |
| 2309 @override | 2209 @override |
| 2310 List<UnitIndexBuilder> get units => _units ??= <UnitIndexBuilder>[]; | 2210 List<UnitIndexBuilder> get units => _units ??= <UnitIndexBuilder>[]; |
| 2311 | 2211 |
| 2312 /** | 2212 /** |
| 2313 * List of indexes of each unit in this [PackageIndex]. | 2213 * List of indexes of each unit in this [PackageIndex]. |
| 2314 */ | 2214 */ |
| 2315 void set units(List<UnitIndexBuilder> _value) { | 2215 void set units(List<UnitIndexBuilder> _value) { |
| 2316 assert(!_finished); | |
| 2317 _units = _value; | 2216 _units = _value; |
| 2318 } | 2217 } |
| 2319 | 2218 |
| 2320 @override | 2219 @override |
| 2321 List<int> get unitUnitUris => _unitUnitUris ??= <int>[]; | 2220 List<int> get unitUnitUris => _unitUnitUris ??= <int>[]; |
| 2322 | 2221 |
| 2323 /** | 2222 /** |
| 2324 * Each item of this list corresponds to the unit URI of a unique library | 2223 * Each item of this list corresponds to the unit URI of a unique library |
| 2325 * specific unit referenced in the [PackageIndex]. It is an index into | 2224 * specific unit referenced in the [PackageIndex]. It is an index into |
| 2326 * [strings] list. | 2225 * [strings] list. |
| 2327 */ | 2226 */ |
| 2328 void set unitUnitUris(List<int> _value) { | 2227 void set unitUnitUris(List<int> _value) { |
| 2329 assert(!_finished); | |
| 2330 assert(_value == null || _value.every((e) => e >= 0)); | 2228 assert(_value == null || _value.every((e) => e >= 0)); |
| 2331 _unitUnitUris = _value; | 2229 _unitUnitUris = _value; |
| 2332 } | 2230 } |
| 2333 | 2231 |
| 2334 PackageIndexBuilder({List<idl.IndexSyntheticElementKind> elementKinds, List<in
t> elementOffsets, List<int> elementUnits, List<String> strings, List<int> unitL
ibraryUris, List<UnitIndexBuilder> units, List<int> unitUnitUris}) | 2232 PackageIndexBuilder({List<idl.IndexSyntheticElementKind> elementKinds, List<in
t> elementOffsets, List<int> elementUnits, List<String> strings, List<int> unitL
ibraryUris, List<UnitIndexBuilder> units, List<int> unitUnitUris}) |
| 2335 : _elementKinds = elementKinds, | 2233 : _elementKinds = elementKinds, |
| 2336 _elementOffsets = elementOffsets, | 2234 _elementOffsets = elementOffsets, |
| 2337 _elementUnits = elementUnits, | 2235 _elementUnits = elementUnits, |
| 2338 _strings = strings, | 2236 _strings = strings, |
| 2339 _unitLibraryUris = unitLibraryUris, | 2237 _unitLibraryUris = unitLibraryUris, |
| 2340 _units = units, | 2238 _units = units, |
| 2341 _unitUnitUris = unitUnitUris; | 2239 _unitUnitUris = unitUnitUris; |
| 2342 | 2240 |
| 2343 /** | 2241 /** |
| 2344 * Flush [informative] data recursively. | 2242 * Flush [informative] data recursively. |
| 2345 */ | 2243 */ |
| 2346 void flushInformative() { | 2244 void flushInformative() { |
| 2347 _units?.forEach((b) => b.flushInformative()); | 2245 _units?.forEach((b) => b.flushInformative()); |
| 2348 } | 2246 } |
| 2349 | 2247 |
| 2350 List<int> toBuffer() { | 2248 List<int> toBuffer() { |
| 2351 fb.Builder fbBuilder = new fb.Builder(); | 2249 fb.Builder fbBuilder = new fb.Builder(); |
| 2352 return fbBuilder.finish(finish(fbBuilder), "Indx"); | 2250 return fbBuilder.finish(finish(fbBuilder), "Indx"); |
| 2353 } | 2251 } |
| 2354 | 2252 |
| 2355 fb.Offset finish(fb.Builder fbBuilder) { | 2253 fb.Offset finish(fb.Builder fbBuilder) { |
| 2356 assert(!_finished); | |
| 2357 _finished = true; | |
| 2358 fb.Offset offset_elementKinds; | 2254 fb.Offset offset_elementKinds; |
| 2359 fb.Offset offset_elementOffsets; | 2255 fb.Offset offset_elementOffsets; |
| 2360 fb.Offset offset_elementUnits; | 2256 fb.Offset offset_elementUnits; |
| 2361 fb.Offset offset_strings; | 2257 fb.Offset offset_strings; |
| 2362 fb.Offset offset_unitLibraryUris; | 2258 fb.Offset offset_unitLibraryUris; |
| 2363 fb.Offset offset_units; | 2259 fb.Offset offset_units; |
| 2364 fb.Offset offset_unitUnitUris; | 2260 fb.Offset offset_unitUnitUris; |
| 2365 if (!(_elementKinds == null || _elementKinds.isEmpty)) { | 2261 if (!(_elementKinds == null || _elementKinds.isEmpty)) { |
| 2366 offset_elementKinds = fbBuilder.writeListUint8(_elementKinds.map((b) => b.
index).toList()); | 2262 offset_elementKinds = fbBuilder.writeListUint8(_elementKinds.map((b) => b.
index).toList()); |
| 2367 } | 2263 } |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2501 "unitLibraryUris": unitLibraryUris, | 2397 "unitLibraryUris": unitLibraryUris, |
| 2502 "units": units, | 2398 "units": units, |
| 2503 "unitUnitUris": unitUnitUris, | 2399 "unitUnitUris": unitUnitUris, |
| 2504 }; | 2400 }; |
| 2505 | 2401 |
| 2506 @override | 2402 @override |
| 2507 String toString() => convert.JSON.encode(toJson()); | 2403 String toString() => convert.JSON.encode(toJson()); |
| 2508 } | 2404 } |
| 2509 | 2405 |
| 2510 class UnitIndexBuilder extends Object with _UnitIndexMixin implements idl.UnitIn
dex { | 2406 class UnitIndexBuilder extends Object with _UnitIndexMixin implements idl.UnitIn
dex { |
| 2511 bool _finished = false; | |
| 2512 | |
| 2513 List<idl.IndexNameKind> _definedNameKinds; | 2407 List<idl.IndexNameKind> _definedNameKinds; |
| 2514 List<int> _definedNameOffsets; | 2408 List<int> _definedNameOffsets; |
| 2515 List<int> _definedNames; | 2409 List<int> _definedNames; |
| 2516 int _unit; | 2410 int _unit; |
| 2517 List<bool> _usedElementIsQualifiedFlags; | 2411 List<bool> _usedElementIsQualifiedFlags; |
| 2518 List<idl.IndexRelationKind> _usedElementKinds; | 2412 List<idl.IndexRelationKind> _usedElementKinds; |
| 2519 List<int> _usedElementLengths; | 2413 List<int> _usedElementLengths; |
| 2520 List<int> _usedElementOffsets; | 2414 List<int> _usedElementOffsets; |
| 2521 List<int> _usedElements; | 2415 List<int> _usedElements; |
| 2522 List<bool> _usedNameIsQualifiedFlags; | 2416 List<bool> _usedNameIsQualifiedFlags; |
| 2523 List<idl.IndexRelationKind> _usedNameKinds; | 2417 List<idl.IndexRelationKind> _usedNameKinds; |
| 2524 List<int> _usedNameOffsets; | 2418 List<int> _usedNameOffsets; |
| 2525 List<int> _usedNames; | 2419 List<int> _usedNames; |
| 2526 | 2420 |
| 2527 @override | 2421 @override |
| 2528 List<idl.IndexNameKind> get definedNameKinds => _definedNameKinds ??= <idl.Ind
exNameKind>[]; | 2422 List<idl.IndexNameKind> get definedNameKinds => _definedNameKinds ??= <idl.Ind
exNameKind>[]; |
| 2529 | 2423 |
| 2530 /** | 2424 /** |
| 2531 * Each item of this list is the kind of an element defined in this unit. | 2425 * Each item of this list is the kind of an element defined in this unit. |
| 2532 */ | 2426 */ |
| 2533 void set definedNameKinds(List<idl.IndexNameKind> _value) { | 2427 void set definedNameKinds(List<idl.IndexNameKind> _value) { |
| 2534 assert(!_finished); | |
| 2535 _definedNameKinds = _value; | 2428 _definedNameKinds = _value; |
| 2536 } | 2429 } |
| 2537 | 2430 |
| 2538 @override | 2431 @override |
| 2539 List<int> get definedNameOffsets => _definedNameOffsets ??= <int>[]; | 2432 List<int> get definedNameOffsets => _definedNameOffsets ??= <int>[]; |
| 2540 | 2433 |
| 2541 /** | 2434 /** |
| 2542 * Each item of this list is the name offset of an element defined in this | 2435 * Each item of this list is the name offset of an element defined in this |
| 2543 * unit relative to the beginning of the file. | 2436 * unit relative to the beginning of the file. |
| 2544 */ | 2437 */ |
| 2545 void set definedNameOffsets(List<int> _value) { | 2438 void set definedNameOffsets(List<int> _value) { |
| 2546 assert(!_finished); | |
| 2547 assert(_value == null || _value.every((e) => e >= 0)); | 2439 assert(_value == null || _value.every((e) => e >= 0)); |
| 2548 _definedNameOffsets = _value; | 2440 _definedNameOffsets = _value; |
| 2549 } | 2441 } |
| 2550 | 2442 |
| 2551 @override | 2443 @override |
| 2552 List<int> get definedNames => _definedNames ??= <int>[]; | 2444 List<int> get definedNames => _definedNames ??= <int>[]; |
| 2553 | 2445 |
| 2554 /** | 2446 /** |
| 2555 * Each item of this list corresponds to an element defined in this unit. It | 2447 * Each item of this list corresponds to an element defined in this unit. It |
| 2556 * is an index into [PackageIndex.strings] list. The list is sorted in | 2448 * is an index into [PackageIndex.strings] list. The list is sorted in |
| 2557 * ascending order, so that the client can quickly find name definitions in | 2449 * ascending order, so that the client can quickly find name definitions in |
| 2558 * this [UnitIndex]. | 2450 * this [UnitIndex]. |
| 2559 */ | 2451 */ |
| 2560 void set definedNames(List<int> _value) { | 2452 void set definedNames(List<int> _value) { |
| 2561 assert(!_finished); | |
| 2562 assert(_value == null || _value.every((e) => e >= 0)); | 2453 assert(_value == null || _value.every((e) => e >= 0)); |
| 2563 _definedNames = _value; | 2454 _definedNames = _value; |
| 2564 } | 2455 } |
| 2565 | 2456 |
| 2566 @override | 2457 @override |
| 2567 int get unit => _unit ??= 0; | 2458 int get unit => _unit ??= 0; |
| 2568 | 2459 |
| 2569 /** | 2460 /** |
| 2570 * Index into [PackageIndex.unitLibraryUris] and [PackageIndex.unitUnitUris] | 2461 * Index into [PackageIndex.unitLibraryUris] and [PackageIndex.unitUnitUris] |
| 2571 * for the library specific unit that corresponds to this [UnitIndex]. | 2462 * for the library specific unit that corresponds to this [UnitIndex]. |
| 2572 */ | 2463 */ |
| 2573 void set unit(int _value) { | 2464 void set unit(int _value) { |
| 2574 assert(!_finished); | |
| 2575 assert(_value == null || _value >= 0); | 2465 assert(_value == null || _value >= 0); |
| 2576 _unit = _value; | 2466 _unit = _value; |
| 2577 } | 2467 } |
| 2578 | 2468 |
| 2579 @override | 2469 @override |
| 2580 List<bool> get usedElementIsQualifiedFlags => _usedElementIsQualifiedFlags ??=
<bool>[]; | 2470 List<bool> get usedElementIsQualifiedFlags => _usedElementIsQualifiedFlags ??=
<bool>[]; |
| 2581 | 2471 |
| 2582 /** | 2472 /** |
| 2583 * Each item of this list is the `true` if the corresponding element usage | 2473 * Each item of this list is the `true` if the corresponding element usage |
| 2584 * is qualified with some prefix. | 2474 * is qualified with some prefix. |
| 2585 */ | 2475 */ |
| 2586 void set usedElementIsQualifiedFlags(List<bool> _value) { | 2476 void set usedElementIsQualifiedFlags(List<bool> _value) { |
| 2587 assert(!_finished); | |
| 2588 _usedElementIsQualifiedFlags = _value; | 2477 _usedElementIsQualifiedFlags = _value; |
| 2589 } | 2478 } |
| 2590 | 2479 |
| 2591 @override | 2480 @override |
| 2592 List<idl.IndexRelationKind> get usedElementKinds => _usedElementKinds ??= <idl
.IndexRelationKind>[]; | 2481 List<idl.IndexRelationKind> get usedElementKinds => _usedElementKinds ??= <idl
.IndexRelationKind>[]; |
| 2593 | 2482 |
| 2594 /** | 2483 /** |
| 2595 * Each item of this list is the kind of the element usage. | 2484 * Each item of this list is the kind of the element usage. |
| 2596 */ | 2485 */ |
| 2597 void set usedElementKinds(List<idl.IndexRelationKind> _value) { | 2486 void set usedElementKinds(List<idl.IndexRelationKind> _value) { |
| 2598 assert(!_finished); | |
| 2599 _usedElementKinds = _value; | 2487 _usedElementKinds = _value; |
| 2600 } | 2488 } |
| 2601 | 2489 |
| 2602 @override | 2490 @override |
| 2603 List<int> get usedElementLengths => _usedElementLengths ??= <int>[]; | 2491 List<int> get usedElementLengths => _usedElementLengths ??= <int>[]; |
| 2604 | 2492 |
| 2605 /** | 2493 /** |
| 2606 * Each item of this list is the length of the element usage. | 2494 * Each item of this list is the length of the element usage. |
| 2607 */ | 2495 */ |
| 2608 void set usedElementLengths(List<int> _value) { | 2496 void set usedElementLengths(List<int> _value) { |
| 2609 assert(!_finished); | |
| 2610 assert(_value == null || _value.every((e) => e >= 0)); | 2497 assert(_value == null || _value.every((e) => e >= 0)); |
| 2611 _usedElementLengths = _value; | 2498 _usedElementLengths = _value; |
| 2612 } | 2499 } |
| 2613 | 2500 |
| 2614 @override | 2501 @override |
| 2615 List<int> get usedElementOffsets => _usedElementOffsets ??= <int>[]; | 2502 List<int> get usedElementOffsets => _usedElementOffsets ??= <int>[]; |
| 2616 | 2503 |
| 2617 /** | 2504 /** |
| 2618 * Each item of this list is the offset of the element usage relative to the | 2505 * Each item of this list is the offset of the element usage relative to the |
| 2619 * beginning of the file. | 2506 * beginning of the file. |
| 2620 */ | 2507 */ |
| 2621 void set usedElementOffsets(List<int> _value) { | 2508 void set usedElementOffsets(List<int> _value) { |
| 2622 assert(!_finished); | |
| 2623 assert(_value == null || _value.every((e) => e >= 0)); | 2509 assert(_value == null || _value.every((e) => e >= 0)); |
| 2624 _usedElementOffsets = _value; | 2510 _usedElementOffsets = _value; |
| 2625 } | 2511 } |
| 2626 | 2512 |
| 2627 @override | 2513 @override |
| 2628 List<int> get usedElements => _usedElements ??= <int>[]; | 2514 List<int> get usedElements => _usedElements ??= <int>[]; |
| 2629 | 2515 |
| 2630 /** | 2516 /** |
| 2631 * Each item of this list is the index into [PackageIndex.elementUnits] and | 2517 * Each item of this list is the index into [PackageIndex.elementUnits] and |
| 2632 * [PackageIndex.elementOffsets]. The list is sorted in ascending order, so | 2518 * [PackageIndex.elementOffsets]. The list is sorted in ascending order, so |
| 2633 * that the client can quickly find element references in this [UnitIndex]. | 2519 * that the client can quickly find element references in this [UnitIndex]. |
| 2634 */ | 2520 */ |
| 2635 void set usedElements(List<int> _value) { | 2521 void set usedElements(List<int> _value) { |
| 2636 assert(!_finished); | |
| 2637 assert(_value == null || _value.every((e) => e >= 0)); | 2522 assert(_value == null || _value.every((e) => e >= 0)); |
| 2638 _usedElements = _value; | 2523 _usedElements = _value; |
| 2639 } | 2524 } |
| 2640 | 2525 |
| 2641 @override | 2526 @override |
| 2642 List<bool> get usedNameIsQualifiedFlags => _usedNameIsQualifiedFlags ??= <bool
>[]; | 2527 List<bool> get usedNameIsQualifiedFlags => _usedNameIsQualifiedFlags ??= <bool
>[]; |
| 2643 | 2528 |
| 2644 /** | 2529 /** |
| 2645 * Each item of this list is the `true` if the corresponding name usage | 2530 * Each item of this list is the `true` if the corresponding name usage |
| 2646 * is qualified with some prefix. | 2531 * is qualified with some prefix. |
| 2647 */ | 2532 */ |
| 2648 void set usedNameIsQualifiedFlags(List<bool> _value) { | 2533 void set usedNameIsQualifiedFlags(List<bool> _value) { |
| 2649 assert(!_finished); | |
| 2650 _usedNameIsQualifiedFlags = _value; | 2534 _usedNameIsQualifiedFlags = _value; |
| 2651 } | 2535 } |
| 2652 | 2536 |
| 2653 @override | 2537 @override |
| 2654 List<idl.IndexRelationKind> get usedNameKinds => _usedNameKinds ??= <idl.Index
RelationKind>[]; | 2538 List<idl.IndexRelationKind> get usedNameKinds => _usedNameKinds ??= <idl.Index
RelationKind>[]; |
| 2655 | 2539 |
| 2656 /** | 2540 /** |
| 2657 * Each item of this list is the kind of the name usage. | 2541 * Each item of this list is the kind of the name usage. |
| 2658 */ | 2542 */ |
| 2659 void set usedNameKinds(List<idl.IndexRelationKind> _value) { | 2543 void set usedNameKinds(List<idl.IndexRelationKind> _value) { |
| 2660 assert(!_finished); | |
| 2661 _usedNameKinds = _value; | 2544 _usedNameKinds = _value; |
| 2662 } | 2545 } |
| 2663 | 2546 |
| 2664 @override | 2547 @override |
| 2665 List<int> get usedNameOffsets => _usedNameOffsets ??= <int>[]; | 2548 List<int> get usedNameOffsets => _usedNameOffsets ??= <int>[]; |
| 2666 | 2549 |
| 2667 /** | 2550 /** |
| 2668 * Each item of this list is the offset of the name usage relative to the | 2551 * Each item of this list is the offset of the name usage relative to the |
| 2669 * beginning of the file. | 2552 * beginning of the file. |
| 2670 */ | 2553 */ |
| 2671 void set usedNameOffsets(List<int> _value) { | 2554 void set usedNameOffsets(List<int> _value) { |
| 2672 assert(!_finished); | |
| 2673 assert(_value == null || _value.every((e) => e >= 0)); | 2555 assert(_value == null || _value.every((e) => e >= 0)); |
| 2674 _usedNameOffsets = _value; | 2556 _usedNameOffsets = _value; |
| 2675 } | 2557 } |
| 2676 | 2558 |
| 2677 @override | 2559 @override |
| 2678 List<int> get usedNames => _usedNames ??= <int>[]; | 2560 List<int> get usedNames => _usedNames ??= <int>[]; |
| 2679 | 2561 |
| 2680 /** | 2562 /** |
| 2681 * Each item of this list is the index into [PackageIndex.strings] for a | 2563 * Each item of this list is the index into [PackageIndex.strings] for a |
| 2682 * used name. The list is sorted in ascending order, so that the client can | 2564 * used name. The list is sorted in ascending order, so that the client can |
| 2683 * quickly find name uses in this [UnitIndex]. | 2565 * quickly find name uses in this [UnitIndex]. |
| 2684 */ | 2566 */ |
| 2685 void set usedNames(List<int> _value) { | 2567 void set usedNames(List<int> _value) { |
| 2686 assert(!_finished); | |
| 2687 assert(_value == null || _value.every((e) => e >= 0)); | 2568 assert(_value == null || _value.every((e) => e >= 0)); |
| 2688 _usedNames = _value; | 2569 _usedNames = _value; |
| 2689 } | 2570 } |
| 2690 | 2571 |
| 2691 UnitIndexBuilder({List<idl.IndexNameKind> definedNameKinds, List<int> definedN
ameOffsets, List<int> definedNames, int unit, List<bool> usedElementIsQualifiedF
lags, List<idl.IndexRelationKind> usedElementKinds, List<int> usedElementLengths
, List<int> usedElementOffsets, List<int> usedElements, List<bool> usedNameIsQua
lifiedFlags, List<idl.IndexRelationKind> usedNameKinds, List<int> usedNameOffset
s, List<int> usedNames}) | 2572 UnitIndexBuilder({List<idl.IndexNameKind> definedNameKinds, List<int> definedN
ameOffsets, List<int> definedNames, int unit, List<bool> usedElementIsQualifiedF
lags, List<idl.IndexRelationKind> usedElementKinds, List<int> usedElementLengths
, List<int> usedElementOffsets, List<int> usedElements, List<bool> usedNameIsQua
lifiedFlags, List<idl.IndexRelationKind> usedNameKinds, List<int> usedNameOffset
s, List<int> usedNames}) |
| 2692 : _definedNameKinds = definedNameKinds, | 2573 : _definedNameKinds = definedNameKinds, |
| 2693 _definedNameOffsets = definedNameOffsets, | 2574 _definedNameOffsets = definedNameOffsets, |
| 2694 _definedNames = definedNames, | 2575 _definedNames = definedNames, |
| 2695 _unit = unit, | 2576 _unit = unit, |
| 2696 _usedElementIsQualifiedFlags = usedElementIsQualifiedFlags, | 2577 _usedElementIsQualifiedFlags = usedElementIsQualifiedFlags, |
| 2697 _usedElementKinds = usedElementKinds, | 2578 _usedElementKinds = usedElementKinds, |
| 2698 _usedElementLengths = usedElementLengths, | 2579 _usedElementLengths = usedElementLengths, |
| 2699 _usedElementOffsets = usedElementOffsets, | 2580 _usedElementOffsets = usedElementOffsets, |
| 2700 _usedElements = usedElements, | 2581 _usedElements = usedElements, |
| 2701 _usedNameIsQualifiedFlags = usedNameIsQualifiedFlags, | 2582 _usedNameIsQualifiedFlags = usedNameIsQualifiedFlags, |
| 2702 _usedNameKinds = usedNameKinds, | 2583 _usedNameKinds = usedNameKinds, |
| 2703 _usedNameOffsets = usedNameOffsets, | 2584 _usedNameOffsets = usedNameOffsets, |
| 2704 _usedNames = usedNames; | 2585 _usedNames = usedNames; |
| 2705 | 2586 |
| 2706 /** | 2587 /** |
| 2707 * Flush [informative] data recursively. | 2588 * Flush [informative] data recursively. |
| 2708 */ | 2589 */ |
| 2709 void flushInformative() { | 2590 void flushInformative() { |
| 2710 } | 2591 } |
| 2711 | 2592 |
| 2712 fb.Offset finish(fb.Builder fbBuilder) { | 2593 fb.Offset finish(fb.Builder fbBuilder) { |
| 2713 assert(!_finished); | |
| 2714 _finished = true; | |
| 2715 fb.Offset offset_definedNameKinds; | 2594 fb.Offset offset_definedNameKinds; |
| 2716 fb.Offset offset_definedNameOffsets; | 2595 fb.Offset offset_definedNameOffsets; |
| 2717 fb.Offset offset_definedNames; | 2596 fb.Offset offset_definedNames; |
| 2718 fb.Offset offset_usedElementIsQualifiedFlags; | 2597 fb.Offset offset_usedElementIsQualifiedFlags; |
| 2719 fb.Offset offset_usedElementKinds; | 2598 fb.Offset offset_usedElementKinds; |
| 2720 fb.Offset offset_usedElementLengths; | 2599 fb.Offset offset_usedElementLengths; |
| 2721 fb.Offset offset_usedElementOffsets; | 2600 fb.Offset offset_usedElementOffsets; |
| 2722 fb.Offset offset_usedElements; | 2601 fb.Offset offset_usedElements; |
| 2723 fb.Offset offset_usedNameIsQualifiedFlags; | 2602 fb.Offset offset_usedNameIsQualifiedFlags; |
| 2724 fb.Offset offset_usedNameKinds; | 2603 fb.Offset offset_usedNameKinds; |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2945 "usedNameKinds": usedNameKinds, | 2824 "usedNameKinds": usedNameKinds, |
| 2946 "usedNameOffsets": usedNameOffsets, | 2825 "usedNameOffsets": usedNameOffsets, |
| 2947 "usedNames": usedNames, | 2826 "usedNames": usedNames, |
| 2948 }; | 2827 }; |
| 2949 | 2828 |
| 2950 @override | 2829 @override |
| 2951 String toString() => convert.JSON.encode(toJson()); | 2830 String toString() => convert.JSON.encode(toJson()); |
| 2952 } | 2831 } |
| 2953 | 2832 |
| 2954 class UnlinkedClassBuilder extends Object with _UnlinkedClassMixin implements id
l.UnlinkedClass { | 2833 class UnlinkedClassBuilder extends Object with _UnlinkedClassMixin implements id
l.UnlinkedClass { |
| 2955 bool _finished = false; | |
| 2956 | |
| 2957 List<UnlinkedConstBuilder> _annotations; | 2834 List<UnlinkedConstBuilder> _annotations; |
| 2958 CodeRangeBuilder _codeRange; | 2835 CodeRangeBuilder _codeRange; |
| 2959 UnlinkedDocumentationCommentBuilder _documentationComment; | 2836 UnlinkedDocumentationCommentBuilder _documentationComment; |
| 2960 List<UnlinkedExecutableBuilder> _executables; | 2837 List<UnlinkedExecutableBuilder> _executables; |
| 2961 List<UnlinkedVariableBuilder> _fields; | 2838 List<UnlinkedVariableBuilder> _fields; |
| 2962 bool _hasNoSupertype; | 2839 bool _hasNoSupertype; |
| 2963 List<EntityRefBuilder> _interfaces; | 2840 List<EntityRefBuilder> _interfaces; |
| 2964 bool _isAbstract; | 2841 bool _isAbstract; |
| 2965 bool _isMixinApplication; | 2842 bool _isMixinApplication; |
| 2966 List<EntityRefBuilder> _mixins; | 2843 List<EntityRefBuilder> _mixins; |
| 2967 String _name; | 2844 String _name; |
| 2968 int _nameOffset; | 2845 int _nameOffset; |
| 2969 EntityRefBuilder _supertype; | 2846 EntityRefBuilder _supertype; |
| 2970 List<UnlinkedTypeParamBuilder> _typeParameters; | 2847 List<UnlinkedTypeParamBuilder> _typeParameters; |
| 2971 | 2848 |
| 2972 @override | 2849 @override |
| 2973 List<UnlinkedConstBuilder> get annotations => _annotations ??= <UnlinkedConstB
uilder>[]; | 2850 List<UnlinkedConstBuilder> get annotations => _annotations ??= <UnlinkedConstB
uilder>[]; |
| 2974 | 2851 |
| 2975 /** | 2852 /** |
| 2976 * Annotations for this class. | 2853 * Annotations for this class. |
| 2977 */ | 2854 */ |
| 2978 void set annotations(List<UnlinkedConstBuilder> _value) { | 2855 void set annotations(List<UnlinkedConstBuilder> _value) { |
| 2979 assert(!_finished); | |
| 2980 _annotations = _value; | 2856 _annotations = _value; |
| 2981 } | 2857 } |
| 2982 | 2858 |
| 2983 @override | 2859 @override |
| 2984 CodeRangeBuilder get codeRange => _codeRange; | 2860 CodeRangeBuilder get codeRange => _codeRange; |
| 2985 | 2861 |
| 2986 /** | 2862 /** |
| 2987 * Code range of the class. | 2863 * Code range of the class. |
| 2988 */ | 2864 */ |
| 2989 void set codeRange(CodeRangeBuilder _value) { | 2865 void set codeRange(CodeRangeBuilder _value) { |
| 2990 assert(!_finished); | |
| 2991 _codeRange = _value; | 2866 _codeRange = _value; |
| 2992 } | 2867 } |
| 2993 | 2868 |
| 2994 @override | 2869 @override |
| 2995 UnlinkedDocumentationCommentBuilder get documentationComment => _documentation
Comment; | 2870 UnlinkedDocumentationCommentBuilder get documentationComment => _documentation
Comment; |
| 2996 | 2871 |
| 2997 /** | 2872 /** |
| 2998 * Documentation comment for the class, or `null` if there is no | 2873 * Documentation comment for the class, or `null` if there is no |
| 2999 * documentation comment. | 2874 * documentation comment. |
| 3000 */ | 2875 */ |
| 3001 void set documentationComment(UnlinkedDocumentationCommentBuilder _value) { | 2876 void set documentationComment(UnlinkedDocumentationCommentBuilder _value) { |
| 3002 assert(!_finished); | |
| 3003 _documentationComment = _value; | 2877 _documentationComment = _value; |
| 3004 } | 2878 } |
| 3005 | 2879 |
| 3006 @override | 2880 @override |
| 3007 List<UnlinkedExecutableBuilder> get executables => _executables ??= <UnlinkedE
xecutableBuilder>[]; | 2881 List<UnlinkedExecutableBuilder> get executables => _executables ??= <UnlinkedE
xecutableBuilder>[]; |
| 3008 | 2882 |
| 3009 /** | 2883 /** |
| 3010 * Executable objects (methods, getters, and setters) contained in the class. | 2884 * Executable objects (methods, getters, and setters) contained in the class. |
| 3011 */ | 2885 */ |
| 3012 void set executables(List<UnlinkedExecutableBuilder> _value) { | 2886 void set executables(List<UnlinkedExecutableBuilder> _value) { |
| 3013 assert(!_finished); | |
| 3014 _executables = _value; | 2887 _executables = _value; |
| 3015 } | 2888 } |
| 3016 | 2889 |
| 3017 @override | 2890 @override |
| 3018 List<UnlinkedVariableBuilder> get fields => _fields ??= <UnlinkedVariableBuild
er>[]; | 2891 List<UnlinkedVariableBuilder> get fields => _fields ??= <UnlinkedVariableBuild
er>[]; |
| 3019 | 2892 |
| 3020 /** | 2893 /** |
| 3021 * Field declarations contained in the class. | 2894 * Field declarations contained in the class. |
| 3022 */ | 2895 */ |
| 3023 void set fields(List<UnlinkedVariableBuilder> _value) { | 2896 void set fields(List<UnlinkedVariableBuilder> _value) { |
| 3024 assert(!_finished); | |
| 3025 _fields = _value; | 2897 _fields = _value; |
| 3026 } | 2898 } |
| 3027 | 2899 |
| 3028 @override | 2900 @override |
| 3029 bool get hasNoSupertype => _hasNoSupertype ??= false; | 2901 bool get hasNoSupertype => _hasNoSupertype ??= false; |
| 3030 | 2902 |
| 3031 /** | 2903 /** |
| 3032 * Indicates whether this class is the core "Object" class (and hence has no | 2904 * Indicates whether this class is the core "Object" class (and hence has no |
| 3033 * supertype) | 2905 * supertype) |
| 3034 */ | 2906 */ |
| 3035 void set hasNoSupertype(bool _value) { | 2907 void set hasNoSupertype(bool _value) { |
| 3036 assert(!_finished); | |
| 3037 _hasNoSupertype = _value; | 2908 _hasNoSupertype = _value; |
| 3038 } | 2909 } |
| 3039 | 2910 |
| 3040 @override | 2911 @override |
| 3041 List<EntityRefBuilder> get interfaces => _interfaces ??= <EntityRefBuilder>[]; | 2912 List<EntityRefBuilder> get interfaces => _interfaces ??= <EntityRefBuilder>[]; |
| 3042 | 2913 |
| 3043 /** | 2914 /** |
| 3044 * Interfaces appearing in an `implements` clause, if any. | 2915 * Interfaces appearing in an `implements` clause, if any. |
| 3045 */ | 2916 */ |
| 3046 void set interfaces(List<EntityRefBuilder> _value) { | 2917 void set interfaces(List<EntityRefBuilder> _value) { |
| 3047 assert(!_finished); | |
| 3048 _interfaces = _value; | 2918 _interfaces = _value; |
| 3049 } | 2919 } |
| 3050 | 2920 |
| 3051 @override | 2921 @override |
| 3052 bool get isAbstract => _isAbstract ??= false; | 2922 bool get isAbstract => _isAbstract ??= false; |
| 3053 | 2923 |
| 3054 /** | 2924 /** |
| 3055 * Indicates whether the class is declared with the `abstract` keyword. | 2925 * Indicates whether the class is declared with the `abstract` keyword. |
| 3056 */ | 2926 */ |
| 3057 void set isAbstract(bool _value) { | 2927 void set isAbstract(bool _value) { |
| 3058 assert(!_finished); | |
| 3059 _isAbstract = _value; | 2928 _isAbstract = _value; |
| 3060 } | 2929 } |
| 3061 | 2930 |
| 3062 @override | 2931 @override |
| 3063 bool get isMixinApplication => _isMixinApplication ??= false; | 2932 bool get isMixinApplication => _isMixinApplication ??= false; |
| 3064 | 2933 |
| 3065 /** | 2934 /** |
| 3066 * Indicates whether the class is declared using mixin application syntax. | 2935 * Indicates whether the class is declared using mixin application syntax. |
| 3067 */ | 2936 */ |
| 3068 void set isMixinApplication(bool _value) { | 2937 void set isMixinApplication(bool _value) { |
| 3069 assert(!_finished); | |
| 3070 _isMixinApplication = _value; | 2938 _isMixinApplication = _value; |
| 3071 } | 2939 } |
| 3072 | 2940 |
| 3073 @override | 2941 @override |
| 3074 List<EntityRefBuilder> get mixins => _mixins ??= <EntityRefBuilder>[]; | 2942 List<EntityRefBuilder> get mixins => _mixins ??= <EntityRefBuilder>[]; |
| 3075 | 2943 |
| 3076 /** | 2944 /** |
| 3077 * Mixins appearing in a `with` clause, if any. | 2945 * Mixins appearing in a `with` clause, if any. |
| 3078 */ | 2946 */ |
| 3079 void set mixins(List<EntityRefBuilder> _value) { | 2947 void set mixins(List<EntityRefBuilder> _value) { |
| 3080 assert(!_finished); | |
| 3081 _mixins = _value; | 2948 _mixins = _value; |
| 3082 } | 2949 } |
| 3083 | 2950 |
| 3084 @override | 2951 @override |
| 3085 String get name => _name ??= ''; | 2952 String get name => _name ??= ''; |
| 3086 | 2953 |
| 3087 /** | 2954 /** |
| 3088 * Name of the class. | 2955 * Name of the class. |
| 3089 */ | 2956 */ |
| 3090 void set name(String _value) { | 2957 void set name(String _value) { |
| 3091 assert(!_finished); | |
| 3092 _name = _value; | 2958 _name = _value; |
| 3093 } | 2959 } |
| 3094 | 2960 |
| 3095 @override | 2961 @override |
| 3096 int get nameOffset => _nameOffset ??= 0; | 2962 int get nameOffset => _nameOffset ??= 0; |
| 3097 | 2963 |
| 3098 /** | 2964 /** |
| 3099 * Offset of the class name relative to the beginning of the file. | 2965 * Offset of the class name relative to the beginning of the file. |
| 3100 */ | 2966 */ |
| 3101 void set nameOffset(int _value) { | 2967 void set nameOffset(int _value) { |
| 3102 assert(!_finished); | |
| 3103 assert(_value == null || _value >= 0); | 2968 assert(_value == null || _value >= 0); |
| 3104 _nameOffset = _value; | 2969 _nameOffset = _value; |
| 3105 } | 2970 } |
| 3106 | 2971 |
| 3107 @override | 2972 @override |
| 3108 EntityRefBuilder get supertype => _supertype; | 2973 EntityRefBuilder get supertype => _supertype; |
| 3109 | 2974 |
| 3110 /** | 2975 /** |
| 3111 * Supertype of the class, or `null` if either (a) the class doesn't | 2976 * Supertype of the class, or `null` if either (a) the class doesn't |
| 3112 * explicitly declare a supertype (and hence has supertype `Object`), or (b) | 2977 * explicitly declare a supertype (and hence has supertype `Object`), or (b) |
| 3113 * the class *is* `Object` (and hence has no supertype). | 2978 * the class *is* `Object` (and hence has no supertype). |
| 3114 */ | 2979 */ |
| 3115 void set supertype(EntityRefBuilder _value) { | 2980 void set supertype(EntityRefBuilder _value) { |
| 3116 assert(!_finished); | |
| 3117 _supertype = _value; | 2981 _supertype = _value; |
| 3118 } | 2982 } |
| 3119 | 2983 |
| 3120 @override | 2984 @override |
| 3121 List<UnlinkedTypeParamBuilder> get typeParameters => _typeParameters ??= <Unli
nkedTypeParamBuilder>[]; | 2985 List<UnlinkedTypeParamBuilder> get typeParameters => _typeParameters ??= <Unli
nkedTypeParamBuilder>[]; |
| 3122 | 2986 |
| 3123 /** | 2987 /** |
| 3124 * Type parameters of the class, if any. | 2988 * Type parameters of the class, if any. |
| 3125 */ | 2989 */ |
| 3126 void set typeParameters(List<UnlinkedTypeParamBuilder> _value) { | 2990 void set typeParameters(List<UnlinkedTypeParamBuilder> _value) { |
| 3127 assert(!_finished); | |
| 3128 _typeParameters = _value; | 2991 _typeParameters = _value; |
| 3129 } | 2992 } |
| 3130 | 2993 |
| 3131 UnlinkedClassBuilder({List<UnlinkedConstBuilder> annotations, CodeRangeBuilder
codeRange, UnlinkedDocumentationCommentBuilder documentationComment, List<Unlin
kedExecutableBuilder> executables, List<UnlinkedVariableBuilder> fields, bool ha
sNoSupertype, List<EntityRefBuilder> interfaces, bool isAbstract, bool isMixinAp
plication, List<EntityRefBuilder> mixins, String name, int nameOffset, EntityRef
Builder supertype, List<UnlinkedTypeParamBuilder> typeParameters}) | 2994 UnlinkedClassBuilder({List<UnlinkedConstBuilder> annotations, CodeRangeBuilder
codeRange, UnlinkedDocumentationCommentBuilder documentationComment, List<Unlin
kedExecutableBuilder> executables, List<UnlinkedVariableBuilder> fields, bool ha
sNoSupertype, List<EntityRefBuilder> interfaces, bool isAbstract, bool isMixinAp
plication, List<EntityRefBuilder> mixins, String name, int nameOffset, EntityRef
Builder supertype, List<UnlinkedTypeParamBuilder> typeParameters}) |
| 3132 : _annotations = annotations, | 2995 : _annotations = annotations, |
| 3133 _codeRange = codeRange, | 2996 _codeRange = codeRange, |
| 3134 _documentationComment = documentationComment, | 2997 _documentationComment = documentationComment, |
| 3135 _executables = executables, | 2998 _executables = executables, |
| 3136 _fields = fields, | 2999 _fields = fields, |
| 3137 _hasNoSupertype = hasNoSupertype, | 3000 _hasNoSupertype = hasNoSupertype, |
| (...skipping 16 matching lines...) Expand all Loading... |
| 3154 _executables?.forEach((b) => b.flushInformative()); | 3017 _executables?.forEach((b) => b.flushInformative()); |
| 3155 _fields?.forEach((b) => b.flushInformative()); | 3018 _fields?.forEach((b) => b.flushInformative()); |
| 3156 _interfaces?.forEach((b) => b.flushInformative()); | 3019 _interfaces?.forEach((b) => b.flushInformative()); |
| 3157 _mixins?.forEach((b) => b.flushInformative()); | 3020 _mixins?.forEach((b) => b.flushInformative()); |
| 3158 _nameOffset = null; | 3021 _nameOffset = null; |
| 3159 _supertype?.flushInformative(); | 3022 _supertype?.flushInformative(); |
| 3160 _typeParameters?.forEach((b) => b.flushInformative()); | 3023 _typeParameters?.forEach((b) => b.flushInformative()); |
| 3161 } | 3024 } |
| 3162 | 3025 |
| 3163 fb.Offset finish(fb.Builder fbBuilder) { | 3026 fb.Offset finish(fb.Builder fbBuilder) { |
| 3164 assert(!_finished); | |
| 3165 _finished = true; | |
| 3166 fb.Offset offset_annotations; | 3027 fb.Offset offset_annotations; |
| 3167 fb.Offset offset_codeRange; | 3028 fb.Offset offset_codeRange; |
| 3168 fb.Offset offset_documentationComment; | 3029 fb.Offset offset_documentationComment; |
| 3169 fb.Offset offset_executables; | 3030 fb.Offset offset_executables; |
| 3170 fb.Offset offset_fields; | 3031 fb.Offset offset_fields; |
| 3171 fb.Offset offset_interfaces; | 3032 fb.Offset offset_interfaces; |
| 3172 fb.Offset offset_mixins; | 3033 fb.Offset offset_mixins; |
| 3173 fb.Offset offset_name; | 3034 fb.Offset offset_name; |
| 3174 fb.Offset offset_supertype; | 3035 fb.Offset offset_supertype; |
| 3175 fb.Offset offset_typeParameters; | 3036 fb.Offset offset_typeParameters; |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3400 "nameOffset": nameOffset, | 3261 "nameOffset": nameOffset, |
| 3401 "supertype": supertype, | 3262 "supertype": supertype, |
| 3402 "typeParameters": typeParameters, | 3263 "typeParameters": typeParameters, |
| 3403 }; | 3264 }; |
| 3404 | 3265 |
| 3405 @override | 3266 @override |
| 3406 String toString() => convert.JSON.encode(toJson()); | 3267 String toString() => convert.JSON.encode(toJson()); |
| 3407 } | 3268 } |
| 3408 | 3269 |
| 3409 class UnlinkedCombinatorBuilder extends Object with _UnlinkedCombinatorMixin imp
lements idl.UnlinkedCombinator { | 3270 class UnlinkedCombinatorBuilder extends Object with _UnlinkedCombinatorMixin imp
lements idl.UnlinkedCombinator { |
| 3410 bool _finished = false; | |
| 3411 | |
| 3412 int _end; | 3271 int _end; |
| 3413 List<String> _hides; | 3272 List<String> _hides; |
| 3414 int _offset; | 3273 int _offset; |
| 3415 List<String> _shows; | 3274 List<String> _shows; |
| 3416 | 3275 |
| 3417 @override | 3276 @override |
| 3418 int get end => _end ??= 0; | 3277 int get end => _end ??= 0; |
| 3419 | 3278 |
| 3420 /** | 3279 /** |
| 3421 * If this is a `show` combinator, offset of the end of the list of shown | 3280 * If this is a `show` combinator, offset of the end of the list of shown |
| 3422 * names. Otherwise zero. | 3281 * names. Otherwise zero. |
| 3423 */ | 3282 */ |
| 3424 void set end(int _value) { | 3283 void set end(int _value) { |
| 3425 assert(!_finished); | |
| 3426 assert(_value == null || _value >= 0); | 3284 assert(_value == null || _value >= 0); |
| 3427 _end = _value; | 3285 _end = _value; |
| 3428 } | 3286 } |
| 3429 | 3287 |
| 3430 @override | 3288 @override |
| 3431 List<String> get hides => _hides ??= <String>[]; | 3289 List<String> get hides => _hides ??= <String>[]; |
| 3432 | 3290 |
| 3433 /** | 3291 /** |
| 3434 * List of names which are hidden. Empty if this is a `show` combinator. | 3292 * List of names which are hidden. Empty if this is a `show` combinator. |
| 3435 */ | 3293 */ |
| 3436 void set hides(List<String> _value) { | 3294 void set hides(List<String> _value) { |
| 3437 assert(!_finished); | |
| 3438 _hides = _value; | 3295 _hides = _value; |
| 3439 } | 3296 } |
| 3440 | 3297 |
| 3441 @override | 3298 @override |
| 3442 int get offset => _offset ??= 0; | 3299 int get offset => _offset ??= 0; |
| 3443 | 3300 |
| 3444 /** | 3301 /** |
| 3445 * If this is a `show` combinator, offset of the `show` keyword. Otherwise | 3302 * If this is a `show` combinator, offset of the `show` keyword. Otherwise |
| 3446 * zero. | 3303 * zero. |
| 3447 */ | 3304 */ |
| 3448 void set offset(int _value) { | 3305 void set offset(int _value) { |
| 3449 assert(!_finished); | |
| 3450 assert(_value == null || _value >= 0); | 3306 assert(_value == null || _value >= 0); |
| 3451 _offset = _value; | 3307 _offset = _value; |
| 3452 } | 3308 } |
| 3453 | 3309 |
| 3454 @override | 3310 @override |
| 3455 List<String> get shows => _shows ??= <String>[]; | 3311 List<String> get shows => _shows ??= <String>[]; |
| 3456 | 3312 |
| 3457 /** | 3313 /** |
| 3458 * List of names which are shown. Empty if this is a `hide` combinator. | 3314 * List of names which are shown. Empty if this is a `hide` combinator. |
| 3459 */ | 3315 */ |
| 3460 void set shows(List<String> _value) { | 3316 void set shows(List<String> _value) { |
| 3461 assert(!_finished); | |
| 3462 _shows = _value; | 3317 _shows = _value; |
| 3463 } | 3318 } |
| 3464 | 3319 |
| 3465 UnlinkedCombinatorBuilder({int end, List<String> hides, int offset, List<Strin
g> shows}) | 3320 UnlinkedCombinatorBuilder({int end, List<String> hides, int offset, List<Strin
g> shows}) |
| 3466 : _end = end, | 3321 : _end = end, |
| 3467 _hides = hides, | 3322 _hides = hides, |
| 3468 _offset = offset, | 3323 _offset = offset, |
| 3469 _shows = shows; | 3324 _shows = shows; |
| 3470 | 3325 |
| 3471 /** | 3326 /** |
| 3472 * Flush [informative] data recursively. | 3327 * Flush [informative] data recursively. |
| 3473 */ | 3328 */ |
| 3474 void flushInformative() { | 3329 void flushInformative() { |
| 3475 _end = null; | 3330 _end = null; |
| 3476 _offset = null; | 3331 _offset = null; |
| 3477 } | 3332 } |
| 3478 | 3333 |
| 3479 fb.Offset finish(fb.Builder fbBuilder) { | 3334 fb.Offset finish(fb.Builder fbBuilder) { |
| 3480 assert(!_finished); | |
| 3481 _finished = true; | |
| 3482 fb.Offset offset_hides; | 3335 fb.Offset offset_hides; |
| 3483 fb.Offset offset_shows; | 3336 fb.Offset offset_shows; |
| 3484 if (!(_hides == null || _hides.isEmpty)) { | 3337 if (!(_hides == null || _hides.isEmpty)) { |
| 3485 offset_hides = fbBuilder.writeList(_hides.map((b) => fbBuilder.writeString
(b)).toList()); | 3338 offset_hides = fbBuilder.writeList(_hides.map((b) => fbBuilder.writeString
(b)).toList()); |
| 3486 } | 3339 } |
| 3487 if (!(_shows == null || _shows.isEmpty)) { | 3340 if (!(_shows == null || _shows.isEmpty)) { |
| 3488 offset_shows = fbBuilder.writeList(_shows.map((b) => fbBuilder.writeString
(b)).toList()); | 3341 offset_shows = fbBuilder.writeList(_shows.map((b) => fbBuilder.writeString
(b)).toList()); |
| 3489 } | 3342 } |
| 3490 fbBuilder.startTable(); | 3343 fbBuilder.startTable(); |
| 3491 if (_end != null && _end != 0) { | 3344 if (_end != null && _end != 0) { |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3564 "hides": hides, | 3417 "hides": hides, |
| 3565 "offset": offset, | 3418 "offset": offset, |
| 3566 "shows": shows, | 3419 "shows": shows, |
| 3567 }; | 3420 }; |
| 3568 | 3421 |
| 3569 @override | 3422 @override |
| 3570 String toString() => convert.JSON.encode(toJson()); | 3423 String toString() => convert.JSON.encode(toJson()); |
| 3571 } | 3424 } |
| 3572 | 3425 |
| 3573 class UnlinkedConstBuilder extends Object with _UnlinkedConstMixin implements id
l.UnlinkedConst { | 3426 class UnlinkedConstBuilder extends Object with _UnlinkedConstMixin implements id
l.UnlinkedConst { |
| 3574 bool _finished = false; | |
| 3575 | |
| 3576 List<idl.UnlinkedExprAssignOperator> _assignmentOperators; | 3427 List<idl.UnlinkedExprAssignOperator> _assignmentOperators; |
| 3577 List<double> _doubles; | 3428 List<double> _doubles; |
| 3578 List<int> _ints; | 3429 List<int> _ints; |
| 3579 bool _isValidConst; | 3430 bool _isValidConst; |
| 3580 List<idl.UnlinkedConstOperation> _operations; | 3431 List<idl.UnlinkedConstOperation> _operations; |
| 3581 List<EntityRefBuilder> _references; | 3432 List<EntityRefBuilder> _references; |
| 3582 List<String> _strings; | 3433 List<String> _strings; |
| 3583 | 3434 |
| 3584 @override | 3435 @override |
| 3585 List<idl.UnlinkedExprAssignOperator> get assignmentOperators => _assignmentOpe
rators ??= <idl.UnlinkedExprAssignOperator>[]; | 3436 List<idl.UnlinkedExprAssignOperator> get assignmentOperators => _assignmentOpe
rators ??= <idl.UnlinkedExprAssignOperator>[]; |
| 3586 | 3437 |
| 3587 /** | 3438 /** |
| 3588 * Sequence of operators used by assignment operations. | 3439 * Sequence of operators used by assignment operations. |
| 3589 */ | 3440 */ |
| 3590 void set assignmentOperators(List<idl.UnlinkedExprAssignOperator> _value) { | 3441 void set assignmentOperators(List<idl.UnlinkedExprAssignOperator> _value) { |
| 3591 assert(!_finished); | |
| 3592 _assignmentOperators = _value; | 3442 _assignmentOperators = _value; |
| 3593 } | 3443 } |
| 3594 | 3444 |
| 3595 @override | 3445 @override |
| 3596 List<double> get doubles => _doubles ??= <double>[]; | 3446 List<double> get doubles => _doubles ??= <double>[]; |
| 3597 | 3447 |
| 3598 /** | 3448 /** |
| 3599 * Sequence of 64-bit doubles consumed by the operation `pushDouble`. | 3449 * Sequence of 64-bit doubles consumed by the operation `pushDouble`. |
| 3600 */ | 3450 */ |
| 3601 void set doubles(List<double> _value) { | 3451 void set doubles(List<double> _value) { |
| 3602 assert(!_finished); | |
| 3603 _doubles = _value; | 3452 _doubles = _value; |
| 3604 } | 3453 } |
| 3605 | 3454 |
| 3606 @override | 3455 @override |
| 3607 List<int> get ints => _ints ??= <int>[]; | 3456 List<int> get ints => _ints ??= <int>[]; |
| 3608 | 3457 |
| 3609 /** | 3458 /** |
| 3610 * Sequence of unsigned 32-bit integers consumed by the operations | 3459 * Sequence of unsigned 32-bit integers consumed by the operations |
| 3611 * `pushArgument`, `pushInt`, `shiftOr`, `concatenate`, `invokeConstructor`, | 3460 * `pushArgument`, `pushInt`, `shiftOr`, `concatenate`, `invokeConstructor`, |
| 3612 * `makeList`, and `makeMap`. | 3461 * `makeList`, and `makeMap`. |
| 3613 */ | 3462 */ |
| 3614 void set ints(List<int> _value) { | 3463 void set ints(List<int> _value) { |
| 3615 assert(!_finished); | |
| 3616 assert(_value == null || _value.every((e) => e >= 0)); | 3464 assert(_value == null || _value.every((e) => e >= 0)); |
| 3617 _ints = _value; | 3465 _ints = _value; |
| 3618 } | 3466 } |
| 3619 | 3467 |
| 3620 @override | 3468 @override |
| 3621 bool get isValidConst => _isValidConst ??= false; | 3469 bool get isValidConst => _isValidConst ??= false; |
| 3622 | 3470 |
| 3623 /** | 3471 /** |
| 3624 * Indicates whether the expression is a valid potentially constant | 3472 * Indicates whether the expression is a valid potentially constant |
| 3625 * expression. | 3473 * expression. |
| 3626 */ | 3474 */ |
| 3627 void set isValidConst(bool _value) { | 3475 void set isValidConst(bool _value) { |
| 3628 assert(!_finished); | |
| 3629 _isValidConst = _value; | 3476 _isValidConst = _value; |
| 3630 } | 3477 } |
| 3631 | 3478 |
| 3632 @override | 3479 @override |
| 3633 List<idl.UnlinkedConstOperation> get operations => _operations ??= <idl.Unlink
edConstOperation>[]; | 3480 List<idl.UnlinkedConstOperation> get operations => _operations ??= <idl.Unlink
edConstOperation>[]; |
| 3634 | 3481 |
| 3635 /** | 3482 /** |
| 3636 * Sequence of operations to execute (starting with an empty stack) to form | 3483 * Sequence of operations to execute (starting with an empty stack) to form |
| 3637 * the constant value. | 3484 * the constant value. |
| 3638 */ | 3485 */ |
| 3639 void set operations(List<idl.UnlinkedConstOperation> _value) { | 3486 void set operations(List<idl.UnlinkedConstOperation> _value) { |
| 3640 assert(!_finished); | |
| 3641 _operations = _value; | 3487 _operations = _value; |
| 3642 } | 3488 } |
| 3643 | 3489 |
| 3644 @override | 3490 @override |
| 3645 List<EntityRefBuilder> get references => _references ??= <EntityRefBuilder>[]; | 3491 List<EntityRefBuilder> get references => _references ??= <EntityRefBuilder>[]; |
| 3646 | 3492 |
| 3647 /** | 3493 /** |
| 3648 * Sequence of language constructs consumed by the operations | 3494 * Sequence of language constructs consumed by the operations |
| 3649 * `pushReference`, `invokeConstructor`, `makeList`, and `makeMap`. Note | 3495 * `pushReference`, `invokeConstructor`, `makeList`, and `makeMap`. Note |
| 3650 * that in the case of `pushReference` (and sometimes `invokeConstructor` the | 3496 * that in the case of `pushReference` (and sometimes `invokeConstructor` the |
| 3651 * actual entity being referred to may be something other than a type. | 3497 * actual entity being referred to may be something other than a type. |
| 3652 */ | 3498 */ |
| 3653 void set references(List<EntityRefBuilder> _value) { | 3499 void set references(List<EntityRefBuilder> _value) { |
| 3654 assert(!_finished); | |
| 3655 _references = _value; | 3500 _references = _value; |
| 3656 } | 3501 } |
| 3657 | 3502 |
| 3658 @override | 3503 @override |
| 3659 List<String> get strings => _strings ??= <String>[]; | 3504 List<String> get strings => _strings ??= <String>[]; |
| 3660 | 3505 |
| 3661 /** | 3506 /** |
| 3662 * Sequence of strings consumed by the operations `pushString` and | 3507 * Sequence of strings consumed by the operations `pushString` and |
| 3663 * `invokeConstructor`. | 3508 * `invokeConstructor`. |
| 3664 */ | 3509 */ |
| 3665 void set strings(List<String> _value) { | 3510 void set strings(List<String> _value) { |
| 3666 assert(!_finished); | |
| 3667 _strings = _value; | 3511 _strings = _value; |
| 3668 } | 3512 } |
| 3669 | 3513 |
| 3670 UnlinkedConstBuilder({List<idl.UnlinkedExprAssignOperator> assignmentOperators
, List<double> doubles, List<int> ints, bool isValidConst, List<idl.UnlinkedCons
tOperation> operations, List<EntityRefBuilder> references, List<String> strings}
) | 3514 UnlinkedConstBuilder({List<idl.UnlinkedExprAssignOperator> assignmentOperators
, List<double> doubles, List<int> ints, bool isValidConst, List<idl.UnlinkedCons
tOperation> operations, List<EntityRefBuilder> references, List<String> strings}
) |
| 3671 : _assignmentOperators = assignmentOperators, | 3515 : _assignmentOperators = assignmentOperators, |
| 3672 _doubles = doubles, | 3516 _doubles = doubles, |
| 3673 _ints = ints, | 3517 _ints = ints, |
| 3674 _isValidConst = isValidConst, | 3518 _isValidConst = isValidConst, |
| 3675 _operations = operations, | 3519 _operations = operations, |
| 3676 _references = references, | 3520 _references = references, |
| 3677 _strings = strings; | 3521 _strings = strings; |
| 3678 | 3522 |
| 3679 /** | 3523 /** |
| 3680 * Flush [informative] data recursively. | 3524 * Flush [informative] data recursively. |
| 3681 */ | 3525 */ |
| 3682 void flushInformative() { | 3526 void flushInformative() { |
| 3683 _references?.forEach((b) => b.flushInformative()); | 3527 _references?.forEach((b) => b.flushInformative()); |
| 3684 } | 3528 } |
| 3685 | 3529 |
| 3686 fb.Offset finish(fb.Builder fbBuilder) { | 3530 fb.Offset finish(fb.Builder fbBuilder) { |
| 3687 assert(!_finished); | |
| 3688 _finished = true; | |
| 3689 fb.Offset offset_assignmentOperators; | 3531 fb.Offset offset_assignmentOperators; |
| 3690 fb.Offset offset_doubles; | 3532 fb.Offset offset_doubles; |
| 3691 fb.Offset offset_ints; | 3533 fb.Offset offset_ints; |
| 3692 fb.Offset offset_operations; | 3534 fb.Offset offset_operations; |
| 3693 fb.Offset offset_references; | 3535 fb.Offset offset_references; |
| 3694 fb.Offset offset_strings; | 3536 fb.Offset offset_strings; |
| 3695 if (!(_assignmentOperators == null || _assignmentOperators.isEmpty)) { | 3537 if (!(_assignmentOperators == null || _assignmentOperators.isEmpty)) { |
| 3696 offset_assignmentOperators = fbBuilder.writeListUint8(_assignmentOperators
.map((b) => b.index).toList()); | 3538 offset_assignmentOperators = fbBuilder.writeListUint8(_assignmentOperators
.map((b) => b.index).toList()); |
| 3697 } | 3539 } |
| 3698 if (!(_doubles == null || _doubles.isEmpty)) { | 3540 if (!(_doubles == null || _doubles.isEmpty)) { |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3823 "operations": operations, | 3665 "operations": operations, |
| 3824 "references": references, | 3666 "references": references, |
| 3825 "strings": strings, | 3667 "strings": strings, |
| 3826 }; | 3668 }; |
| 3827 | 3669 |
| 3828 @override | 3670 @override |
| 3829 String toString() => convert.JSON.encode(toJson()); | 3671 String toString() => convert.JSON.encode(toJson()); |
| 3830 } | 3672 } |
| 3831 | 3673 |
| 3832 class UnlinkedConstructorInitializerBuilder extends Object with _UnlinkedConstru
ctorInitializerMixin implements idl.UnlinkedConstructorInitializer { | 3674 class UnlinkedConstructorInitializerBuilder extends Object with _UnlinkedConstru
ctorInitializerMixin implements idl.UnlinkedConstructorInitializer { |
| 3833 bool _finished = false; | |
| 3834 | |
| 3835 List<String> _argumentNames; | 3675 List<String> _argumentNames; |
| 3836 List<UnlinkedConstBuilder> _arguments; | 3676 List<UnlinkedConstBuilder> _arguments; |
| 3837 UnlinkedConstBuilder _expression; | 3677 UnlinkedConstBuilder _expression; |
| 3838 idl.UnlinkedConstructorInitializerKind _kind; | 3678 idl.UnlinkedConstructorInitializerKind _kind; |
| 3839 String _name; | 3679 String _name; |
| 3840 | 3680 |
| 3841 @override | 3681 @override |
| 3842 List<String> get argumentNames => _argumentNames ??= <String>[]; | 3682 List<String> get argumentNames => _argumentNames ??= <String>[]; |
| 3843 | 3683 |
| 3844 /** | 3684 /** |
| 3845 * If there are `m` [arguments] and `n` [argumentNames], then each argument | 3685 * If there are `m` [arguments] and `n` [argumentNames], then each argument |
| 3846 * from [arguments] with index `i` such that `n + i - m >= 0`, should be used | 3686 * from [arguments] with index `i` such that `n + i - m >= 0`, should be used |
| 3847 * with the name at `n + i - m`. | 3687 * with the name at `n + i - m`. |
| 3848 */ | 3688 */ |
| 3849 void set argumentNames(List<String> _value) { | 3689 void set argumentNames(List<String> _value) { |
| 3850 assert(!_finished); | |
| 3851 _argumentNames = _value; | 3690 _argumentNames = _value; |
| 3852 } | 3691 } |
| 3853 | 3692 |
| 3854 @override | 3693 @override |
| 3855 List<UnlinkedConstBuilder> get arguments => _arguments ??= <UnlinkedConstBuild
er>[]; | 3694 List<UnlinkedConstBuilder> get arguments => _arguments ??= <UnlinkedConstBuild
er>[]; |
| 3856 | 3695 |
| 3857 /** | 3696 /** |
| 3858 * If [kind] is `thisInvocation` or `superInvocation`, the arguments of the | 3697 * If [kind] is `thisInvocation` or `superInvocation`, the arguments of the |
| 3859 * invocation. Otherwise empty. | 3698 * invocation. Otherwise empty. |
| 3860 */ | 3699 */ |
| 3861 void set arguments(List<UnlinkedConstBuilder> _value) { | 3700 void set arguments(List<UnlinkedConstBuilder> _value) { |
| 3862 assert(!_finished); | |
| 3863 _arguments = _value; | 3701 _arguments = _value; |
| 3864 } | 3702 } |
| 3865 | 3703 |
| 3866 @override | 3704 @override |
| 3867 UnlinkedConstBuilder get expression => _expression; | 3705 UnlinkedConstBuilder get expression => _expression; |
| 3868 | 3706 |
| 3869 /** | 3707 /** |
| 3870 * If [kind] is `field`, the expression of the field initializer. | 3708 * If [kind] is `field`, the expression of the field initializer. |
| 3871 * Otherwise `null`. | 3709 * Otherwise `null`. |
| 3872 */ | 3710 */ |
| 3873 void set expression(UnlinkedConstBuilder _value) { | 3711 void set expression(UnlinkedConstBuilder _value) { |
| 3874 assert(!_finished); | |
| 3875 _expression = _value; | 3712 _expression = _value; |
| 3876 } | 3713 } |
| 3877 | 3714 |
| 3878 @override | 3715 @override |
| 3879 idl.UnlinkedConstructorInitializerKind get kind => _kind ??= idl.UnlinkedConst
ructorInitializerKind.field; | 3716 idl.UnlinkedConstructorInitializerKind get kind => _kind ??= idl.UnlinkedConst
ructorInitializerKind.field; |
| 3880 | 3717 |
| 3881 /** | 3718 /** |
| 3882 * The kind of the constructor initializer (field, redirect, super). | 3719 * The kind of the constructor initializer (field, redirect, super). |
| 3883 */ | 3720 */ |
| 3884 void set kind(idl.UnlinkedConstructorInitializerKind _value) { | 3721 void set kind(idl.UnlinkedConstructorInitializerKind _value) { |
| 3885 assert(!_finished); | |
| 3886 _kind = _value; | 3722 _kind = _value; |
| 3887 } | 3723 } |
| 3888 | 3724 |
| 3889 @override | 3725 @override |
| 3890 String get name => _name ??= ''; | 3726 String get name => _name ??= ''; |
| 3891 | 3727 |
| 3892 /** | 3728 /** |
| 3893 * If [kind] is `field`, the name of the field declared in the class. If | 3729 * If [kind] is `field`, the name of the field declared in the class. If |
| 3894 * [kind] is `thisInvocation`, the name of the constructor, declared in this | 3730 * [kind] is `thisInvocation`, the name of the constructor, declared in this |
| 3895 * class, to redirect to. If [kind] is `superInvocation`, the name of the | 3731 * class, to redirect to. If [kind] is `superInvocation`, the name of the |
| 3896 * constructor, declared in the superclass, to invoke. | 3732 * constructor, declared in the superclass, to invoke. |
| 3897 */ | 3733 */ |
| 3898 void set name(String _value) { | 3734 void set name(String _value) { |
| 3899 assert(!_finished); | |
| 3900 _name = _value; | 3735 _name = _value; |
| 3901 } | 3736 } |
| 3902 | 3737 |
| 3903 UnlinkedConstructorInitializerBuilder({List<String> argumentNames, List<Unlink
edConstBuilder> arguments, UnlinkedConstBuilder expression, idl.UnlinkedConstruc
torInitializerKind kind, String name}) | 3738 UnlinkedConstructorInitializerBuilder({List<String> argumentNames, List<Unlink
edConstBuilder> arguments, UnlinkedConstBuilder expression, idl.UnlinkedConstruc
torInitializerKind kind, String name}) |
| 3904 : _argumentNames = argumentNames, | 3739 : _argumentNames = argumentNames, |
| 3905 _arguments = arguments, | 3740 _arguments = arguments, |
| 3906 _expression = expression, | 3741 _expression = expression, |
| 3907 _kind = kind, | 3742 _kind = kind, |
| 3908 _name = name; | 3743 _name = name; |
| 3909 | 3744 |
| 3910 /** | 3745 /** |
| 3911 * Flush [informative] data recursively. | 3746 * Flush [informative] data recursively. |
| 3912 */ | 3747 */ |
| 3913 void flushInformative() { | 3748 void flushInformative() { |
| 3914 _arguments?.forEach((b) => b.flushInformative()); | 3749 _arguments?.forEach((b) => b.flushInformative()); |
| 3915 _expression?.flushInformative(); | 3750 _expression?.flushInformative(); |
| 3916 } | 3751 } |
| 3917 | 3752 |
| 3918 fb.Offset finish(fb.Builder fbBuilder) { | 3753 fb.Offset finish(fb.Builder fbBuilder) { |
| 3919 assert(!_finished); | |
| 3920 _finished = true; | |
| 3921 fb.Offset offset_argumentNames; | 3754 fb.Offset offset_argumentNames; |
| 3922 fb.Offset offset_arguments; | 3755 fb.Offset offset_arguments; |
| 3923 fb.Offset offset_expression; | 3756 fb.Offset offset_expression; |
| 3924 fb.Offset offset_name; | 3757 fb.Offset offset_name; |
| 3925 if (!(_argumentNames == null || _argumentNames.isEmpty)) { | 3758 if (!(_argumentNames == null || _argumentNames.isEmpty)) { |
| 3926 offset_argumentNames = fbBuilder.writeList(_argumentNames.map((b) => fbBui
lder.writeString(b)).toList()); | 3759 offset_argumentNames = fbBuilder.writeList(_argumentNames.map((b) => fbBui
lder.writeString(b)).toList()); |
| 3927 } | 3760 } |
| 3928 if (!(_arguments == null || _arguments.isEmpty)) { | 3761 if (!(_arguments == null || _arguments.isEmpty)) { |
| 3929 offset_arguments = fbBuilder.writeList(_arguments.map((b) => b.finish(fbBu
ilder)).toList()); | 3762 offset_arguments = fbBuilder.writeList(_arguments.map((b) => b.finish(fbBu
ilder)).toList()); |
| 3930 } | 3763 } |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4023 "expression": expression, | 3856 "expression": expression, |
| 4024 "kind": kind, | 3857 "kind": kind, |
| 4025 "name": name, | 3858 "name": name, |
| 4026 }; | 3859 }; |
| 4027 | 3860 |
| 4028 @override | 3861 @override |
| 4029 String toString() => convert.JSON.encode(toJson()); | 3862 String toString() => convert.JSON.encode(toJson()); |
| 4030 } | 3863 } |
| 4031 | 3864 |
| 4032 class UnlinkedDocumentationCommentBuilder extends Object with _UnlinkedDocumenta
tionCommentMixin implements idl.UnlinkedDocumentationComment { | 3865 class UnlinkedDocumentationCommentBuilder extends Object with _UnlinkedDocumenta
tionCommentMixin implements idl.UnlinkedDocumentationComment { |
| 4033 bool _finished = false; | |
| 4034 | |
| 4035 int _length; | 3866 int _length; |
| 4036 int _offset; | 3867 int _offset; |
| 4037 String _text; | 3868 String _text; |
| 4038 | 3869 |
| 4039 @override | 3870 @override |
| 4040 int get length => _length ??= 0; | 3871 int get length => _length ??= 0; |
| 4041 | 3872 |
| 4042 /** | 3873 /** |
| 4043 * Length of the documentation comment (prior to replacing '\r\n' with '\n'). | 3874 * Length of the documentation comment (prior to replacing '\r\n' with '\n'). |
| 4044 */ | 3875 */ |
| 4045 void set length(int _value) { | 3876 void set length(int _value) { |
| 4046 assert(!_finished); | |
| 4047 assert(_value == null || _value >= 0); | 3877 assert(_value == null || _value >= 0); |
| 4048 _length = _value; | 3878 _length = _value; |
| 4049 } | 3879 } |
| 4050 | 3880 |
| 4051 @override | 3881 @override |
| 4052 int get offset => _offset ??= 0; | 3882 int get offset => _offset ??= 0; |
| 4053 | 3883 |
| 4054 /** | 3884 /** |
| 4055 * Offset of the beginning of the documentation comment relative to the | 3885 * Offset of the beginning of the documentation comment relative to the |
| 4056 * beginning of the file. | 3886 * beginning of the file. |
| 4057 */ | 3887 */ |
| 4058 void set offset(int _value) { | 3888 void set offset(int _value) { |
| 4059 assert(!_finished); | |
| 4060 assert(_value == null || _value >= 0); | 3889 assert(_value == null || _value >= 0); |
| 4061 _offset = _value; | 3890 _offset = _value; |
| 4062 } | 3891 } |
| 4063 | 3892 |
| 4064 @override | 3893 @override |
| 4065 String get text => _text ??= ''; | 3894 String get text => _text ??= ''; |
| 4066 | 3895 |
| 4067 /** | 3896 /** |
| 4068 * Text of the documentation comment, with '\r\n' replaced by '\n'. | 3897 * Text of the documentation comment, with '\r\n' replaced by '\n'. |
| 4069 * | 3898 * |
| 4070 * References appearing within the doc comment in square brackets are not | 3899 * References appearing within the doc comment in square brackets are not |
| 4071 * specially encoded. | 3900 * specially encoded. |
| 4072 */ | 3901 */ |
| 4073 void set text(String _value) { | 3902 void set text(String _value) { |
| 4074 assert(!_finished); | |
| 4075 _text = _value; | 3903 _text = _value; |
| 4076 } | 3904 } |
| 4077 | 3905 |
| 4078 UnlinkedDocumentationCommentBuilder({int length, int offset, String text}) | 3906 UnlinkedDocumentationCommentBuilder({int length, int offset, String text}) |
| 4079 : _length = length, | 3907 : _length = length, |
| 4080 _offset = offset, | 3908 _offset = offset, |
| 4081 _text = text; | 3909 _text = text; |
| 4082 | 3910 |
| 4083 /** | 3911 /** |
| 4084 * Flush [informative] data recursively. | 3912 * Flush [informative] data recursively. |
| 4085 */ | 3913 */ |
| 4086 void flushInformative() { | 3914 void flushInformative() { |
| 4087 } | 3915 } |
| 4088 | 3916 |
| 4089 fb.Offset finish(fb.Builder fbBuilder) { | 3917 fb.Offset finish(fb.Builder fbBuilder) { |
| 4090 assert(!_finished); | |
| 4091 _finished = true; | |
| 4092 fb.Offset offset_text; | 3918 fb.Offset offset_text; |
| 4093 if (_text != null) { | 3919 if (_text != null) { |
| 4094 offset_text = fbBuilder.writeString(_text); | 3920 offset_text = fbBuilder.writeString(_text); |
| 4095 } | 3921 } |
| 4096 fbBuilder.startTable(); | 3922 fbBuilder.startTable(); |
| 4097 if (_length != null && _length != 0) { | 3923 if (_length != null && _length != 0) { |
| 4098 fbBuilder.addUint32(0, _length); | 3924 fbBuilder.addUint32(0, _length); |
| 4099 } | 3925 } |
| 4100 if (_offset != null && _offset != 0) { | 3926 if (_offset != null && _offset != 0) { |
| 4101 fbBuilder.addUint32(2, _offset); | 3927 fbBuilder.addUint32(2, _offset); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4158 "length": length, | 3984 "length": length, |
| 4159 "offset": offset, | 3985 "offset": offset, |
| 4160 "text": text, | 3986 "text": text, |
| 4161 }; | 3987 }; |
| 4162 | 3988 |
| 4163 @override | 3989 @override |
| 4164 String toString() => convert.JSON.encode(toJson()); | 3990 String toString() => convert.JSON.encode(toJson()); |
| 4165 } | 3991 } |
| 4166 | 3992 |
| 4167 class UnlinkedEnumBuilder extends Object with _UnlinkedEnumMixin implements idl.
UnlinkedEnum { | 3993 class UnlinkedEnumBuilder extends Object with _UnlinkedEnumMixin implements idl.
UnlinkedEnum { |
| 4168 bool _finished = false; | |
| 4169 | |
| 4170 List<UnlinkedConstBuilder> _annotations; | 3994 List<UnlinkedConstBuilder> _annotations; |
| 4171 CodeRangeBuilder _codeRange; | 3995 CodeRangeBuilder _codeRange; |
| 4172 UnlinkedDocumentationCommentBuilder _documentationComment; | 3996 UnlinkedDocumentationCommentBuilder _documentationComment; |
| 4173 String _name; | 3997 String _name; |
| 4174 int _nameOffset; | 3998 int _nameOffset; |
| 4175 List<UnlinkedEnumValueBuilder> _values; | 3999 List<UnlinkedEnumValueBuilder> _values; |
| 4176 | 4000 |
| 4177 @override | 4001 @override |
| 4178 List<UnlinkedConstBuilder> get annotations => _annotations ??= <UnlinkedConstB
uilder>[]; | 4002 List<UnlinkedConstBuilder> get annotations => _annotations ??= <UnlinkedConstB
uilder>[]; |
| 4179 | 4003 |
| 4180 /** | 4004 /** |
| 4181 * Annotations for this enum. | 4005 * Annotations for this enum. |
| 4182 */ | 4006 */ |
| 4183 void set annotations(List<UnlinkedConstBuilder> _value) { | 4007 void set annotations(List<UnlinkedConstBuilder> _value) { |
| 4184 assert(!_finished); | |
| 4185 _annotations = _value; | 4008 _annotations = _value; |
| 4186 } | 4009 } |
| 4187 | 4010 |
| 4188 @override | 4011 @override |
| 4189 CodeRangeBuilder get codeRange => _codeRange; | 4012 CodeRangeBuilder get codeRange => _codeRange; |
| 4190 | 4013 |
| 4191 /** | 4014 /** |
| 4192 * Code range of the enum. | 4015 * Code range of the enum. |
| 4193 */ | 4016 */ |
| 4194 void set codeRange(CodeRangeBuilder _value) { | 4017 void set codeRange(CodeRangeBuilder _value) { |
| 4195 assert(!_finished); | |
| 4196 _codeRange = _value; | 4018 _codeRange = _value; |
| 4197 } | 4019 } |
| 4198 | 4020 |
| 4199 @override | 4021 @override |
| 4200 UnlinkedDocumentationCommentBuilder get documentationComment => _documentation
Comment; | 4022 UnlinkedDocumentationCommentBuilder get documentationComment => _documentation
Comment; |
| 4201 | 4023 |
| 4202 /** | 4024 /** |
| 4203 * Documentation comment for the enum, or `null` if there is no documentation | 4025 * Documentation comment for the enum, or `null` if there is no documentation |
| 4204 * comment. | 4026 * comment. |
| 4205 */ | 4027 */ |
| 4206 void set documentationComment(UnlinkedDocumentationCommentBuilder _value) { | 4028 void set documentationComment(UnlinkedDocumentationCommentBuilder _value) { |
| 4207 assert(!_finished); | |
| 4208 _documentationComment = _value; | 4029 _documentationComment = _value; |
| 4209 } | 4030 } |
| 4210 | 4031 |
| 4211 @override | 4032 @override |
| 4212 String get name => _name ??= ''; | 4033 String get name => _name ??= ''; |
| 4213 | 4034 |
| 4214 /** | 4035 /** |
| 4215 * Name of the enum type. | 4036 * Name of the enum type. |
| 4216 */ | 4037 */ |
| 4217 void set name(String _value) { | 4038 void set name(String _value) { |
| 4218 assert(!_finished); | |
| 4219 _name = _value; | 4039 _name = _value; |
| 4220 } | 4040 } |
| 4221 | 4041 |
| 4222 @override | 4042 @override |
| 4223 int get nameOffset => _nameOffset ??= 0; | 4043 int get nameOffset => _nameOffset ??= 0; |
| 4224 | 4044 |
| 4225 /** | 4045 /** |
| 4226 * Offset of the enum name relative to the beginning of the file. | 4046 * Offset of the enum name relative to the beginning of the file. |
| 4227 */ | 4047 */ |
| 4228 void set nameOffset(int _value) { | 4048 void set nameOffset(int _value) { |
| 4229 assert(!_finished); | |
| 4230 assert(_value == null || _value >= 0); | 4049 assert(_value == null || _value >= 0); |
| 4231 _nameOffset = _value; | 4050 _nameOffset = _value; |
| 4232 } | 4051 } |
| 4233 | 4052 |
| 4234 @override | 4053 @override |
| 4235 List<UnlinkedEnumValueBuilder> get values => _values ??= <UnlinkedEnumValueBui
lder>[]; | 4054 List<UnlinkedEnumValueBuilder> get values => _values ??= <UnlinkedEnumValueBui
lder>[]; |
| 4236 | 4055 |
| 4237 /** | 4056 /** |
| 4238 * Values listed in the enum declaration, in declaration order. | 4057 * Values listed in the enum declaration, in declaration order. |
| 4239 */ | 4058 */ |
| 4240 void set values(List<UnlinkedEnumValueBuilder> _value) { | 4059 void set values(List<UnlinkedEnumValueBuilder> _value) { |
| 4241 assert(!_finished); | |
| 4242 _values = _value; | 4060 _values = _value; |
| 4243 } | 4061 } |
| 4244 | 4062 |
| 4245 UnlinkedEnumBuilder({List<UnlinkedConstBuilder> annotations, CodeRangeBuilder
codeRange, UnlinkedDocumentationCommentBuilder documentationComment, String name
, int nameOffset, List<UnlinkedEnumValueBuilder> values}) | 4063 UnlinkedEnumBuilder({List<UnlinkedConstBuilder> annotations, CodeRangeBuilder
codeRange, UnlinkedDocumentationCommentBuilder documentationComment, String name
, int nameOffset, List<UnlinkedEnumValueBuilder> values}) |
| 4246 : _annotations = annotations, | 4064 : _annotations = annotations, |
| 4247 _codeRange = codeRange, | 4065 _codeRange = codeRange, |
| 4248 _documentationComment = documentationComment, | 4066 _documentationComment = documentationComment, |
| 4249 _name = name, | 4067 _name = name, |
| 4250 _nameOffset = nameOffset, | 4068 _nameOffset = nameOffset, |
| 4251 _values = values; | 4069 _values = values; |
| 4252 | 4070 |
| 4253 /** | 4071 /** |
| 4254 * Flush [informative] data recursively. | 4072 * Flush [informative] data recursively. |
| 4255 */ | 4073 */ |
| 4256 void flushInformative() { | 4074 void flushInformative() { |
| 4257 _annotations?.forEach((b) => b.flushInformative()); | 4075 _annotations?.forEach((b) => b.flushInformative()); |
| 4258 _codeRange = null; | 4076 _codeRange = null; |
| 4259 _documentationComment = null; | 4077 _documentationComment = null; |
| 4260 _nameOffset = null; | 4078 _nameOffset = null; |
| 4261 _values?.forEach((b) => b.flushInformative()); | 4079 _values?.forEach((b) => b.flushInformative()); |
| 4262 } | 4080 } |
| 4263 | 4081 |
| 4264 fb.Offset finish(fb.Builder fbBuilder) { | 4082 fb.Offset finish(fb.Builder fbBuilder) { |
| 4265 assert(!_finished); | |
| 4266 _finished = true; | |
| 4267 fb.Offset offset_annotations; | 4083 fb.Offset offset_annotations; |
| 4268 fb.Offset offset_codeRange; | 4084 fb.Offset offset_codeRange; |
| 4269 fb.Offset offset_documentationComment; | 4085 fb.Offset offset_documentationComment; |
| 4270 fb.Offset offset_name; | 4086 fb.Offset offset_name; |
| 4271 fb.Offset offset_values; | 4087 fb.Offset offset_values; |
| 4272 if (!(_annotations == null || _annotations.isEmpty)) { | 4088 if (!(_annotations == null || _annotations.isEmpty)) { |
| 4273 offset_annotations = fbBuilder.writeList(_annotations.map((b) => b.finish(
fbBuilder)).toList()); | 4089 offset_annotations = fbBuilder.writeList(_annotations.map((b) => b.finish(
fbBuilder)).toList()); |
| 4274 } | 4090 } |
| 4275 if (_codeRange != null) { | 4091 if (_codeRange != null) { |
| 4276 offset_codeRange = _codeRange.finish(fbBuilder); | 4092 offset_codeRange = _codeRange.finish(fbBuilder); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4385 "name": name, | 4201 "name": name, |
| 4386 "nameOffset": nameOffset, | 4202 "nameOffset": nameOffset, |
| 4387 "values": values, | 4203 "values": values, |
| 4388 }; | 4204 }; |
| 4389 | 4205 |
| 4390 @override | 4206 @override |
| 4391 String toString() => convert.JSON.encode(toJson()); | 4207 String toString() => convert.JSON.encode(toJson()); |
| 4392 } | 4208 } |
| 4393 | 4209 |
| 4394 class UnlinkedEnumValueBuilder extends Object with _UnlinkedEnumValueMixin imple
ments idl.UnlinkedEnumValue { | 4210 class UnlinkedEnumValueBuilder extends Object with _UnlinkedEnumValueMixin imple
ments idl.UnlinkedEnumValue { |
| 4395 bool _finished = false; | |
| 4396 | |
| 4397 UnlinkedDocumentationCommentBuilder _documentationComment; | 4211 UnlinkedDocumentationCommentBuilder _documentationComment; |
| 4398 String _name; | 4212 String _name; |
| 4399 int _nameOffset; | 4213 int _nameOffset; |
| 4400 | 4214 |
| 4401 @override | 4215 @override |
| 4402 UnlinkedDocumentationCommentBuilder get documentationComment => _documentation
Comment; | 4216 UnlinkedDocumentationCommentBuilder get documentationComment => _documentation
Comment; |
| 4403 | 4217 |
| 4404 /** | 4218 /** |
| 4405 * Documentation comment for the enum value, or `null` if there is no | 4219 * Documentation comment for the enum value, or `null` if there is no |
| 4406 * documentation comment. | 4220 * documentation comment. |
| 4407 */ | 4221 */ |
| 4408 void set documentationComment(UnlinkedDocumentationCommentBuilder _value) { | 4222 void set documentationComment(UnlinkedDocumentationCommentBuilder _value) { |
| 4409 assert(!_finished); | |
| 4410 _documentationComment = _value; | 4223 _documentationComment = _value; |
| 4411 } | 4224 } |
| 4412 | 4225 |
| 4413 @override | 4226 @override |
| 4414 String get name => _name ??= ''; | 4227 String get name => _name ??= ''; |
| 4415 | 4228 |
| 4416 /** | 4229 /** |
| 4417 * Name of the enumerated value. | 4230 * Name of the enumerated value. |
| 4418 */ | 4231 */ |
| 4419 void set name(String _value) { | 4232 void set name(String _value) { |
| 4420 assert(!_finished); | |
| 4421 _name = _value; | 4233 _name = _value; |
| 4422 } | 4234 } |
| 4423 | 4235 |
| 4424 @override | 4236 @override |
| 4425 int get nameOffset => _nameOffset ??= 0; | 4237 int get nameOffset => _nameOffset ??= 0; |
| 4426 | 4238 |
| 4427 /** | 4239 /** |
| 4428 * Offset of the enum value name relative to the beginning of the file. | 4240 * Offset of the enum value name relative to the beginning of the file. |
| 4429 */ | 4241 */ |
| 4430 void set nameOffset(int _value) { | 4242 void set nameOffset(int _value) { |
| 4431 assert(!_finished); | |
| 4432 assert(_value == null || _value >= 0); | 4243 assert(_value == null || _value >= 0); |
| 4433 _nameOffset = _value; | 4244 _nameOffset = _value; |
| 4434 } | 4245 } |
| 4435 | 4246 |
| 4436 UnlinkedEnumValueBuilder({UnlinkedDocumentationCommentBuilder documentationCom
ment, String name, int nameOffset}) | 4247 UnlinkedEnumValueBuilder({UnlinkedDocumentationCommentBuilder documentationCom
ment, String name, int nameOffset}) |
| 4437 : _documentationComment = documentationComment, | 4248 : _documentationComment = documentationComment, |
| 4438 _name = name, | 4249 _name = name, |
| 4439 _nameOffset = nameOffset; | 4250 _nameOffset = nameOffset; |
| 4440 | 4251 |
| 4441 /** | 4252 /** |
| 4442 * Flush [informative] data recursively. | 4253 * Flush [informative] data recursively. |
| 4443 */ | 4254 */ |
| 4444 void flushInformative() { | 4255 void flushInformative() { |
| 4445 _documentationComment = null; | 4256 _documentationComment = null; |
| 4446 _nameOffset = null; | 4257 _nameOffset = null; |
| 4447 } | 4258 } |
| 4448 | 4259 |
| 4449 fb.Offset finish(fb.Builder fbBuilder) { | 4260 fb.Offset finish(fb.Builder fbBuilder) { |
| 4450 assert(!_finished); | |
| 4451 _finished = true; | |
| 4452 fb.Offset offset_documentationComment; | 4261 fb.Offset offset_documentationComment; |
| 4453 fb.Offset offset_name; | 4262 fb.Offset offset_name; |
| 4454 if (_documentationComment != null) { | 4263 if (_documentationComment != null) { |
| 4455 offset_documentationComment = _documentationComment.finish(fbBuilder); | 4264 offset_documentationComment = _documentationComment.finish(fbBuilder); |
| 4456 } | 4265 } |
| 4457 if (_name != null) { | 4266 if (_name != null) { |
| 4458 offset_name = fbBuilder.writeString(_name); | 4267 offset_name = fbBuilder.writeString(_name); |
| 4459 } | 4268 } |
| 4460 fbBuilder.startTable(); | 4269 fbBuilder.startTable(); |
| 4461 if (offset_documentationComment != null) { | 4270 if (offset_documentationComment != null) { |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4522 "documentationComment": documentationComment, | 4331 "documentationComment": documentationComment, |
| 4523 "name": name, | 4332 "name": name, |
| 4524 "nameOffset": nameOffset, | 4333 "nameOffset": nameOffset, |
| 4525 }; | 4334 }; |
| 4526 | 4335 |
| 4527 @override | 4336 @override |
| 4528 String toString() => convert.JSON.encode(toJson()); | 4337 String toString() => convert.JSON.encode(toJson()); |
| 4529 } | 4338 } |
| 4530 | 4339 |
| 4531 class UnlinkedExecutableBuilder extends Object with _UnlinkedExecutableMixin imp
lements idl.UnlinkedExecutable { | 4340 class UnlinkedExecutableBuilder extends Object with _UnlinkedExecutableMixin imp
lements idl.UnlinkedExecutable { |
| 4532 bool _finished = false; | |
| 4533 | |
| 4534 List<UnlinkedConstBuilder> _annotations; | 4341 List<UnlinkedConstBuilder> _annotations; |
| 4535 UnlinkedConstBuilder _bodyExpr; | 4342 UnlinkedConstBuilder _bodyExpr; |
| 4536 CodeRangeBuilder _codeRange; | 4343 CodeRangeBuilder _codeRange; |
| 4537 List<UnlinkedConstructorInitializerBuilder> _constantInitializers; | 4344 List<UnlinkedConstructorInitializerBuilder> _constantInitializers; |
| 4538 int _constCycleSlot; | 4345 int _constCycleSlot; |
| 4539 UnlinkedDocumentationCommentBuilder _documentationComment; | 4346 UnlinkedDocumentationCommentBuilder _documentationComment; |
| 4540 int _inferredReturnTypeSlot; | 4347 int _inferredReturnTypeSlot; |
| 4541 bool _isAbstract; | 4348 bool _isAbstract; |
| 4542 bool _isAsynchronous; | 4349 bool _isAsynchronous; |
| 4543 bool _isConst; | 4350 bool _isConst; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 4562 int _visibleLength; | 4369 int _visibleLength; |
| 4563 int _visibleOffset; | 4370 int _visibleOffset; |
| 4564 | 4371 |
| 4565 @override | 4372 @override |
| 4566 List<UnlinkedConstBuilder> get annotations => _annotations ??= <UnlinkedConstB
uilder>[]; | 4373 List<UnlinkedConstBuilder> get annotations => _annotations ??= <UnlinkedConstB
uilder>[]; |
| 4567 | 4374 |
| 4568 /** | 4375 /** |
| 4569 * Annotations for this executable. | 4376 * Annotations for this executable. |
| 4570 */ | 4377 */ |
| 4571 void set annotations(List<UnlinkedConstBuilder> _value) { | 4378 void set annotations(List<UnlinkedConstBuilder> _value) { |
| 4572 assert(!_finished); | |
| 4573 _annotations = _value; | 4379 _annotations = _value; |
| 4574 } | 4380 } |
| 4575 | 4381 |
| 4576 @override | 4382 @override |
| 4577 UnlinkedConstBuilder get bodyExpr => _bodyExpr; | 4383 UnlinkedConstBuilder get bodyExpr => _bodyExpr; |
| 4578 | 4384 |
| 4579 /** | 4385 /** |
| 4580 * If this executable's function body is declared using `=>`, the expression | 4386 * If this executable's function body is declared using `=>`, the expression |
| 4581 * to the right of the `=>`. May be omitted if neither type inference nor | 4387 * to the right of the `=>`. May be omitted if neither type inference nor |
| 4582 * constant evaluation depends on the function body. | 4388 * constant evaluation depends on the function body. |
| 4583 */ | 4389 */ |
| 4584 void set bodyExpr(UnlinkedConstBuilder _value) { | 4390 void set bodyExpr(UnlinkedConstBuilder _value) { |
| 4585 assert(!_finished); | |
| 4586 _bodyExpr = _value; | 4391 _bodyExpr = _value; |
| 4587 } | 4392 } |
| 4588 | 4393 |
| 4589 @override | 4394 @override |
| 4590 CodeRangeBuilder get codeRange => _codeRange; | 4395 CodeRangeBuilder get codeRange => _codeRange; |
| 4591 | 4396 |
| 4592 /** | 4397 /** |
| 4593 * Code range of the executable. | 4398 * Code range of the executable. |
| 4594 */ | 4399 */ |
| 4595 void set codeRange(CodeRangeBuilder _value) { | 4400 void set codeRange(CodeRangeBuilder _value) { |
| 4596 assert(!_finished); | |
| 4597 _codeRange = _value; | 4401 _codeRange = _value; |
| 4598 } | 4402 } |
| 4599 | 4403 |
| 4600 @override | 4404 @override |
| 4601 List<UnlinkedConstructorInitializerBuilder> get constantInitializers => _const
antInitializers ??= <UnlinkedConstructorInitializerBuilder>[]; | 4405 List<UnlinkedConstructorInitializerBuilder> get constantInitializers => _const
antInitializers ??= <UnlinkedConstructorInitializerBuilder>[]; |
| 4602 | 4406 |
| 4603 /** | 4407 /** |
| 4604 * If a constant [UnlinkedExecutableKind.constructor], the constructor | 4408 * If a constant [UnlinkedExecutableKind.constructor], the constructor |
| 4605 * initializers. Otherwise empty. | 4409 * initializers. Otherwise empty. |
| 4606 */ | 4410 */ |
| 4607 void set constantInitializers(List<UnlinkedConstructorInitializerBuilder> _val
ue) { | 4411 void set constantInitializers(List<UnlinkedConstructorInitializerBuilder> _val
ue) { |
| 4608 assert(!_finished); | |
| 4609 _constantInitializers = _value; | 4412 _constantInitializers = _value; |
| 4610 } | 4413 } |
| 4611 | 4414 |
| 4612 @override | 4415 @override |
| 4613 int get constCycleSlot => _constCycleSlot ??= 0; | 4416 int get constCycleSlot => _constCycleSlot ??= 0; |
| 4614 | 4417 |
| 4615 /** | 4418 /** |
| 4616 * If [kind] is [UnlinkedExecutableKind.constructor] and [isConst] is `true`, | 4419 * If [kind] is [UnlinkedExecutableKind.constructor] and [isConst] is `true`, |
| 4617 * a nonzero slot id which is unique within this compilation unit. If this id | 4420 * a nonzero slot id which is unique within this compilation unit. If this id |
| 4618 * is found in [LinkedUnit.constCycles], then this constructor is part of a | 4421 * is found in [LinkedUnit.constCycles], then this constructor is part of a |
| 4619 * cycle. | 4422 * cycle. |
| 4620 * | 4423 * |
| 4621 * Otherwise, zero. | 4424 * Otherwise, zero. |
| 4622 */ | 4425 */ |
| 4623 void set constCycleSlot(int _value) { | 4426 void set constCycleSlot(int _value) { |
| 4624 assert(!_finished); | |
| 4625 assert(_value == null || _value >= 0); | 4427 assert(_value == null || _value >= 0); |
| 4626 _constCycleSlot = _value; | 4428 _constCycleSlot = _value; |
| 4627 } | 4429 } |
| 4628 | 4430 |
| 4629 @override | 4431 @override |
| 4630 UnlinkedDocumentationCommentBuilder get documentationComment => _documentation
Comment; | 4432 UnlinkedDocumentationCommentBuilder get documentationComment => _documentation
Comment; |
| 4631 | 4433 |
| 4632 /** | 4434 /** |
| 4633 * Documentation comment for the executable, or `null` if there is no | 4435 * Documentation comment for the executable, or `null` if there is no |
| 4634 * documentation comment. | 4436 * documentation comment. |
| 4635 */ | 4437 */ |
| 4636 void set documentationComment(UnlinkedDocumentationCommentBuilder _value) { | 4438 void set documentationComment(UnlinkedDocumentationCommentBuilder _value) { |
| 4637 assert(!_finished); | |
| 4638 _documentationComment = _value; | 4439 _documentationComment = _value; |
| 4639 } | 4440 } |
| 4640 | 4441 |
| 4641 @override | 4442 @override |
| 4642 int get inferredReturnTypeSlot => _inferredReturnTypeSlot ??= 0; | 4443 int get inferredReturnTypeSlot => _inferredReturnTypeSlot ??= 0; |
| 4643 | 4444 |
| 4644 /** | 4445 /** |
| 4645 * If this executable's return type is inferable, nonzero slot id | 4446 * If this executable's return type is inferable, nonzero slot id |
| 4646 * identifying which entry in [LinkedUnit.types] contains the inferred | 4447 * identifying which entry in [LinkedUnit.types] contains the inferred |
| 4647 * return type. If there is no matching entry in [LinkedUnit.types], then | 4448 * return type. If there is no matching entry in [LinkedUnit.types], then |
| 4648 * no return type was inferred for this variable, so its static type is | 4449 * no return type was inferred for this variable, so its static type is |
| 4649 * `dynamic`. | 4450 * `dynamic`. |
| 4650 */ | 4451 */ |
| 4651 void set inferredReturnTypeSlot(int _value) { | 4452 void set inferredReturnTypeSlot(int _value) { |
| 4652 assert(!_finished); | |
| 4653 assert(_value == null || _value >= 0); | 4453 assert(_value == null || _value >= 0); |
| 4654 _inferredReturnTypeSlot = _value; | 4454 _inferredReturnTypeSlot = _value; |
| 4655 } | 4455 } |
| 4656 | 4456 |
| 4657 @override | 4457 @override |
| 4658 bool get isAbstract => _isAbstract ??= false; | 4458 bool get isAbstract => _isAbstract ??= false; |
| 4659 | 4459 |
| 4660 /** | 4460 /** |
| 4661 * Indicates whether the executable is declared using the `abstract` keyword. | 4461 * Indicates whether the executable is declared using the `abstract` keyword. |
| 4662 */ | 4462 */ |
| 4663 void set isAbstract(bool _value) { | 4463 void set isAbstract(bool _value) { |
| 4664 assert(!_finished); | |
| 4665 _isAbstract = _value; | 4464 _isAbstract = _value; |
| 4666 } | 4465 } |
| 4667 | 4466 |
| 4668 @override | 4467 @override |
| 4669 bool get isAsynchronous => _isAsynchronous ??= false; | 4468 bool get isAsynchronous => _isAsynchronous ??= false; |
| 4670 | 4469 |
| 4671 /** | 4470 /** |
| 4672 * Indicates whether the executable has body marked as being asynchronous. | 4471 * Indicates whether the executable has body marked as being asynchronous. |
| 4673 */ | 4472 */ |
| 4674 void set isAsynchronous(bool _value) { | 4473 void set isAsynchronous(bool _value) { |
| 4675 assert(!_finished); | |
| 4676 _isAsynchronous = _value; | 4474 _isAsynchronous = _value; |
| 4677 } | 4475 } |
| 4678 | 4476 |
| 4679 @override | 4477 @override |
| 4680 bool get isConst => _isConst ??= false; | 4478 bool get isConst => _isConst ??= false; |
| 4681 | 4479 |
| 4682 /** | 4480 /** |
| 4683 * Indicates whether the executable is declared using the `const` keyword. | 4481 * Indicates whether the executable is declared using the `const` keyword. |
| 4684 */ | 4482 */ |
| 4685 void set isConst(bool _value) { | 4483 void set isConst(bool _value) { |
| 4686 assert(!_finished); | |
| 4687 _isConst = _value; | 4484 _isConst = _value; |
| 4688 } | 4485 } |
| 4689 | 4486 |
| 4690 @override | 4487 @override |
| 4691 bool get isExternal => _isExternal ??= false; | 4488 bool get isExternal => _isExternal ??= false; |
| 4692 | 4489 |
| 4693 /** | 4490 /** |
| 4694 * Indicates whether the executable is declared using the `external` keyword. | 4491 * Indicates whether the executable is declared using the `external` keyword. |
| 4695 */ | 4492 */ |
| 4696 void set isExternal(bool _value) { | 4493 void set isExternal(bool _value) { |
| 4697 assert(!_finished); | |
| 4698 _isExternal = _value; | 4494 _isExternal = _value; |
| 4699 } | 4495 } |
| 4700 | 4496 |
| 4701 @override | 4497 @override |
| 4702 bool get isFactory => _isFactory ??= false; | 4498 bool get isFactory => _isFactory ??= false; |
| 4703 | 4499 |
| 4704 /** | 4500 /** |
| 4705 * Indicates whether the executable is declared using the `factory` keyword. | 4501 * Indicates whether the executable is declared using the `factory` keyword. |
| 4706 */ | 4502 */ |
| 4707 void set isFactory(bool _value) { | 4503 void set isFactory(bool _value) { |
| 4708 assert(!_finished); | |
| 4709 _isFactory = _value; | 4504 _isFactory = _value; |
| 4710 } | 4505 } |
| 4711 | 4506 |
| 4712 @override | 4507 @override |
| 4713 bool get isGenerator => _isGenerator ??= false; | 4508 bool get isGenerator => _isGenerator ??= false; |
| 4714 | 4509 |
| 4715 /** | 4510 /** |
| 4716 * Indicates whether the executable has body marked as being a generator. | 4511 * Indicates whether the executable has body marked as being a generator. |
| 4717 */ | 4512 */ |
| 4718 void set isGenerator(bool _value) { | 4513 void set isGenerator(bool _value) { |
| 4719 assert(!_finished); | |
| 4720 _isGenerator = _value; | 4514 _isGenerator = _value; |
| 4721 } | 4515 } |
| 4722 | 4516 |
| 4723 @override | 4517 @override |
| 4724 bool get isRedirectedConstructor => _isRedirectedConstructor ??= false; | 4518 bool get isRedirectedConstructor => _isRedirectedConstructor ??= false; |
| 4725 | 4519 |
| 4726 /** | 4520 /** |
| 4727 * Indicates whether the executable is a redirected constructor. | 4521 * Indicates whether the executable is a redirected constructor. |
| 4728 */ | 4522 */ |
| 4729 void set isRedirectedConstructor(bool _value) { | 4523 void set isRedirectedConstructor(bool _value) { |
| 4730 assert(!_finished); | |
| 4731 _isRedirectedConstructor = _value; | 4524 _isRedirectedConstructor = _value; |
| 4732 } | 4525 } |
| 4733 | 4526 |
| 4734 @override | 4527 @override |
| 4735 bool get isStatic => _isStatic ??= false; | 4528 bool get isStatic => _isStatic ??= false; |
| 4736 | 4529 |
| 4737 /** | 4530 /** |
| 4738 * Indicates whether the executable is declared using the `static` keyword. | 4531 * Indicates whether the executable is declared using the `static` keyword. |
| 4739 * | 4532 * |
| 4740 * Note that for top level executables, this flag is false, since they are | 4533 * Note that for top level executables, this flag is false, since they are |
| 4741 * not declared using the `static` keyword (even though they are considered | 4534 * not declared using the `static` keyword (even though they are considered |
| 4742 * static for semantic purposes). | 4535 * static for semantic purposes). |
| 4743 */ | 4536 */ |
| 4744 void set isStatic(bool _value) { | 4537 void set isStatic(bool _value) { |
| 4745 assert(!_finished); | |
| 4746 _isStatic = _value; | 4538 _isStatic = _value; |
| 4747 } | 4539 } |
| 4748 | 4540 |
| 4749 @override | 4541 @override |
| 4750 idl.UnlinkedExecutableKind get kind => _kind ??= idl.UnlinkedExecutableKind.fu
nctionOrMethod; | 4542 idl.UnlinkedExecutableKind get kind => _kind ??= idl.UnlinkedExecutableKind.fu
nctionOrMethod; |
| 4751 | 4543 |
| 4752 /** | 4544 /** |
| 4753 * The kind of the executable (function/method, getter, setter, or | 4545 * The kind of the executable (function/method, getter, setter, or |
| 4754 * constructor). | 4546 * constructor). |
| 4755 */ | 4547 */ |
| 4756 void set kind(idl.UnlinkedExecutableKind _value) { | 4548 void set kind(idl.UnlinkedExecutableKind _value) { |
| 4757 assert(!_finished); | |
| 4758 _kind = _value; | 4549 _kind = _value; |
| 4759 } | 4550 } |
| 4760 | 4551 |
| 4761 @override | 4552 @override |
| 4762 List<UnlinkedExecutableBuilder> get localFunctions => _localFunctions ??= <Unl
inkedExecutableBuilder>[]; | 4553 List<UnlinkedExecutableBuilder> get localFunctions => _localFunctions ??= <Unl
inkedExecutableBuilder>[]; |
| 4763 | 4554 |
| 4764 /** | 4555 /** |
| 4765 * The list of local functions. | 4556 * The list of local functions. |
| 4766 */ | 4557 */ |
| 4767 void set localFunctions(List<UnlinkedExecutableBuilder> _value) { | 4558 void set localFunctions(List<UnlinkedExecutableBuilder> _value) { |
| 4768 assert(!_finished); | |
| 4769 _localFunctions = _value; | 4559 _localFunctions = _value; |
| 4770 } | 4560 } |
| 4771 | 4561 |
| 4772 @override | 4562 @override |
| 4773 List<UnlinkedLabelBuilder> get localLabels => _localLabels ??= <UnlinkedLabelB
uilder>[]; | 4563 List<UnlinkedLabelBuilder> get localLabels => _localLabels ??= <UnlinkedLabelB
uilder>[]; |
| 4774 | 4564 |
| 4775 /** | 4565 /** |
| 4776 * The list of local labels. | 4566 * The list of local labels. |
| 4777 */ | 4567 */ |
| 4778 void set localLabels(List<UnlinkedLabelBuilder> _value) { | 4568 void set localLabels(List<UnlinkedLabelBuilder> _value) { |
| 4779 assert(!_finished); | |
| 4780 _localLabels = _value; | 4569 _localLabels = _value; |
| 4781 } | 4570 } |
| 4782 | 4571 |
| 4783 @override | 4572 @override |
| 4784 List<UnlinkedVariableBuilder> get localVariables => _localVariables ??= <Unlin
kedVariableBuilder>[]; | 4573 List<UnlinkedVariableBuilder> get localVariables => _localVariables ??= <Unlin
kedVariableBuilder>[]; |
| 4785 | 4574 |
| 4786 /** | 4575 /** |
| 4787 * The list of local variables. | 4576 * The list of local variables. |
| 4788 */ | 4577 */ |
| 4789 void set localVariables(List<UnlinkedVariableBuilder> _value) { | 4578 void set localVariables(List<UnlinkedVariableBuilder> _value) { |
| 4790 assert(!_finished); | |
| 4791 _localVariables = _value; | 4579 _localVariables = _value; |
| 4792 } | 4580 } |
| 4793 | 4581 |
| 4794 @override | 4582 @override |
| 4795 String get name => _name ??= ''; | 4583 String get name => _name ??= ''; |
| 4796 | 4584 |
| 4797 /** | 4585 /** |
| 4798 * Name of the executable. For setters, this includes the trailing "=". For | 4586 * Name of the executable. For setters, this includes the trailing "=". For |
| 4799 * named constructors, this excludes the class name and excludes the ".". | 4587 * named constructors, this excludes the class name and excludes the ".". |
| 4800 * For unnamed constructors, this is the empty string. | 4588 * For unnamed constructors, this is the empty string. |
| 4801 */ | 4589 */ |
| 4802 void set name(String _value) { | 4590 void set name(String _value) { |
| 4803 assert(!_finished); | |
| 4804 _name = _value; | 4591 _name = _value; |
| 4805 } | 4592 } |
| 4806 | 4593 |
| 4807 @override | 4594 @override |
| 4808 int get nameEnd => _nameEnd ??= 0; | 4595 int get nameEnd => _nameEnd ??= 0; |
| 4809 | 4596 |
| 4810 /** | 4597 /** |
| 4811 * If [kind] is [UnlinkedExecutableKind.constructor] and [name] is not empty, | 4598 * If [kind] is [UnlinkedExecutableKind.constructor] and [name] is not empty, |
| 4812 * the offset of the end of the constructor name. Otherwise zero. | 4599 * the offset of the end of the constructor name. Otherwise zero. |
| 4813 */ | 4600 */ |
| 4814 void set nameEnd(int _value) { | 4601 void set nameEnd(int _value) { |
| 4815 assert(!_finished); | |
| 4816 assert(_value == null || _value >= 0); | 4602 assert(_value == null || _value >= 0); |
| 4817 _nameEnd = _value; | 4603 _nameEnd = _value; |
| 4818 } | 4604 } |
| 4819 | 4605 |
| 4820 @override | 4606 @override |
| 4821 int get nameOffset => _nameOffset ??= 0; | 4607 int get nameOffset => _nameOffset ??= 0; |
| 4822 | 4608 |
| 4823 /** | 4609 /** |
| 4824 * Offset of the executable name relative to the beginning of the file. For | 4610 * Offset of the executable name relative to the beginning of the file. For |
| 4825 * named constructors, this excludes the class name and excludes the ".". | 4611 * named constructors, this excludes the class name and excludes the ".". |
| 4826 * For unnamed constructors, this is the offset of the class name (i.e. the | 4612 * For unnamed constructors, this is the offset of the class name (i.e. the |
| 4827 * offset of the second "C" in "class C { C(); }"). | 4613 * offset of the second "C" in "class C { C(); }"). |
| 4828 */ | 4614 */ |
| 4829 void set nameOffset(int _value) { | 4615 void set nameOffset(int _value) { |
| 4830 assert(!_finished); | |
| 4831 assert(_value == null || _value >= 0); | 4616 assert(_value == null || _value >= 0); |
| 4832 _nameOffset = _value; | 4617 _nameOffset = _value; |
| 4833 } | 4618 } |
| 4834 | 4619 |
| 4835 @override | 4620 @override |
| 4836 List<UnlinkedParamBuilder> get parameters => _parameters ??= <UnlinkedParamBui
lder>[]; | 4621 List<UnlinkedParamBuilder> get parameters => _parameters ??= <UnlinkedParamBui
lder>[]; |
| 4837 | 4622 |
| 4838 /** | 4623 /** |
| 4839 * Parameters of the executable, if any. Note that getters have no | 4624 * Parameters of the executable, if any. Note that getters have no |
| 4840 * parameters (hence this will be the empty list), and setters have a single | 4625 * parameters (hence this will be the empty list), and setters have a single |
| 4841 * parameter. | 4626 * parameter. |
| 4842 */ | 4627 */ |
| 4843 void set parameters(List<UnlinkedParamBuilder> _value) { | 4628 void set parameters(List<UnlinkedParamBuilder> _value) { |
| 4844 assert(!_finished); | |
| 4845 _parameters = _value; | 4629 _parameters = _value; |
| 4846 } | 4630 } |
| 4847 | 4631 |
| 4848 @override | 4632 @override |
| 4849 int get periodOffset => _periodOffset ??= 0; | 4633 int get periodOffset => _periodOffset ??= 0; |
| 4850 | 4634 |
| 4851 /** | 4635 /** |
| 4852 * If [kind] is [UnlinkedExecutableKind.constructor] and [name] is not empty, | 4636 * If [kind] is [UnlinkedExecutableKind.constructor] and [name] is not empty, |
| 4853 * the offset of the period before the constructor name. Otherwise zero. | 4637 * the offset of the period before the constructor name. Otherwise zero. |
| 4854 */ | 4638 */ |
| 4855 void set periodOffset(int _value) { | 4639 void set periodOffset(int _value) { |
| 4856 assert(!_finished); | |
| 4857 assert(_value == null || _value >= 0); | 4640 assert(_value == null || _value >= 0); |
| 4858 _periodOffset = _value; | 4641 _periodOffset = _value; |
| 4859 } | 4642 } |
| 4860 | 4643 |
| 4861 @override | 4644 @override |
| 4862 EntityRefBuilder get redirectedConstructor => _redirectedConstructor; | 4645 EntityRefBuilder get redirectedConstructor => _redirectedConstructor; |
| 4863 | 4646 |
| 4864 /** | 4647 /** |
| 4865 * If [isRedirectedConstructor] and [isFactory] are both `true`, the | 4648 * If [isRedirectedConstructor] and [isFactory] are both `true`, the |
| 4866 * constructor to which this constructor redirects; otherwise empty. | 4649 * constructor to which this constructor redirects; otherwise empty. |
| 4867 */ | 4650 */ |
| 4868 void set redirectedConstructor(EntityRefBuilder _value) { | 4651 void set redirectedConstructor(EntityRefBuilder _value) { |
| 4869 assert(!_finished); | |
| 4870 _redirectedConstructor = _value; | 4652 _redirectedConstructor = _value; |
| 4871 } | 4653 } |
| 4872 | 4654 |
| 4873 @override | 4655 @override |
| 4874 String get redirectedConstructorName => _redirectedConstructorName ??= ''; | 4656 String get redirectedConstructorName => _redirectedConstructorName ??= ''; |
| 4875 | 4657 |
| 4876 /** | 4658 /** |
| 4877 * If [isRedirectedConstructor] is `true` and [isFactory] is `false`, the | 4659 * If [isRedirectedConstructor] is `true` and [isFactory] is `false`, the |
| 4878 * name of the constructor that this constructor redirects to; otherwise | 4660 * name of the constructor that this constructor redirects to; otherwise |
| 4879 * empty. | 4661 * empty. |
| 4880 */ | 4662 */ |
| 4881 void set redirectedConstructorName(String _value) { | 4663 void set redirectedConstructorName(String _value) { |
| 4882 assert(!_finished); | |
| 4883 _redirectedConstructorName = _value; | 4664 _redirectedConstructorName = _value; |
| 4884 } | 4665 } |
| 4885 | 4666 |
| 4886 @override | 4667 @override |
| 4887 EntityRefBuilder get returnType => _returnType; | 4668 EntityRefBuilder get returnType => _returnType; |
| 4888 | 4669 |
| 4889 /** | 4670 /** |
| 4890 * Declared return type of the executable. Absent if the executable is a | 4671 * Declared return type of the executable. Absent if the executable is a |
| 4891 * constructor or the return type is implicit. Absent for executables | 4672 * constructor or the return type is implicit. Absent for executables |
| 4892 * associated with variable initializers and closures, since these | 4673 * associated with variable initializers and closures, since these |
| 4893 * executables may have return types that are not accessible via direct | 4674 * executables may have return types that are not accessible via direct |
| 4894 * imports. | 4675 * imports. |
| 4895 */ | 4676 */ |
| 4896 void set returnType(EntityRefBuilder _value) { | 4677 void set returnType(EntityRefBuilder _value) { |
| 4897 assert(!_finished); | |
| 4898 _returnType = _value; | 4678 _returnType = _value; |
| 4899 } | 4679 } |
| 4900 | 4680 |
| 4901 @override | 4681 @override |
| 4902 List<UnlinkedTypeParamBuilder> get typeParameters => _typeParameters ??= <Unli
nkedTypeParamBuilder>[]; | 4682 List<UnlinkedTypeParamBuilder> get typeParameters => _typeParameters ??= <Unli
nkedTypeParamBuilder>[]; |
| 4903 | 4683 |
| 4904 /** | 4684 /** |
| 4905 * Type parameters of the executable, if any. Empty if support for generic | 4685 * Type parameters of the executable, if any. Empty if support for generic |
| 4906 * method syntax is disabled. | 4686 * method syntax is disabled. |
| 4907 */ | 4687 */ |
| 4908 void set typeParameters(List<UnlinkedTypeParamBuilder> _value) { | 4688 void set typeParameters(List<UnlinkedTypeParamBuilder> _value) { |
| 4909 assert(!_finished); | |
| 4910 _typeParameters = _value; | 4689 _typeParameters = _value; |
| 4911 } | 4690 } |
| 4912 | 4691 |
| 4913 @override | 4692 @override |
| 4914 int get visibleLength => _visibleLength ??= 0; | 4693 int get visibleLength => _visibleLength ??= 0; |
| 4915 | 4694 |
| 4916 /** | 4695 /** |
| 4917 * If a local function, the length of the visible range; zero otherwise. | 4696 * If a local function, the length of the visible range; zero otherwise. |
| 4918 */ | 4697 */ |
| 4919 void set visibleLength(int _value) { | 4698 void set visibleLength(int _value) { |
| 4920 assert(!_finished); | |
| 4921 assert(_value == null || _value >= 0); | 4699 assert(_value == null || _value >= 0); |
| 4922 _visibleLength = _value; | 4700 _visibleLength = _value; |
| 4923 } | 4701 } |
| 4924 | 4702 |
| 4925 @override | 4703 @override |
| 4926 int get visibleOffset => _visibleOffset ??= 0; | 4704 int get visibleOffset => _visibleOffset ??= 0; |
| 4927 | 4705 |
| 4928 /** | 4706 /** |
| 4929 * If a local function, the beginning of the visible range; zero otherwise. | 4707 * If a local function, the beginning of the visible range; zero otherwise. |
| 4930 */ | 4708 */ |
| 4931 void set visibleOffset(int _value) { | 4709 void set visibleOffset(int _value) { |
| 4932 assert(!_finished); | |
| 4933 assert(_value == null || _value >= 0); | 4710 assert(_value == null || _value >= 0); |
| 4934 _visibleOffset = _value; | 4711 _visibleOffset = _value; |
| 4935 } | 4712 } |
| 4936 | 4713 |
| 4937 UnlinkedExecutableBuilder({List<UnlinkedConstBuilder> annotations, UnlinkedCon
stBuilder bodyExpr, CodeRangeBuilder codeRange, List<UnlinkedConstructorInitiali
zerBuilder> constantInitializers, int constCycleSlot, UnlinkedDocumentationComme
ntBuilder documentationComment, int inferredReturnTypeSlot, bool isAbstract, boo
l isAsynchronous, bool isConst, bool isExternal, bool isFactory, bool isGenerato
r, bool isRedirectedConstructor, bool isStatic, idl.UnlinkedExecutableKind kind,
List<UnlinkedExecutableBuilder> localFunctions, List<UnlinkedLabelBuilder> loca
lLabels, List<UnlinkedVariableBuilder> localVariables, String name, int nameEnd,
int nameOffset, List<UnlinkedParamBuilder> parameters, int periodOffset, Entity
RefBuilder redirectedConstructor, String redirectedConstructorName, EntityRefBui
lder returnType, List<UnlinkedTypeParamBuilder> typeParameters, int visibleLengt
h, int visibleOffset}) | 4714 UnlinkedExecutableBuilder({List<UnlinkedConstBuilder> annotations, UnlinkedCon
stBuilder bodyExpr, CodeRangeBuilder codeRange, List<UnlinkedConstructorInitiali
zerBuilder> constantInitializers, int constCycleSlot, UnlinkedDocumentationComme
ntBuilder documentationComment, int inferredReturnTypeSlot, bool isAbstract, boo
l isAsynchronous, bool isConst, bool isExternal, bool isFactory, bool isGenerato
r, bool isRedirectedConstructor, bool isStatic, idl.UnlinkedExecutableKind kind,
List<UnlinkedExecutableBuilder> localFunctions, List<UnlinkedLabelBuilder> loca
lLabels, List<UnlinkedVariableBuilder> localVariables, String name, int nameEnd,
int nameOffset, List<UnlinkedParamBuilder> parameters, int periodOffset, Entity
RefBuilder redirectedConstructor, String redirectedConstructorName, EntityRefBui
lder returnType, List<UnlinkedTypeParamBuilder> typeParameters, int visibleLengt
h, int visibleOffset}) |
| 4938 : _annotations = annotations, | 4715 : _annotations = annotations, |
| 4939 _bodyExpr = bodyExpr, | 4716 _bodyExpr = bodyExpr, |
| 4940 _codeRange = codeRange, | 4717 _codeRange = codeRange, |
| 4941 _constantInitializers = constantInitializers, | 4718 _constantInitializers = constantInitializers, |
| 4942 _constCycleSlot = constCycleSlot, | 4719 _constCycleSlot = constCycleSlot, |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4983 _nameEnd = null; | 4760 _nameEnd = null; |
| 4984 _nameOffset = null; | 4761 _nameOffset = null; |
| 4985 _parameters?.forEach((b) => b.flushInformative()); | 4762 _parameters?.forEach((b) => b.flushInformative()); |
| 4986 _periodOffset = null; | 4763 _periodOffset = null; |
| 4987 _redirectedConstructor?.flushInformative(); | 4764 _redirectedConstructor?.flushInformative(); |
| 4988 _returnType?.flushInformative(); | 4765 _returnType?.flushInformative(); |
| 4989 _typeParameters?.forEach((b) => b.flushInformative()); | 4766 _typeParameters?.forEach((b) => b.flushInformative()); |
| 4990 } | 4767 } |
| 4991 | 4768 |
| 4992 fb.Offset finish(fb.Builder fbBuilder) { | 4769 fb.Offset finish(fb.Builder fbBuilder) { |
| 4993 assert(!_finished); | |
| 4994 _finished = true; | |
| 4995 fb.Offset offset_annotations; | 4770 fb.Offset offset_annotations; |
| 4996 fb.Offset offset_bodyExpr; | 4771 fb.Offset offset_bodyExpr; |
| 4997 fb.Offset offset_codeRange; | 4772 fb.Offset offset_codeRange; |
| 4998 fb.Offset offset_constantInitializers; | 4773 fb.Offset offset_constantInitializers; |
| 4999 fb.Offset offset_documentationComment; | 4774 fb.Offset offset_documentationComment; |
| 5000 fb.Offset offset_localFunctions; | 4775 fb.Offset offset_localFunctions; |
| 5001 fb.Offset offset_localLabels; | 4776 fb.Offset offset_localLabels; |
| 5002 fb.Offset offset_localVariables; | 4777 fb.Offset offset_localVariables; |
| 5003 fb.Offset offset_name; | 4778 fb.Offset offset_name; |
| 5004 fb.Offset offset_parameters; | 4779 fb.Offset offset_parameters; |
| (...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5437 "typeParameters": typeParameters, | 5212 "typeParameters": typeParameters, |
| 5438 "visibleLength": visibleLength, | 5213 "visibleLength": visibleLength, |
| 5439 "visibleOffset": visibleOffset, | 5214 "visibleOffset": visibleOffset, |
| 5440 }; | 5215 }; |
| 5441 | 5216 |
| 5442 @override | 5217 @override |
| 5443 String toString() => convert.JSON.encode(toJson()); | 5218 String toString() => convert.JSON.encode(toJson()); |
| 5444 } | 5219 } |
| 5445 | 5220 |
| 5446 class UnlinkedExportNonPublicBuilder extends Object with _UnlinkedExportNonPubli
cMixin implements idl.UnlinkedExportNonPublic { | 5221 class UnlinkedExportNonPublicBuilder extends Object with _UnlinkedExportNonPubli
cMixin implements idl.UnlinkedExportNonPublic { |
| 5447 bool _finished = false; | |
| 5448 | |
| 5449 List<UnlinkedConstBuilder> _annotations; | 5222 List<UnlinkedConstBuilder> _annotations; |
| 5450 int _offset; | 5223 int _offset; |
| 5451 int _uriEnd; | 5224 int _uriEnd; |
| 5452 int _uriOffset; | 5225 int _uriOffset; |
| 5453 | 5226 |
| 5454 @override | 5227 @override |
| 5455 List<UnlinkedConstBuilder> get annotations => _annotations ??= <UnlinkedConstB
uilder>[]; | 5228 List<UnlinkedConstBuilder> get annotations => _annotations ??= <UnlinkedConstB
uilder>[]; |
| 5456 | 5229 |
| 5457 /** | 5230 /** |
| 5458 * Annotations for this export directive. | 5231 * Annotations for this export directive. |
| 5459 */ | 5232 */ |
| 5460 void set annotations(List<UnlinkedConstBuilder> _value) { | 5233 void set annotations(List<UnlinkedConstBuilder> _value) { |
| 5461 assert(!_finished); | |
| 5462 _annotations = _value; | 5234 _annotations = _value; |
| 5463 } | 5235 } |
| 5464 | 5236 |
| 5465 @override | 5237 @override |
| 5466 int get offset => _offset ??= 0; | 5238 int get offset => _offset ??= 0; |
| 5467 | 5239 |
| 5468 /** | 5240 /** |
| 5469 * Offset of the "export" keyword. | 5241 * Offset of the "export" keyword. |
| 5470 */ | 5242 */ |
| 5471 void set offset(int _value) { | 5243 void set offset(int _value) { |
| 5472 assert(!_finished); | |
| 5473 assert(_value == null || _value >= 0); | 5244 assert(_value == null || _value >= 0); |
| 5474 _offset = _value; | 5245 _offset = _value; |
| 5475 } | 5246 } |
| 5476 | 5247 |
| 5477 @override | 5248 @override |
| 5478 int get uriEnd => _uriEnd ??= 0; | 5249 int get uriEnd => _uriEnd ??= 0; |
| 5479 | 5250 |
| 5480 /** | 5251 /** |
| 5481 * End of the URI string (including quotes) relative to the beginning of the | 5252 * End of the URI string (including quotes) relative to the beginning of the |
| 5482 * file. | 5253 * file. |
| 5483 */ | 5254 */ |
| 5484 void set uriEnd(int _value) { | 5255 void set uriEnd(int _value) { |
| 5485 assert(!_finished); | |
| 5486 assert(_value == null || _value >= 0); | 5256 assert(_value == null || _value >= 0); |
| 5487 _uriEnd = _value; | 5257 _uriEnd = _value; |
| 5488 } | 5258 } |
| 5489 | 5259 |
| 5490 @override | 5260 @override |
| 5491 int get uriOffset => _uriOffset ??= 0; | 5261 int get uriOffset => _uriOffset ??= 0; |
| 5492 | 5262 |
| 5493 /** | 5263 /** |
| 5494 * Offset of the URI string (including quotes) relative to the beginning of | 5264 * Offset of the URI string (including quotes) relative to the beginning of |
| 5495 * the file. | 5265 * the file. |
| 5496 */ | 5266 */ |
| 5497 void set uriOffset(int _value) { | 5267 void set uriOffset(int _value) { |
| 5498 assert(!_finished); | |
| 5499 assert(_value == null || _value >= 0); | 5268 assert(_value == null || _value >= 0); |
| 5500 _uriOffset = _value; | 5269 _uriOffset = _value; |
| 5501 } | 5270 } |
| 5502 | 5271 |
| 5503 UnlinkedExportNonPublicBuilder({List<UnlinkedConstBuilder> annotations, int of
fset, int uriEnd, int uriOffset}) | 5272 UnlinkedExportNonPublicBuilder({List<UnlinkedConstBuilder> annotations, int of
fset, int uriEnd, int uriOffset}) |
| 5504 : _annotations = annotations, | 5273 : _annotations = annotations, |
| 5505 _offset = offset, | 5274 _offset = offset, |
| 5506 _uriEnd = uriEnd, | 5275 _uriEnd = uriEnd, |
| 5507 _uriOffset = uriOffset; | 5276 _uriOffset = uriOffset; |
| 5508 | 5277 |
| 5509 /** | 5278 /** |
| 5510 * Flush [informative] data recursively. | 5279 * Flush [informative] data recursively. |
| 5511 */ | 5280 */ |
| 5512 void flushInformative() { | 5281 void flushInformative() { |
| 5513 _annotations?.forEach((b) => b.flushInformative()); | 5282 _annotations?.forEach((b) => b.flushInformative()); |
| 5514 _offset = null; | 5283 _offset = null; |
| 5515 _uriEnd = null; | 5284 _uriEnd = null; |
| 5516 _uriOffset = null; | 5285 _uriOffset = null; |
| 5517 } | 5286 } |
| 5518 | 5287 |
| 5519 fb.Offset finish(fb.Builder fbBuilder) { | 5288 fb.Offset finish(fb.Builder fbBuilder) { |
| 5520 assert(!_finished); | |
| 5521 _finished = true; | |
| 5522 fb.Offset offset_annotations; | 5289 fb.Offset offset_annotations; |
| 5523 if (!(_annotations == null || _annotations.isEmpty)) { | 5290 if (!(_annotations == null || _annotations.isEmpty)) { |
| 5524 offset_annotations = fbBuilder.writeList(_annotations.map((b) => b.finish(
fbBuilder)).toList()); | 5291 offset_annotations = fbBuilder.writeList(_annotations.map((b) => b.finish(
fbBuilder)).toList()); |
| 5525 } | 5292 } |
| 5526 fbBuilder.startTable(); | 5293 fbBuilder.startTable(); |
| 5527 if (offset_annotations != null) { | 5294 if (offset_annotations != null) { |
| 5528 fbBuilder.addOffset(3, offset_annotations); | 5295 fbBuilder.addOffset(3, offset_annotations); |
| 5529 } | 5296 } |
| 5530 if (_offset != null && _offset != 0) { | 5297 if (_offset != null && _offset != 0) { |
| 5531 fbBuilder.addUint32(0, _offset); | 5298 fbBuilder.addUint32(0, _offset); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5600 "offset": offset, | 5367 "offset": offset, |
| 5601 "uriEnd": uriEnd, | 5368 "uriEnd": uriEnd, |
| 5602 "uriOffset": uriOffset, | 5369 "uriOffset": uriOffset, |
| 5603 }; | 5370 }; |
| 5604 | 5371 |
| 5605 @override | 5372 @override |
| 5606 String toString() => convert.JSON.encode(toJson()); | 5373 String toString() => convert.JSON.encode(toJson()); |
| 5607 } | 5374 } |
| 5608 | 5375 |
| 5609 class UnlinkedExportPublicBuilder extends Object with _UnlinkedExportPublicMixin
implements idl.UnlinkedExportPublic { | 5376 class UnlinkedExportPublicBuilder extends Object with _UnlinkedExportPublicMixin
implements idl.UnlinkedExportPublic { |
| 5610 bool _finished = false; | |
| 5611 | |
| 5612 List<UnlinkedCombinatorBuilder> _combinators; | 5377 List<UnlinkedCombinatorBuilder> _combinators; |
| 5613 String _uri; | 5378 String _uri; |
| 5614 | 5379 |
| 5615 @override | 5380 @override |
| 5616 List<UnlinkedCombinatorBuilder> get combinators => _combinators ??= <UnlinkedC
ombinatorBuilder>[]; | 5381 List<UnlinkedCombinatorBuilder> get combinators => _combinators ??= <UnlinkedC
ombinatorBuilder>[]; |
| 5617 | 5382 |
| 5618 /** | 5383 /** |
| 5619 * Combinators contained in this import declaration. | 5384 * Combinators contained in this import declaration. |
| 5620 */ | 5385 */ |
| 5621 void set combinators(List<UnlinkedCombinatorBuilder> _value) { | 5386 void set combinators(List<UnlinkedCombinatorBuilder> _value) { |
| 5622 assert(!_finished); | |
| 5623 _combinators = _value; | 5387 _combinators = _value; |
| 5624 } | 5388 } |
| 5625 | 5389 |
| 5626 @override | 5390 @override |
| 5627 String get uri => _uri ??= ''; | 5391 String get uri => _uri ??= ''; |
| 5628 | 5392 |
| 5629 /** | 5393 /** |
| 5630 * URI used in the source code to reference the exported library. | 5394 * URI used in the source code to reference the exported library. |
| 5631 */ | 5395 */ |
| 5632 void set uri(String _value) { | 5396 void set uri(String _value) { |
| 5633 assert(!_finished); | |
| 5634 _uri = _value; | 5397 _uri = _value; |
| 5635 } | 5398 } |
| 5636 | 5399 |
| 5637 UnlinkedExportPublicBuilder({List<UnlinkedCombinatorBuilder> combinators, Stri
ng uri}) | 5400 UnlinkedExportPublicBuilder({List<UnlinkedCombinatorBuilder> combinators, Stri
ng uri}) |
| 5638 : _combinators = combinators, | 5401 : _combinators = combinators, |
| 5639 _uri = uri; | 5402 _uri = uri; |
| 5640 | 5403 |
| 5641 /** | 5404 /** |
| 5642 * Flush [informative] data recursively. | 5405 * Flush [informative] data recursively. |
| 5643 */ | 5406 */ |
| 5644 void flushInformative() { | 5407 void flushInformative() { |
| 5645 _combinators?.forEach((b) => b.flushInformative()); | 5408 _combinators?.forEach((b) => b.flushInformative()); |
| 5646 } | 5409 } |
| 5647 | 5410 |
| 5648 fb.Offset finish(fb.Builder fbBuilder) { | 5411 fb.Offset finish(fb.Builder fbBuilder) { |
| 5649 assert(!_finished); | |
| 5650 _finished = true; | |
| 5651 fb.Offset offset_combinators; | 5412 fb.Offset offset_combinators; |
| 5652 fb.Offset offset_uri; | 5413 fb.Offset offset_uri; |
| 5653 if (!(_combinators == null || _combinators.isEmpty)) { | 5414 if (!(_combinators == null || _combinators.isEmpty)) { |
| 5654 offset_combinators = fbBuilder.writeList(_combinators.map((b) => b.finish(
fbBuilder)).toList()); | 5415 offset_combinators = fbBuilder.writeList(_combinators.map((b) => b.finish(
fbBuilder)).toList()); |
| 5655 } | 5416 } |
| 5656 if (_uri != null) { | 5417 if (_uri != null) { |
| 5657 offset_uri = fbBuilder.writeString(_uri); | 5418 offset_uri = fbBuilder.writeString(_uri); |
| 5658 } | 5419 } |
| 5659 fbBuilder.startTable(); | 5420 fbBuilder.startTable(); |
| 5660 if (offset_combinators != null) { | 5421 if (offset_combinators != null) { |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5709 Map<String, Object> toMap() => { | 5470 Map<String, Object> toMap() => { |
| 5710 "combinators": combinators, | 5471 "combinators": combinators, |
| 5711 "uri": uri, | 5472 "uri": uri, |
| 5712 }; | 5473 }; |
| 5713 | 5474 |
| 5714 @override | 5475 @override |
| 5715 String toString() => convert.JSON.encode(toJson()); | 5476 String toString() => convert.JSON.encode(toJson()); |
| 5716 } | 5477 } |
| 5717 | 5478 |
| 5718 class UnlinkedImportBuilder extends Object with _UnlinkedImportMixin implements
idl.UnlinkedImport { | 5479 class UnlinkedImportBuilder extends Object with _UnlinkedImportMixin implements
idl.UnlinkedImport { |
| 5719 bool _finished = false; | |
| 5720 | |
| 5721 List<UnlinkedConstBuilder> _annotations; | 5480 List<UnlinkedConstBuilder> _annotations; |
| 5722 List<UnlinkedCombinatorBuilder> _combinators; | 5481 List<UnlinkedCombinatorBuilder> _combinators; |
| 5723 bool _isDeferred; | 5482 bool _isDeferred; |
| 5724 bool _isImplicit; | 5483 bool _isImplicit; |
| 5725 int _offset; | 5484 int _offset; |
| 5726 int _prefixOffset; | 5485 int _prefixOffset; |
| 5727 int _prefixReference; | 5486 int _prefixReference; |
| 5728 String _uri; | 5487 String _uri; |
| 5729 int _uriEnd; | 5488 int _uriEnd; |
| 5730 int _uriOffset; | 5489 int _uriOffset; |
| 5731 | 5490 |
| 5732 @override | 5491 @override |
| 5733 List<UnlinkedConstBuilder> get annotations => _annotations ??= <UnlinkedConstB
uilder>[]; | 5492 List<UnlinkedConstBuilder> get annotations => _annotations ??= <UnlinkedConstB
uilder>[]; |
| 5734 | 5493 |
| 5735 /** | 5494 /** |
| 5736 * Annotations for this import declaration. | 5495 * Annotations for this import declaration. |
| 5737 */ | 5496 */ |
| 5738 void set annotations(List<UnlinkedConstBuilder> _value) { | 5497 void set annotations(List<UnlinkedConstBuilder> _value) { |
| 5739 assert(!_finished); | |
| 5740 _annotations = _value; | 5498 _annotations = _value; |
| 5741 } | 5499 } |
| 5742 | 5500 |
| 5743 @override | 5501 @override |
| 5744 List<UnlinkedCombinatorBuilder> get combinators => _combinators ??= <UnlinkedC
ombinatorBuilder>[]; | 5502 List<UnlinkedCombinatorBuilder> get combinators => _combinators ??= <UnlinkedC
ombinatorBuilder>[]; |
| 5745 | 5503 |
| 5746 /** | 5504 /** |
| 5747 * Combinators contained in this import declaration. | 5505 * Combinators contained in this import declaration. |
| 5748 */ | 5506 */ |
| 5749 void set combinators(List<UnlinkedCombinatorBuilder> _value) { | 5507 void set combinators(List<UnlinkedCombinatorBuilder> _value) { |
| 5750 assert(!_finished); | |
| 5751 _combinators = _value; | 5508 _combinators = _value; |
| 5752 } | 5509 } |
| 5753 | 5510 |
| 5754 @override | 5511 @override |
| 5755 bool get isDeferred => _isDeferred ??= false; | 5512 bool get isDeferred => _isDeferred ??= false; |
| 5756 | 5513 |
| 5757 /** | 5514 /** |
| 5758 * Indicates whether the import declaration uses the `deferred` keyword. | 5515 * Indicates whether the import declaration uses the `deferred` keyword. |
| 5759 */ | 5516 */ |
| 5760 void set isDeferred(bool _value) { | 5517 void set isDeferred(bool _value) { |
| 5761 assert(!_finished); | |
| 5762 _isDeferred = _value; | 5518 _isDeferred = _value; |
| 5763 } | 5519 } |
| 5764 | 5520 |
| 5765 @override | 5521 @override |
| 5766 bool get isImplicit => _isImplicit ??= false; | 5522 bool get isImplicit => _isImplicit ??= false; |
| 5767 | 5523 |
| 5768 /** | 5524 /** |
| 5769 * Indicates whether the import declaration is implicit. | 5525 * Indicates whether the import declaration is implicit. |
| 5770 */ | 5526 */ |
| 5771 void set isImplicit(bool _value) { | 5527 void set isImplicit(bool _value) { |
| 5772 assert(!_finished); | |
| 5773 _isImplicit = _value; | 5528 _isImplicit = _value; |
| 5774 } | 5529 } |
| 5775 | 5530 |
| 5776 @override | 5531 @override |
| 5777 int get offset => _offset ??= 0; | 5532 int get offset => _offset ??= 0; |
| 5778 | 5533 |
| 5779 /** | 5534 /** |
| 5780 * If [isImplicit] is false, offset of the "import" keyword. If [isImplicit] | 5535 * If [isImplicit] is false, offset of the "import" keyword. If [isImplicit] |
| 5781 * is true, zero. | 5536 * is true, zero. |
| 5782 */ | 5537 */ |
| 5783 void set offset(int _value) { | 5538 void set offset(int _value) { |
| 5784 assert(!_finished); | |
| 5785 assert(_value == null || _value >= 0); | 5539 assert(_value == null || _value >= 0); |
| 5786 _offset = _value; | 5540 _offset = _value; |
| 5787 } | 5541 } |
| 5788 | 5542 |
| 5789 @override | 5543 @override |
| 5790 int get prefixOffset => _prefixOffset ??= 0; | 5544 int get prefixOffset => _prefixOffset ??= 0; |
| 5791 | 5545 |
| 5792 /** | 5546 /** |
| 5793 * Offset of the prefix name relative to the beginning of the file, or zero | 5547 * Offset of the prefix name relative to the beginning of the file, or zero |
| 5794 * if there is no prefix. | 5548 * if there is no prefix. |
| 5795 */ | 5549 */ |
| 5796 void set prefixOffset(int _value) { | 5550 void set prefixOffset(int _value) { |
| 5797 assert(!_finished); | |
| 5798 assert(_value == null || _value >= 0); | 5551 assert(_value == null || _value >= 0); |
| 5799 _prefixOffset = _value; | 5552 _prefixOffset = _value; |
| 5800 } | 5553 } |
| 5801 | 5554 |
| 5802 @override | 5555 @override |
| 5803 int get prefixReference => _prefixReference ??= 0; | 5556 int get prefixReference => _prefixReference ??= 0; |
| 5804 | 5557 |
| 5805 /** | 5558 /** |
| 5806 * Index into [UnlinkedUnit.references] of the prefix declared by this | 5559 * Index into [UnlinkedUnit.references] of the prefix declared by this |
| 5807 * import declaration, or zero if this import declaration declares no prefix. | 5560 * import declaration, or zero if this import declaration declares no prefix. |
| 5808 * | 5561 * |
| 5809 * Note that multiple imports can declare the same prefix. | 5562 * Note that multiple imports can declare the same prefix. |
| 5810 */ | 5563 */ |
| 5811 void set prefixReference(int _value) { | 5564 void set prefixReference(int _value) { |
| 5812 assert(!_finished); | |
| 5813 assert(_value == null || _value >= 0); | 5565 assert(_value == null || _value >= 0); |
| 5814 _prefixReference = _value; | 5566 _prefixReference = _value; |
| 5815 } | 5567 } |
| 5816 | 5568 |
| 5817 @override | 5569 @override |
| 5818 String get uri => _uri ??= ''; | 5570 String get uri => _uri ??= ''; |
| 5819 | 5571 |
| 5820 /** | 5572 /** |
| 5821 * URI used in the source code to reference the imported library. | 5573 * URI used in the source code to reference the imported library. |
| 5822 */ | 5574 */ |
| 5823 void set uri(String _value) { | 5575 void set uri(String _value) { |
| 5824 assert(!_finished); | |
| 5825 _uri = _value; | 5576 _uri = _value; |
| 5826 } | 5577 } |
| 5827 | 5578 |
| 5828 @override | 5579 @override |
| 5829 int get uriEnd => _uriEnd ??= 0; | 5580 int get uriEnd => _uriEnd ??= 0; |
| 5830 | 5581 |
| 5831 /** | 5582 /** |
| 5832 * End of the URI string (including quotes) relative to the beginning of the | 5583 * End of the URI string (including quotes) relative to the beginning of the |
| 5833 * file. If [isImplicit] is true, zero. | 5584 * file. If [isImplicit] is true, zero. |
| 5834 */ | 5585 */ |
| 5835 void set uriEnd(int _value) { | 5586 void set uriEnd(int _value) { |
| 5836 assert(!_finished); | |
| 5837 assert(_value == null || _value >= 0); | 5587 assert(_value == null || _value >= 0); |
| 5838 _uriEnd = _value; | 5588 _uriEnd = _value; |
| 5839 } | 5589 } |
| 5840 | 5590 |
| 5841 @override | 5591 @override |
| 5842 int get uriOffset => _uriOffset ??= 0; | 5592 int get uriOffset => _uriOffset ??= 0; |
| 5843 | 5593 |
| 5844 /** | 5594 /** |
| 5845 * Offset of the URI string (including quotes) relative to the beginning of | 5595 * Offset of the URI string (including quotes) relative to the beginning of |
| 5846 * the file. If [isImplicit] is true, zero. | 5596 * the file. If [isImplicit] is true, zero. |
| 5847 */ | 5597 */ |
| 5848 void set uriOffset(int _value) { | 5598 void set uriOffset(int _value) { |
| 5849 assert(!_finished); | |
| 5850 assert(_value == null || _value >= 0); | 5599 assert(_value == null || _value >= 0); |
| 5851 _uriOffset = _value; | 5600 _uriOffset = _value; |
| 5852 } | 5601 } |
| 5853 | 5602 |
| 5854 UnlinkedImportBuilder({List<UnlinkedConstBuilder> annotations, List<UnlinkedCo
mbinatorBuilder> combinators, bool isDeferred, bool isImplicit, int offset, int
prefixOffset, int prefixReference, String uri, int uriEnd, int uriOffset}) | 5603 UnlinkedImportBuilder({List<UnlinkedConstBuilder> annotations, List<UnlinkedCo
mbinatorBuilder> combinators, bool isDeferred, bool isImplicit, int offset, int
prefixOffset, int prefixReference, String uri, int uriEnd, int uriOffset}) |
| 5855 : _annotations = annotations, | 5604 : _annotations = annotations, |
| 5856 _combinators = combinators, | 5605 _combinators = combinators, |
| 5857 _isDeferred = isDeferred, | 5606 _isDeferred = isDeferred, |
| 5858 _isImplicit = isImplicit, | 5607 _isImplicit = isImplicit, |
| 5859 _offset = offset, | 5608 _offset = offset, |
| 5860 _prefixOffset = prefixOffset, | 5609 _prefixOffset = prefixOffset, |
| 5861 _prefixReference = prefixReference, | 5610 _prefixReference = prefixReference, |
| 5862 _uri = uri, | 5611 _uri = uri, |
| 5863 _uriEnd = uriEnd, | 5612 _uriEnd = uriEnd, |
| 5864 _uriOffset = uriOffset; | 5613 _uriOffset = uriOffset; |
| 5865 | 5614 |
| 5866 /** | 5615 /** |
| 5867 * Flush [informative] data recursively. | 5616 * Flush [informative] data recursively. |
| 5868 */ | 5617 */ |
| 5869 void flushInformative() { | 5618 void flushInformative() { |
| 5870 _annotations?.forEach((b) => b.flushInformative()); | 5619 _annotations?.forEach((b) => b.flushInformative()); |
| 5871 _combinators?.forEach((b) => b.flushInformative()); | 5620 _combinators?.forEach((b) => b.flushInformative()); |
| 5872 _offset = null; | 5621 _offset = null; |
| 5873 _prefixOffset = null; | 5622 _prefixOffset = null; |
| 5874 _uriEnd = null; | 5623 _uriEnd = null; |
| 5875 _uriOffset = null; | 5624 _uriOffset = null; |
| 5876 } | 5625 } |
| 5877 | 5626 |
| 5878 fb.Offset finish(fb.Builder fbBuilder) { | 5627 fb.Offset finish(fb.Builder fbBuilder) { |
| 5879 assert(!_finished); | |
| 5880 _finished = true; | |
| 5881 fb.Offset offset_annotations; | 5628 fb.Offset offset_annotations; |
| 5882 fb.Offset offset_combinators; | 5629 fb.Offset offset_combinators; |
| 5883 fb.Offset offset_uri; | 5630 fb.Offset offset_uri; |
| 5884 if (!(_annotations == null || _annotations.isEmpty)) { | 5631 if (!(_annotations == null || _annotations.isEmpty)) { |
| 5885 offset_annotations = fbBuilder.writeList(_annotations.map((b) => b.finish(
fbBuilder)).toList()); | 5632 offset_annotations = fbBuilder.writeList(_annotations.map((b) => b.finish(
fbBuilder)).toList()); |
| 5886 } | 5633 } |
| 5887 if (!(_combinators == null || _combinators.isEmpty)) { | 5634 if (!(_combinators == null || _combinators.isEmpty)) { |
| 5888 offset_combinators = fbBuilder.writeList(_combinators.map((b) => b.finish(
fbBuilder)).toList()); | 5635 offset_combinators = fbBuilder.writeList(_combinators.map((b) => b.finish(
fbBuilder)).toList()); |
| 5889 } | 5636 } |
| 5890 if (_uri != null) { | 5637 if (_uri != null) { |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6039 "uri": uri, | 5786 "uri": uri, |
| 6040 "uriEnd": uriEnd, | 5787 "uriEnd": uriEnd, |
| 6041 "uriOffset": uriOffset, | 5788 "uriOffset": uriOffset, |
| 6042 }; | 5789 }; |
| 6043 | 5790 |
| 6044 @override | 5791 @override |
| 6045 String toString() => convert.JSON.encode(toJson()); | 5792 String toString() => convert.JSON.encode(toJson()); |
| 6046 } | 5793 } |
| 6047 | 5794 |
| 6048 class UnlinkedLabelBuilder extends Object with _UnlinkedLabelMixin implements id
l.UnlinkedLabel { | 5795 class UnlinkedLabelBuilder extends Object with _UnlinkedLabelMixin implements id
l.UnlinkedLabel { |
| 6049 bool _finished = false; | |
| 6050 | |
| 6051 bool _isOnSwitchMember; | 5796 bool _isOnSwitchMember; |
| 6052 bool _isOnSwitchStatement; | 5797 bool _isOnSwitchStatement; |
| 6053 String _name; | 5798 String _name; |
| 6054 int _nameOffset; | 5799 int _nameOffset; |
| 6055 | 5800 |
| 6056 @override | 5801 @override |
| 6057 bool get isOnSwitchMember => _isOnSwitchMember ??= false; | 5802 bool get isOnSwitchMember => _isOnSwitchMember ??= false; |
| 6058 | 5803 |
| 6059 /** | 5804 /** |
| 6060 * Return `true` if this label is associated with a `switch` member (`case` or | 5805 * Return `true` if this label is associated with a `switch` member (`case` or |
| 6061 * `default`). | 5806 * `default`). |
| 6062 */ | 5807 */ |
| 6063 void set isOnSwitchMember(bool _value) { | 5808 void set isOnSwitchMember(bool _value) { |
| 6064 assert(!_finished); | |
| 6065 _isOnSwitchMember = _value; | 5809 _isOnSwitchMember = _value; |
| 6066 } | 5810 } |
| 6067 | 5811 |
| 6068 @override | 5812 @override |
| 6069 bool get isOnSwitchStatement => _isOnSwitchStatement ??= false; | 5813 bool get isOnSwitchStatement => _isOnSwitchStatement ??= false; |
| 6070 | 5814 |
| 6071 /** | 5815 /** |
| 6072 * Return `true` if this label is associated with a `switch` statement. | 5816 * Return `true` if this label is associated with a `switch` statement. |
| 6073 */ | 5817 */ |
| 6074 void set isOnSwitchStatement(bool _value) { | 5818 void set isOnSwitchStatement(bool _value) { |
| 6075 assert(!_finished); | |
| 6076 _isOnSwitchStatement = _value; | 5819 _isOnSwitchStatement = _value; |
| 6077 } | 5820 } |
| 6078 | 5821 |
| 6079 @override | 5822 @override |
| 6080 String get name => _name ??= ''; | 5823 String get name => _name ??= ''; |
| 6081 | 5824 |
| 6082 /** | 5825 /** |
| 6083 * Name of the label. | 5826 * Name of the label. |
| 6084 */ | 5827 */ |
| 6085 void set name(String _value) { | 5828 void set name(String _value) { |
| 6086 assert(!_finished); | |
| 6087 _name = _value; | 5829 _name = _value; |
| 6088 } | 5830 } |
| 6089 | 5831 |
| 6090 @override | 5832 @override |
| 6091 int get nameOffset => _nameOffset ??= 0; | 5833 int get nameOffset => _nameOffset ??= 0; |
| 6092 | 5834 |
| 6093 /** | 5835 /** |
| 6094 * Offset of the label relative to the beginning of the file. | 5836 * Offset of the label relative to the beginning of the file. |
| 6095 */ | 5837 */ |
| 6096 void set nameOffset(int _value) { | 5838 void set nameOffset(int _value) { |
| 6097 assert(!_finished); | |
| 6098 assert(_value == null || _value >= 0); | 5839 assert(_value == null || _value >= 0); |
| 6099 _nameOffset = _value; | 5840 _nameOffset = _value; |
| 6100 } | 5841 } |
| 6101 | 5842 |
| 6102 UnlinkedLabelBuilder({bool isOnSwitchMember, bool isOnSwitchStatement, String
name, int nameOffset}) | 5843 UnlinkedLabelBuilder({bool isOnSwitchMember, bool isOnSwitchStatement, String
name, int nameOffset}) |
| 6103 : _isOnSwitchMember = isOnSwitchMember, | 5844 : _isOnSwitchMember = isOnSwitchMember, |
| 6104 _isOnSwitchStatement = isOnSwitchStatement, | 5845 _isOnSwitchStatement = isOnSwitchStatement, |
| 6105 _name = name, | 5846 _name = name, |
| 6106 _nameOffset = nameOffset; | 5847 _nameOffset = nameOffset; |
| 6107 | 5848 |
| 6108 /** | 5849 /** |
| 6109 * Flush [informative] data recursively. | 5850 * Flush [informative] data recursively. |
| 6110 */ | 5851 */ |
| 6111 void flushInformative() { | 5852 void flushInformative() { |
| 6112 _nameOffset = null; | 5853 _nameOffset = null; |
| 6113 } | 5854 } |
| 6114 | 5855 |
| 6115 fb.Offset finish(fb.Builder fbBuilder) { | 5856 fb.Offset finish(fb.Builder fbBuilder) { |
| 6116 assert(!_finished); | |
| 6117 _finished = true; | |
| 6118 fb.Offset offset_name; | 5857 fb.Offset offset_name; |
| 6119 if (_name != null) { | 5858 if (_name != null) { |
| 6120 offset_name = fbBuilder.writeString(_name); | 5859 offset_name = fbBuilder.writeString(_name); |
| 6121 } | 5860 } |
| 6122 fbBuilder.startTable(); | 5861 fbBuilder.startTable(); |
| 6123 if (_isOnSwitchMember == true) { | 5862 if (_isOnSwitchMember == true) { |
| 6124 fbBuilder.addBool(2, true); | 5863 fbBuilder.addBool(2, true); |
| 6125 } | 5864 } |
| 6126 if (_isOnSwitchStatement == true) { | 5865 if (_isOnSwitchStatement == true) { |
| 6127 fbBuilder.addBool(3, true); | 5866 fbBuilder.addBool(3, true); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6196 "isOnSwitchStatement": isOnSwitchStatement, | 5935 "isOnSwitchStatement": isOnSwitchStatement, |
| 6197 "name": name, | 5936 "name": name, |
| 6198 "nameOffset": nameOffset, | 5937 "nameOffset": nameOffset, |
| 6199 }; | 5938 }; |
| 6200 | 5939 |
| 6201 @override | 5940 @override |
| 6202 String toString() => convert.JSON.encode(toJson()); | 5941 String toString() => convert.JSON.encode(toJson()); |
| 6203 } | 5942 } |
| 6204 | 5943 |
| 6205 class UnlinkedParamBuilder extends Object with _UnlinkedParamMixin implements id
l.UnlinkedParam { | 5944 class UnlinkedParamBuilder extends Object with _UnlinkedParamMixin implements id
l.UnlinkedParam { |
| 6206 bool _finished = false; | |
| 6207 | |
| 6208 List<UnlinkedConstBuilder> _annotations; | 5945 List<UnlinkedConstBuilder> _annotations; |
| 6209 CodeRangeBuilder _codeRange; | 5946 CodeRangeBuilder _codeRange; |
| 6210 String _defaultValueCode; | 5947 String _defaultValueCode; |
| 6211 int _inferredTypeSlot; | 5948 int _inferredTypeSlot; |
| 6212 UnlinkedExecutableBuilder _initializer; | 5949 UnlinkedExecutableBuilder _initializer; |
| 6213 bool _isFunctionTyped; | 5950 bool _isFunctionTyped; |
| 6214 bool _isInitializingFormal; | 5951 bool _isInitializingFormal; |
| 6215 idl.UnlinkedParamKind _kind; | 5952 idl.UnlinkedParamKind _kind; |
| 6216 String _name; | 5953 String _name; |
| 6217 int _nameOffset; | 5954 int _nameOffset; |
| 6218 List<UnlinkedParamBuilder> _parameters; | 5955 List<UnlinkedParamBuilder> _parameters; |
| 6219 EntityRefBuilder _type; | 5956 EntityRefBuilder _type; |
| 6220 int _visibleLength; | 5957 int _visibleLength; |
| 6221 int _visibleOffset; | 5958 int _visibleOffset; |
| 6222 | 5959 |
| 6223 @override | 5960 @override |
| 6224 List<UnlinkedConstBuilder> get annotations => _annotations ??= <UnlinkedConstB
uilder>[]; | 5961 List<UnlinkedConstBuilder> get annotations => _annotations ??= <UnlinkedConstB
uilder>[]; |
| 6225 | 5962 |
| 6226 /** | 5963 /** |
| 6227 * Annotations for this parameter. | 5964 * Annotations for this parameter. |
| 6228 */ | 5965 */ |
| 6229 void set annotations(List<UnlinkedConstBuilder> _value) { | 5966 void set annotations(List<UnlinkedConstBuilder> _value) { |
| 6230 assert(!_finished); | |
| 6231 _annotations = _value; | 5967 _annotations = _value; |
| 6232 } | 5968 } |
| 6233 | 5969 |
| 6234 @override | 5970 @override |
| 6235 CodeRangeBuilder get codeRange => _codeRange; | 5971 CodeRangeBuilder get codeRange => _codeRange; |
| 6236 | 5972 |
| 6237 /** | 5973 /** |
| 6238 * Code range of the parameter. | 5974 * Code range of the parameter. |
| 6239 */ | 5975 */ |
| 6240 void set codeRange(CodeRangeBuilder _value) { | 5976 void set codeRange(CodeRangeBuilder _value) { |
| 6241 assert(!_finished); | |
| 6242 _codeRange = _value; | 5977 _codeRange = _value; |
| 6243 } | 5978 } |
| 6244 | 5979 |
| 6245 @override | 5980 @override |
| 6246 String get defaultValueCode => _defaultValueCode ??= ''; | 5981 String get defaultValueCode => _defaultValueCode ??= ''; |
| 6247 | 5982 |
| 6248 /** | 5983 /** |
| 6249 * If the parameter has a default value, the source text of the constant | 5984 * If the parameter has a default value, the source text of the constant |
| 6250 * expression in the default value. Otherwise the empty string. | 5985 * expression in the default value. Otherwise the empty string. |
| 6251 */ | 5986 */ |
| 6252 void set defaultValueCode(String _value) { | 5987 void set defaultValueCode(String _value) { |
| 6253 assert(!_finished); | |
| 6254 _defaultValueCode = _value; | 5988 _defaultValueCode = _value; |
| 6255 } | 5989 } |
| 6256 | 5990 |
| 6257 @override | 5991 @override |
| 6258 int get inferredTypeSlot => _inferredTypeSlot ??= 0; | 5992 int get inferredTypeSlot => _inferredTypeSlot ??= 0; |
| 6259 | 5993 |
| 6260 /** | 5994 /** |
| 6261 * If this parameter's type is inferable, nonzero slot id identifying which | 5995 * If this parameter's type is inferable, nonzero slot id identifying which |
| 6262 * entry in [LinkedLibrary.types] contains the inferred type. If there is no | 5996 * entry in [LinkedLibrary.types] contains the inferred type. If there is no |
| 6263 * matching entry in [LinkedLibrary.types], then no type was inferred for | 5997 * matching entry in [LinkedLibrary.types], then no type was inferred for |
| 6264 * this variable, so its static type is `dynamic`. | 5998 * this variable, so its static type is `dynamic`. |
| 6265 * | 5999 * |
| 6266 * Note that although strong mode considers initializing formals to be | 6000 * Note that although strong mode considers initializing formals to be |
| 6267 * inferable, they are not marked as such in the summary; if their type is | 6001 * inferable, they are not marked as such in the summary; if their type is |
| 6268 * not specified, they always inherit the static type of the corresponding | 6002 * not specified, they always inherit the static type of the corresponding |
| 6269 * field. | 6003 * field. |
| 6270 */ | 6004 */ |
| 6271 void set inferredTypeSlot(int _value) { | 6005 void set inferredTypeSlot(int _value) { |
| 6272 assert(!_finished); | |
| 6273 assert(_value == null || _value >= 0); | 6006 assert(_value == null || _value >= 0); |
| 6274 _inferredTypeSlot = _value; | 6007 _inferredTypeSlot = _value; |
| 6275 } | 6008 } |
| 6276 | 6009 |
| 6277 @override | 6010 @override |
| 6278 UnlinkedExecutableBuilder get initializer => _initializer; | 6011 UnlinkedExecutableBuilder get initializer => _initializer; |
| 6279 | 6012 |
| 6280 /** | 6013 /** |
| 6281 * The synthetic initializer function of the parameter. Absent if the variabl
e | 6014 * The synthetic initializer function of the parameter. Absent if the variabl
e |
| 6282 * does not have an initializer. | 6015 * does not have an initializer. |
| 6283 */ | 6016 */ |
| 6284 void set initializer(UnlinkedExecutableBuilder _value) { | 6017 void set initializer(UnlinkedExecutableBuilder _value) { |
| 6285 assert(!_finished); | |
| 6286 _initializer = _value; | 6018 _initializer = _value; |
| 6287 } | 6019 } |
| 6288 | 6020 |
| 6289 @override | 6021 @override |
| 6290 bool get isFunctionTyped => _isFunctionTyped ??= false; | 6022 bool get isFunctionTyped => _isFunctionTyped ??= false; |
| 6291 | 6023 |
| 6292 /** | 6024 /** |
| 6293 * Indicates whether this is a function-typed parameter. | 6025 * Indicates whether this is a function-typed parameter. |
| 6294 */ | 6026 */ |
| 6295 void set isFunctionTyped(bool _value) { | 6027 void set isFunctionTyped(bool _value) { |
| 6296 assert(!_finished); | |
| 6297 _isFunctionTyped = _value; | 6028 _isFunctionTyped = _value; |
| 6298 } | 6029 } |
| 6299 | 6030 |
| 6300 @override | 6031 @override |
| 6301 bool get isInitializingFormal => _isInitializingFormal ??= false; | 6032 bool get isInitializingFormal => _isInitializingFormal ??= false; |
| 6302 | 6033 |
| 6303 /** | 6034 /** |
| 6304 * Indicates whether this is an initializing formal parameter (i.e. it is | 6035 * Indicates whether this is an initializing formal parameter (i.e. it is |
| 6305 * declared using `this.` syntax). | 6036 * declared using `this.` syntax). |
| 6306 */ | 6037 */ |
| 6307 void set isInitializingFormal(bool _value) { | 6038 void set isInitializingFormal(bool _value) { |
| 6308 assert(!_finished); | |
| 6309 _isInitializingFormal = _value; | 6039 _isInitializingFormal = _value; |
| 6310 } | 6040 } |
| 6311 | 6041 |
| 6312 @override | 6042 @override |
| 6313 idl.UnlinkedParamKind get kind => _kind ??= idl.UnlinkedParamKind.required; | 6043 idl.UnlinkedParamKind get kind => _kind ??= idl.UnlinkedParamKind.required; |
| 6314 | 6044 |
| 6315 /** | 6045 /** |
| 6316 * Kind of the parameter. | 6046 * Kind of the parameter. |
| 6317 */ | 6047 */ |
| 6318 void set kind(idl.UnlinkedParamKind _value) { | 6048 void set kind(idl.UnlinkedParamKind _value) { |
| 6319 assert(!_finished); | |
| 6320 _kind = _value; | 6049 _kind = _value; |
| 6321 } | 6050 } |
| 6322 | 6051 |
| 6323 @override | 6052 @override |
| 6324 String get name => _name ??= ''; | 6053 String get name => _name ??= ''; |
| 6325 | 6054 |
| 6326 /** | 6055 /** |
| 6327 * Name of the parameter. | 6056 * Name of the parameter. |
| 6328 */ | 6057 */ |
| 6329 void set name(String _value) { | 6058 void set name(String _value) { |
| 6330 assert(!_finished); | |
| 6331 _name = _value; | 6059 _name = _value; |
| 6332 } | 6060 } |
| 6333 | 6061 |
| 6334 @override | 6062 @override |
| 6335 int get nameOffset => _nameOffset ??= 0; | 6063 int get nameOffset => _nameOffset ??= 0; |
| 6336 | 6064 |
| 6337 /** | 6065 /** |
| 6338 * Offset of the parameter name relative to the beginning of the file. | 6066 * Offset of the parameter name relative to the beginning of the file. |
| 6339 */ | 6067 */ |
| 6340 void set nameOffset(int _value) { | 6068 void set nameOffset(int _value) { |
| 6341 assert(!_finished); | |
| 6342 assert(_value == null || _value >= 0); | 6069 assert(_value == null || _value >= 0); |
| 6343 _nameOffset = _value; | 6070 _nameOffset = _value; |
| 6344 } | 6071 } |
| 6345 | 6072 |
| 6346 @override | 6073 @override |
| 6347 List<UnlinkedParamBuilder> get parameters => _parameters ??= <UnlinkedParamBui
lder>[]; | 6074 List<UnlinkedParamBuilder> get parameters => _parameters ??= <UnlinkedParamBui
lder>[]; |
| 6348 | 6075 |
| 6349 /** | 6076 /** |
| 6350 * If [isFunctionTyped] is `true`, the parameters of the function type. | 6077 * If [isFunctionTyped] is `true`, the parameters of the function type. |
| 6351 */ | 6078 */ |
| 6352 void set parameters(List<UnlinkedParamBuilder> _value) { | 6079 void set parameters(List<UnlinkedParamBuilder> _value) { |
| 6353 assert(!_finished); | |
| 6354 _parameters = _value; | 6080 _parameters = _value; |
| 6355 } | 6081 } |
| 6356 | 6082 |
| 6357 @override | 6083 @override |
| 6358 EntityRefBuilder get type => _type; | 6084 EntityRefBuilder get type => _type; |
| 6359 | 6085 |
| 6360 /** | 6086 /** |
| 6361 * If [isFunctionTyped] is `true`, the declared return type. If | 6087 * If [isFunctionTyped] is `true`, the declared return type. If |
| 6362 * [isFunctionTyped] is `false`, the declared type. Absent if the type is | 6088 * [isFunctionTyped] is `false`, the declared type. Absent if the type is |
| 6363 * implicit. | 6089 * implicit. |
| 6364 */ | 6090 */ |
| 6365 void set type(EntityRefBuilder _value) { | 6091 void set type(EntityRefBuilder _value) { |
| 6366 assert(!_finished); | |
| 6367 _type = _value; | 6092 _type = _value; |
| 6368 } | 6093 } |
| 6369 | 6094 |
| 6370 @override | 6095 @override |
| 6371 int get visibleLength => _visibleLength ??= 0; | 6096 int get visibleLength => _visibleLength ??= 0; |
| 6372 | 6097 |
| 6373 /** | 6098 /** |
| 6374 * The length of the visible range. | 6099 * The length of the visible range. |
| 6375 */ | 6100 */ |
| 6376 void set visibleLength(int _value) { | 6101 void set visibleLength(int _value) { |
| 6377 assert(!_finished); | |
| 6378 assert(_value == null || _value >= 0); | 6102 assert(_value == null || _value >= 0); |
| 6379 _visibleLength = _value; | 6103 _visibleLength = _value; |
| 6380 } | 6104 } |
| 6381 | 6105 |
| 6382 @override | 6106 @override |
| 6383 int get visibleOffset => _visibleOffset ??= 0; | 6107 int get visibleOffset => _visibleOffset ??= 0; |
| 6384 | 6108 |
| 6385 /** | 6109 /** |
| 6386 * The beginning of the visible range. | 6110 * The beginning of the visible range. |
| 6387 */ | 6111 */ |
| 6388 void set visibleOffset(int _value) { | 6112 void set visibleOffset(int _value) { |
| 6389 assert(!_finished); | |
| 6390 assert(_value == null || _value >= 0); | 6113 assert(_value == null || _value >= 0); |
| 6391 _visibleOffset = _value; | 6114 _visibleOffset = _value; |
| 6392 } | 6115 } |
| 6393 | 6116 |
| 6394 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}) | 6117 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}) |
| 6395 : _annotations = annotations, | 6118 : _annotations = annotations, |
| 6396 _codeRange = codeRange, | 6119 _codeRange = codeRange, |
| 6397 _defaultValueCode = defaultValueCode, | 6120 _defaultValueCode = defaultValueCode, |
| 6398 _inferredTypeSlot = inferredTypeSlot, | 6121 _inferredTypeSlot = inferredTypeSlot, |
| 6399 _initializer = initializer, | 6122 _initializer = initializer, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 6414 _annotations?.forEach((b) => b.flushInformative()); | 6137 _annotations?.forEach((b) => b.flushInformative()); |
| 6415 _codeRange = null; | 6138 _codeRange = null; |
| 6416 _defaultValueCode = null; | 6139 _defaultValueCode = null; |
| 6417 _initializer?.flushInformative(); | 6140 _initializer?.flushInformative(); |
| 6418 _nameOffset = null; | 6141 _nameOffset = null; |
| 6419 _parameters?.forEach((b) => b.flushInformative()); | 6142 _parameters?.forEach((b) => b.flushInformative()); |
| 6420 _type?.flushInformative(); | 6143 _type?.flushInformative(); |
| 6421 } | 6144 } |
| 6422 | 6145 |
| 6423 fb.Offset finish(fb.Builder fbBuilder) { | 6146 fb.Offset finish(fb.Builder fbBuilder) { |
| 6424 assert(!_finished); | |
| 6425 _finished = true; | |
| 6426 fb.Offset offset_annotations; | 6147 fb.Offset offset_annotations; |
| 6427 fb.Offset offset_codeRange; | 6148 fb.Offset offset_codeRange; |
| 6428 fb.Offset offset_defaultValueCode; | 6149 fb.Offset offset_defaultValueCode; |
| 6429 fb.Offset offset_initializer; | 6150 fb.Offset offset_initializer; |
| 6430 fb.Offset offset_name; | 6151 fb.Offset offset_name; |
| 6431 fb.Offset offset_parameters; | 6152 fb.Offset offset_parameters; |
| 6432 fb.Offset offset_type; | 6153 fb.Offset offset_type; |
| 6433 if (!(_annotations == null || _annotations.isEmpty)) { | 6154 if (!(_annotations == null || _annotations.isEmpty)) { |
| 6434 offset_annotations = fbBuilder.writeList(_annotations.map((b) => b.finish(
fbBuilder)).toList()); | 6155 offset_annotations = fbBuilder.writeList(_annotations.map((b) => b.finish(
fbBuilder)).toList()); |
| 6435 } | 6156 } |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6648 "type": type, | 6369 "type": type, |
| 6649 "visibleLength": visibleLength, | 6370 "visibleLength": visibleLength, |
| 6650 "visibleOffset": visibleOffset, | 6371 "visibleOffset": visibleOffset, |
| 6651 }; | 6372 }; |
| 6652 | 6373 |
| 6653 @override | 6374 @override |
| 6654 String toString() => convert.JSON.encode(toJson()); | 6375 String toString() => convert.JSON.encode(toJson()); |
| 6655 } | 6376 } |
| 6656 | 6377 |
| 6657 class UnlinkedPartBuilder extends Object with _UnlinkedPartMixin implements idl.
UnlinkedPart { | 6378 class UnlinkedPartBuilder extends Object with _UnlinkedPartMixin implements idl.
UnlinkedPart { |
| 6658 bool _finished = false; | |
| 6659 | |
| 6660 List<UnlinkedConstBuilder> _annotations; | 6379 List<UnlinkedConstBuilder> _annotations; |
| 6661 int _uriEnd; | 6380 int _uriEnd; |
| 6662 int _uriOffset; | 6381 int _uriOffset; |
| 6663 | 6382 |
| 6664 @override | 6383 @override |
| 6665 List<UnlinkedConstBuilder> get annotations => _annotations ??= <UnlinkedConstB
uilder>[]; | 6384 List<UnlinkedConstBuilder> get annotations => _annotations ??= <UnlinkedConstB
uilder>[]; |
| 6666 | 6385 |
| 6667 /** | 6386 /** |
| 6668 * Annotations for this part declaration. | 6387 * Annotations for this part declaration. |
| 6669 */ | 6388 */ |
| 6670 void set annotations(List<UnlinkedConstBuilder> _value) { | 6389 void set annotations(List<UnlinkedConstBuilder> _value) { |
| 6671 assert(!_finished); | |
| 6672 _annotations = _value; | 6390 _annotations = _value; |
| 6673 } | 6391 } |
| 6674 | 6392 |
| 6675 @override | 6393 @override |
| 6676 int get uriEnd => _uriEnd ??= 0; | 6394 int get uriEnd => _uriEnd ??= 0; |
| 6677 | 6395 |
| 6678 /** | 6396 /** |
| 6679 * End of the URI string (including quotes) relative to the beginning of the | 6397 * End of the URI string (including quotes) relative to the beginning of the |
| 6680 * file. | 6398 * file. |
| 6681 */ | 6399 */ |
| 6682 void set uriEnd(int _value) { | 6400 void set uriEnd(int _value) { |
| 6683 assert(!_finished); | |
| 6684 assert(_value == null || _value >= 0); | 6401 assert(_value == null || _value >= 0); |
| 6685 _uriEnd = _value; | 6402 _uriEnd = _value; |
| 6686 } | 6403 } |
| 6687 | 6404 |
| 6688 @override | 6405 @override |
| 6689 int get uriOffset => _uriOffset ??= 0; | 6406 int get uriOffset => _uriOffset ??= 0; |
| 6690 | 6407 |
| 6691 /** | 6408 /** |
| 6692 * Offset of the URI string (including quotes) relative to the beginning of | 6409 * Offset of the URI string (including quotes) relative to the beginning of |
| 6693 * the file. | 6410 * the file. |
| 6694 */ | 6411 */ |
| 6695 void set uriOffset(int _value) { | 6412 void set uriOffset(int _value) { |
| 6696 assert(!_finished); | |
| 6697 assert(_value == null || _value >= 0); | 6413 assert(_value == null || _value >= 0); |
| 6698 _uriOffset = _value; | 6414 _uriOffset = _value; |
| 6699 } | 6415 } |
| 6700 | 6416 |
| 6701 UnlinkedPartBuilder({List<UnlinkedConstBuilder> annotations, int uriEnd, int u
riOffset}) | 6417 UnlinkedPartBuilder({List<UnlinkedConstBuilder> annotations, int uriEnd, int u
riOffset}) |
| 6702 : _annotations = annotations, | 6418 : _annotations = annotations, |
| 6703 _uriEnd = uriEnd, | 6419 _uriEnd = uriEnd, |
| 6704 _uriOffset = uriOffset; | 6420 _uriOffset = uriOffset; |
| 6705 | 6421 |
| 6706 /** | 6422 /** |
| 6707 * Flush [informative] data recursively. | 6423 * Flush [informative] data recursively. |
| 6708 */ | 6424 */ |
| 6709 void flushInformative() { | 6425 void flushInformative() { |
| 6710 _annotations?.forEach((b) => b.flushInformative()); | 6426 _annotations?.forEach((b) => b.flushInformative()); |
| 6711 _uriEnd = null; | 6427 _uriEnd = null; |
| 6712 _uriOffset = null; | 6428 _uriOffset = null; |
| 6713 } | 6429 } |
| 6714 | 6430 |
| 6715 fb.Offset finish(fb.Builder fbBuilder) { | 6431 fb.Offset finish(fb.Builder fbBuilder) { |
| 6716 assert(!_finished); | |
| 6717 _finished = true; | |
| 6718 fb.Offset offset_annotations; | 6432 fb.Offset offset_annotations; |
| 6719 if (!(_annotations == null || _annotations.isEmpty)) { | 6433 if (!(_annotations == null || _annotations.isEmpty)) { |
| 6720 offset_annotations = fbBuilder.writeList(_annotations.map((b) => b.finish(
fbBuilder)).toList()); | 6434 offset_annotations = fbBuilder.writeList(_annotations.map((b) => b.finish(
fbBuilder)).toList()); |
| 6721 } | 6435 } |
| 6722 fbBuilder.startTable(); | 6436 fbBuilder.startTable(); |
| 6723 if (offset_annotations != null) { | 6437 if (offset_annotations != null) { |
| 6724 fbBuilder.addOffset(2, offset_annotations); | 6438 fbBuilder.addOffset(2, offset_annotations); |
| 6725 } | 6439 } |
| 6726 if (_uriEnd != null && _uriEnd != 0) { | 6440 if (_uriEnd != null && _uriEnd != 0) { |
| 6727 fbBuilder.addUint32(0, _uriEnd); | 6441 fbBuilder.addUint32(0, _uriEnd); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6784 "annotations": annotations, | 6498 "annotations": annotations, |
| 6785 "uriEnd": uriEnd, | 6499 "uriEnd": uriEnd, |
| 6786 "uriOffset": uriOffset, | 6500 "uriOffset": uriOffset, |
| 6787 }; | 6501 }; |
| 6788 | 6502 |
| 6789 @override | 6503 @override |
| 6790 String toString() => convert.JSON.encode(toJson()); | 6504 String toString() => convert.JSON.encode(toJson()); |
| 6791 } | 6505 } |
| 6792 | 6506 |
| 6793 class UnlinkedPublicNameBuilder extends Object with _UnlinkedPublicNameMixin imp
lements idl.UnlinkedPublicName { | 6507 class UnlinkedPublicNameBuilder extends Object with _UnlinkedPublicNameMixin imp
lements idl.UnlinkedPublicName { |
| 6794 bool _finished = false; | |
| 6795 | |
| 6796 idl.ReferenceKind _kind; | 6508 idl.ReferenceKind _kind; |
| 6797 List<UnlinkedPublicNameBuilder> _members; | 6509 List<UnlinkedPublicNameBuilder> _members; |
| 6798 String _name; | 6510 String _name; |
| 6799 int _numTypeParameters; | 6511 int _numTypeParameters; |
| 6800 | 6512 |
| 6801 @override | 6513 @override |
| 6802 idl.ReferenceKind get kind => _kind ??= idl.ReferenceKind.classOrEnum; | 6514 idl.ReferenceKind get kind => _kind ??= idl.ReferenceKind.classOrEnum; |
| 6803 | 6515 |
| 6804 /** | 6516 /** |
| 6805 * The kind of object referred to by the name. | 6517 * The kind of object referred to by the name. |
| 6806 */ | 6518 */ |
| 6807 void set kind(idl.ReferenceKind _value) { | 6519 void set kind(idl.ReferenceKind _value) { |
| 6808 assert(!_finished); | |
| 6809 _kind = _value; | 6520 _kind = _value; |
| 6810 } | 6521 } |
| 6811 | 6522 |
| 6812 @override | 6523 @override |
| 6813 List<UnlinkedPublicNameBuilder> get members => _members ??= <UnlinkedPublicNam
eBuilder>[]; | 6524 List<UnlinkedPublicNameBuilder> get members => _members ??= <UnlinkedPublicNam
eBuilder>[]; |
| 6814 | 6525 |
| 6815 /** | 6526 /** |
| 6816 * If this [UnlinkedPublicName] is a class, the list of members which can be | 6527 * If this [UnlinkedPublicName] is a class, the list of members which can be |
| 6817 * referenced statically - static fields, static methods, and constructors. | 6528 * referenced statically - static fields, static methods, and constructors. |
| 6818 * Otherwise empty. | 6529 * Otherwise empty. |
| 6819 * | 6530 * |
| 6820 * Unnamed constructors are not included since they do not constitute a | 6531 * Unnamed constructors are not included since they do not constitute a |
| 6821 * separate name added to any namespace. | 6532 * separate name added to any namespace. |
| 6822 */ | 6533 */ |
| 6823 void set members(List<UnlinkedPublicNameBuilder> _value) { | 6534 void set members(List<UnlinkedPublicNameBuilder> _value) { |
| 6824 assert(!_finished); | |
| 6825 _members = _value; | 6535 _members = _value; |
| 6826 } | 6536 } |
| 6827 | 6537 |
| 6828 @override | 6538 @override |
| 6829 String get name => _name ??= ''; | 6539 String get name => _name ??= ''; |
| 6830 | 6540 |
| 6831 /** | 6541 /** |
| 6832 * The name itself. | 6542 * The name itself. |
| 6833 */ | 6543 */ |
| 6834 void set name(String _value) { | 6544 void set name(String _value) { |
| 6835 assert(!_finished); | |
| 6836 _name = _value; | 6545 _name = _value; |
| 6837 } | 6546 } |
| 6838 | 6547 |
| 6839 @override | 6548 @override |
| 6840 int get numTypeParameters => _numTypeParameters ??= 0; | 6549 int get numTypeParameters => _numTypeParameters ??= 0; |
| 6841 | 6550 |
| 6842 /** | 6551 /** |
| 6843 * If the entity being referred to is generic, the number of type parameters | 6552 * If the entity being referred to is generic, the number of type parameters |
| 6844 * it accepts. Otherwise zero. | 6553 * it accepts. Otherwise zero. |
| 6845 */ | 6554 */ |
| 6846 void set numTypeParameters(int _value) { | 6555 void set numTypeParameters(int _value) { |
| 6847 assert(!_finished); | |
| 6848 assert(_value == null || _value >= 0); | 6556 assert(_value == null || _value >= 0); |
| 6849 _numTypeParameters = _value; | 6557 _numTypeParameters = _value; |
| 6850 } | 6558 } |
| 6851 | 6559 |
| 6852 UnlinkedPublicNameBuilder({idl.ReferenceKind kind, List<UnlinkedPublicNameBuil
der> members, String name, int numTypeParameters}) | 6560 UnlinkedPublicNameBuilder({idl.ReferenceKind kind, List<UnlinkedPublicNameBuil
der> members, String name, int numTypeParameters}) |
| 6853 : _kind = kind, | 6561 : _kind = kind, |
| 6854 _members = members, | 6562 _members = members, |
| 6855 _name = name, | 6563 _name = name, |
| 6856 _numTypeParameters = numTypeParameters; | 6564 _numTypeParameters = numTypeParameters; |
| 6857 | 6565 |
| 6858 /** | 6566 /** |
| 6859 * Flush [informative] data recursively. | 6567 * Flush [informative] data recursively. |
| 6860 */ | 6568 */ |
| 6861 void flushInformative() { | 6569 void flushInformative() { |
| 6862 _members?.forEach((b) => b.flushInformative()); | 6570 _members?.forEach((b) => b.flushInformative()); |
| 6863 } | 6571 } |
| 6864 | 6572 |
| 6865 fb.Offset finish(fb.Builder fbBuilder) { | 6573 fb.Offset finish(fb.Builder fbBuilder) { |
| 6866 assert(!_finished); | |
| 6867 _finished = true; | |
| 6868 fb.Offset offset_members; | 6574 fb.Offset offset_members; |
| 6869 fb.Offset offset_name; | 6575 fb.Offset offset_name; |
| 6870 if (!(_members == null || _members.isEmpty)) { | 6576 if (!(_members == null || _members.isEmpty)) { |
| 6871 offset_members = fbBuilder.writeList(_members.map((b) => b.finish(fbBuilde
r)).toList()); | 6577 offset_members = fbBuilder.writeList(_members.map((b) => b.finish(fbBuilde
r)).toList()); |
| 6872 } | 6578 } |
| 6873 if (_name != null) { | 6579 if (_name != null) { |
| 6874 offset_name = fbBuilder.writeString(_name); | 6580 offset_name = fbBuilder.writeString(_name); |
| 6875 } | 6581 } |
| 6876 fbBuilder.startTable(); | 6582 fbBuilder.startTable(); |
| 6877 if (_kind != null && _kind != idl.ReferenceKind.classOrEnum) { | 6583 if (_kind != null && _kind != idl.ReferenceKind.classOrEnum) { |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6950 "members": members, | 6656 "members": members, |
| 6951 "name": name, | 6657 "name": name, |
| 6952 "numTypeParameters": numTypeParameters, | 6658 "numTypeParameters": numTypeParameters, |
| 6953 }; | 6659 }; |
| 6954 | 6660 |
| 6955 @override | 6661 @override |
| 6956 String toString() => convert.JSON.encode(toJson()); | 6662 String toString() => convert.JSON.encode(toJson()); |
| 6957 } | 6663 } |
| 6958 | 6664 |
| 6959 class UnlinkedPublicNamespaceBuilder extends Object with _UnlinkedPublicNamespac
eMixin implements idl.UnlinkedPublicNamespace { | 6665 class UnlinkedPublicNamespaceBuilder extends Object with _UnlinkedPublicNamespac
eMixin implements idl.UnlinkedPublicNamespace { |
| 6960 bool _finished = false; | |
| 6961 | |
| 6962 List<UnlinkedExportPublicBuilder> _exports; | 6666 List<UnlinkedExportPublicBuilder> _exports; |
| 6963 List<UnlinkedPublicNameBuilder> _names; | 6667 List<UnlinkedPublicNameBuilder> _names; |
| 6964 List<String> _parts; | 6668 List<String> _parts; |
| 6965 | 6669 |
| 6966 @override | 6670 @override |
| 6967 List<UnlinkedExportPublicBuilder> get exports => _exports ??= <UnlinkedExportP
ublicBuilder>[]; | 6671 List<UnlinkedExportPublicBuilder> get exports => _exports ??= <UnlinkedExportP
ublicBuilder>[]; |
| 6968 | 6672 |
| 6969 /** | 6673 /** |
| 6970 * Export declarations in the compilation unit. | 6674 * Export declarations in the compilation unit. |
| 6971 */ | 6675 */ |
| 6972 void set exports(List<UnlinkedExportPublicBuilder> _value) { | 6676 void set exports(List<UnlinkedExportPublicBuilder> _value) { |
| 6973 assert(!_finished); | |
| 6974 _exports = _value; | 6677 _exports = _value; |
| 6975 } | 6678 } |
| 6976 | 6679 |
| 6977 @override | 6680 @override |
| 6978 List<UnlinkedPublicNameBuilder> get names => _names ??= <UnlinkedPublicNameBui
lder>[]; | 6681 List<UnlinkedPublicNameBuilder> get names => _names ??= <UnlinkedPublicNameBui
lder>[]; |
| 6979 | 6682 |
| 6980 /** | 6683 /** |
| 6981 * Public names defined in the compilation unit. | 6684 * Public names defined in the compilation unit. |
| 6982 * | 6685 * |
| 6983 * TODO(paulberry): consider sorting these names to reduce unnecessary | 6686 * TODO(paulberry): consider sorting these names to reduce unnecessary |
| 6984 * relinking. | 6687 * relinking. |
| 6985 */ | 6688 */ |
| 6986 void set names(List<UnlinkedPublicNameBuilder> _value) { | 6689 void set names(List<UnlinkedPublicNameBuilder> _value) { |
| 6987 assert(!_finished); | |
| 6988 _names = _value; | 6690 _names = _value; |
| 6989 } | 6691 } |
| 6990 | 6692 |
| 6991 @override | 6693 @override |
| 6992 List<String> get parts => _parts ??= <String>[]; | 6694 List<String> get parts => _parts ??= <String>[]; |
| 6993 | 6695 |
| 6994 /** | 6696 /** |
| 6995 * URIs referenced by part declarations in the compilation unit. | 6697 * URIs referenced by part declarations in the compilation unit. |
| 6996 */ | 6698 */ |
| 6997 void set parts(List<String> _value) { | 6699 void set parts(List<String> _value) { |
| 6998 assert(!_finished); | |
| 6999 _parts = _value; | 6700 _parts = _value; |
| 7000 } | 6701 } |
| 7001 | 6702 |
| 7002 UnlinkedPublicNamespaceBuilder({List<UnlinkedExportPublicBuilder> exports, Lis
t<UnlinkedPublicNameBuilder> names, List<String> parts}) | 6703 UnlinkedPublicNamespaceBuilder({List<UnlinkedExportPublicBuilder> exports, Lis
t<UnlinkedPublicNameBuilder> names, List<String> parts}) |
| 7003 : _exports = exports, | 6704 : _exports = exports, |
| 7004 _names = names, | 6705 _names = names, |
| 7005 _parts = parts; | 6706 _parts = parts; |
| 7006 | 6707 |
| 7007 /** | 6708 /** |
| 7008 * Flush [informative] data recursively. | 6709 * Flush [informative] data recursively. |
| 7009 */ | 6710 */ |
| 7010 void flushInformative() { | 6711 void flushInformative() { |
| 7011 _exports?.forEach((b) => b.flushInformative()); | 6712 _exports?.forEach((b) => b.flushInformative()); |
| 7012 _names?.forEach((b) => b.flushInformative()); | 6713 _names?.forEach((b) => b.flushInformative()); |
| 7013 } | 6714 } |
| 7014 | 6715 |
| 7015 List<int> toBuffer() { | 6716 List<int> toBuffer() { |
| 7016 fb.Builder fbBuilder = new fb.Builder(); | 6717 fb.Builder fbBuilder = new fb.Builder(); |
| 7017 return fbBuilder.finish(finish(fbBuilder), "UPNS"); | 6718 return fbBuilder.finish(finish(fbBuilder), "UPNS"); |
| 7018 } | 6719 } |
| 7019 | 6720 |
| 7020 fb.Offset finish(fb.Builder fbBuilder) { | 6721 fb.Offset finish(fb.Builder fbBuilder) { |
| 7021 assert(!_finished); | |
| 7022 _finished = true; | |
| 7023 fb.Offset offset_exports; | 6722 fb.Offset offset_exports; |
| 7024 fb.Offset offset_names; | 6723 fb.Offset offset_names; |
| 7025 fb.Offset offset_parts; | 6724 fb.Offset offset_parts; |
| 7026 if (!(_exports == null || _exports.isEmpty)) { | 6725 if (!(_exports == null || _exports.isEmpty)) { |
| 7027 offset_exports = fbBuilder.writeList(_exports.map((b) => b.finish(fbBuilde
r)).toList()); | 6726 offset_exports = fbBuilder.writeList(_exports.map((b) => b.finish(fbBuilde
r)).toList()); |
| 7028 } | 6727 } |
| 7029 if (!(_names == null || _names.isEmpty)) { | 6728 if (!(_names == null || _names.isEmpty)) { |
| 7030 offset_names = fbBuilder.writeList(_names.map((b) => b.finish(fbBuilder)).
toList()); | 6729 offset_names = fbBuilder.writeList(_names.map((b) => b.finish(fbBuilder)).
toList()); |
| 7031 } | 6730 } |
| 7032 if (!(_parts == null || _parts.isEmpty)) { | 6731 if (!(_parts == null || _parts.isEmpty)) { |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7102 "exports": exports, | 6801 "exports": exports, |
| 7103 "names": names, | 6802 "names": names, |
| 7104 "parts": parts, | 6803 "parts": parts, |
| 7105 }; | 6804 }; |
| 7106 | 6805 |
| 7107 @override | 6806 @override |
| 7108 String toString() => convert.JSON.encode(toJson()); | 6807 String toString() => convert.JSON.encode(toJson()); |
| 7109 } | 6808 } |
| 7110 | 6809 |
| 7111 class UnlinkedReferenceBuilder extends Object with _UnlinkedReferenceMixin imple
ments idl.UnlinkedReference { | 6810 class UnlinkedReferenceBuilder extends Object with _UnlinkedReferenceMixin imple
ments idl.UnlinkedReference { |
| 7112 bool _finished = false; | |
| 7113 | |
| 7114 String _name; | 6811 String _name; |
| 7115 int _prefixReference; | 6812 int _prefixReference; |
| 7116 | 6813 |
| 7117 @override | 6814 @override |
| 7118 String get name => _name ??= ''; | 6815 String get name => _name ??= ''; |
| 7119 | 6816 |
| 7120 /** | 6817 /** |
| 7121 * Name of the entity being referred to. For the pseudo-type `dynamic`, the | 6818 * Name of the entity being referred to. For the pseudo-type `dynamic`, the |
| 7122 * string is "dynamic". For the pseudo-type `void`, the string is "void". | 6819 * string is "dynamic". For the pseudo-type `void`, the string is "void". |
| 7123 * For the pseudo-type `bottom`, the string is "*bottom*". | 6820 * For the pseudo-type `bottom`, the string is "*bottom*". |
| 7124 */ | 6821 */ |
| 7125 void set name(String _value) { | 6822 void set name(String _value) { |
| 7126 assert(!_finished); | |
| 7127 _name = _value; | 6823 _name = _value; |
| 7128 } | 6824 } |
| 7129 | 6825 |
| 7130 @override | 6826 @override |
| 7131 int get prefixReference => _prefixReference ??= 0; | 6827 int get prefixReference => _prefixReference ??= 0; |
| 7132 | 6828 |
| 7133 /** | 6829 /** |
| 7134 * Prefix used to refer to the entity, or zero if no prefix is used. This is | 6830 * Prefix used to refer to the entity, or zero if no prefix is used. This is |
| 7135 * an index into [UnlinkedUnit.references]. | 6831 * an index into [UnlinkedUnit.references]. |
| 7136 * | 6832 * |
| 7137 * Prefix references must always point backward; that is, for all i, if | 6833 * Prefix references must always point backward; that is, for all i, if |
| 7138 * UnlinkedUnit.references[i].prefixReference != 0, then | 6834 * UnlinkedUnit.references[i].prefixReference != 0, then |
| 7139 * UnlinkedUnit.references[i].prefixReference < i. | 6835 * UnlinkedUnit.references[i].prefixReference < i. |
| 7140 */ | 6836 */ |
| 7141 void set prefixReference(int _value) { | 6837 void set prefixReference(int _value) { |
| 7142 assert(!_finished); | |
| 7143 assert(_value == null || _value >= 0); | 6838 assert(_value == null || _value >= 0); |
| 7144 _prefixReference = _value; | 6839 _prefixReference = _value; |
| 7145 } | 6840 } |
| 7146 | 6841 |
| 7147 UnlinkedReferenceBuilder({String name, int prefixReference}) | 6842 UnlinkedReferenceBuilder({String name, int prefixReference}) |
| 7148 : _name = name, | 6843 : _name = name, |
| 7149 _prefixReference = prefixReference; | 6844 _prefixReference = prefixReference; |
| 7150 | 6845 |
| 7151 /** | 6846 /** |
| 7152 * Flush [informative] data recursively. | 6847 * Flush [informative] data recursively. |
| 7153 */ | 6848 */ |
| 7154 void flushInformative() { | 6849 void flushInformative() { |
| 7155 } | 6850 } |
| 7156 | 6851 |
| 7157 fb.Offset finish(fb.Builder fbBuilder) { | 6852 fb.Offset finish(fb.Builder fbBuilder) { |
| 7158 assert(!_finished); | |
| 7159 _finished = true; | |
| 7160 fb.Offset offset_name; | 6853 fb.Offset offset_name; |
| 7161 if (_name != null) { | 6854 if (_name != null) { |
| 7162 offset_name = fbBuilder.writeString(_name); | 6855 offset_name = fbBuilder.writeString(_name); |
| 7163 } | 6856 } |
| 7164 fbBuilder.startTable(); | 6857 fbBuilder.startTable(); |
| 7165 if (offset_name != null) { | 6858 if (offset_name != null) { |
| 7166 fbBuilder.addOffset(0, offset_name); | 6859 fbBuilder.addOffset(0, offset_name); |
| 7167 } | 6860 } |
| 7168 if (_prefixReference != null && _prefixReference != 0) { | 6861 if (_prefixReference != null && _prefixReference != 0) { |
| 7169 fbBuilder.addUint32(1, _prefixReference); | 6862 fbBuilder.addUint32(1, _prefixReference); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7214 Map<String, Object> toMap() => { | 6907 Map<String, Object> toMap() => { |
| 7215 "name": name, | 6908 "name": name, |
| 7216 "prefixReference": prefixReference, | 6909 "prefixReference": prefixReference, |
| 7217 }; | 6910 }; |
| 7218 | 6911 |
| 7219 @override | 6912 @override |
| 7220 String toString() => convert.JSON.encode(toJson()); | 6913 String toString() => convert.JSON.encode(toJson()); |
| 7221 } | 6914 } |
| 7222 | 6915 |
| 7223 class UnlinkedTypedefBuilder extends Object with _UnlinkedTypedefMixin implement
s idl.UnlinkedTypedef { | 6916 class UnlinkedTypedefBuilder extends Object with _UnlinkedTypedefMixin implement
s idl.UnlinkedTypedef { |
| 7224 bool _finished = false; | |
| 7225 | |
| 7226 List<UnlinkedConstBuilder> _annotations; | 6917 List<UnlinkedConstBuilder> _annotations; |
| 7227 CodeRangeBuilder _codeRange; | 6918 CodeRangeBuilder _codeRange; |
| 7228 UnlinkedDocumentationCommentBuilder _documentationComment; | 6919 UnlinkedDocumentationCommentBuilder _documentationComment; |
| 7229 String _name; | 6920 String _name; |
| 7230 int _nameOffset; | 6921 int _nameOffset; |
| 7231 List<UnlinkedParamBuilder> _parameters; | 6922 List<UnlinkedParamBuilder> _parameters; |
| 7232 EntityRefBuilder _returnType; | 6923 EntityRefBuilder _returnType; |
| 7233 List<UnlinkedTypeParamBuilder> _typeParameters; | 6924 List<UnlinkedTypeParamBuilder> _typeParameters; |
| 7234 | 6925 |
| 7235 @override | 6926 @override |
| 7236 List<UnlinkedConstBuilder> get annotations => _annotations ??= <UnlinkedConstB
uilder>[]; | 6927 List<UnlinkedConstBuilder> get annotations => _annotations ??= <UnlinkedConstB
uilder>[]; |
| 7237 | 6928 |
| 7238 /** | 6929 /** |
| 7239 * Annotations for this typedef. | 6930 * Annotations for this typedef. |
| 7240 */ | 6931 */ |
| 7241 void set annotations(List<UnlinkedConstBuilder> _value) { | 6932 void set annotations(List<UnlinkedConstBuilder> _value) { |
| 7242 assert(!_finished); | |
| 7243 _annotations = _value; | 6933 _annotations = _value; |
| 7244 } | 6934 } |
| 7245 | 6935 |
| 7246 @override | 6936 @override |
| 7247 CodeRangeBuilder get codeRange => _codeRange; | 6937 CodeRangeBuilder get codeRange => _codeRange; |
| 7248 | 6938 |
| 7249 /** | 6939 /** |
| 7250 * Code range of the typedef. | 6940 * Code range of the typedef. |
| 7251 */ | 6941 */ |
| 7252 void set codeRange(CodeRangeBuilder _value) { | 6942 void set codeRange(CodeRangeBuilder _value) { |
| 7253 assert(!_finished); | |
| 7254 _codeRange = _value; | 6943 _codeRange = _value; |
| 7255 } | 6944 } |
| 7256 | 6945 |
| 7257 @override | 6946 @override |
| 7258 UnlinkedDocumentationCommentBuilder get documentationComment => _documentation
Comment; | 6947 UnlinkedDocumentationCommentBuilder get documentationComment => _documentation
Comment; |
| 7259 | 6948 |
| 7260 /** | 6949 /** |
| 7261 * Documentation comment for the typedef, or `null` if there is no | 6950 * Documentation comment for the typedef, or `null` if there is no |
| 7262 * documentation comment. | 6951 * documentation comment. |
| 7263 */ | 6952 */ |
| 7264 void set documentationComment(UnlinkedDocumentationCommentBuilder _value) { | 6953 void set documentationComment(UnlinkedDocumentationCommentBuilder _value) { |
| 7265 assert(!_finished); | |
| 7266 _documentationComment = _value; | 6954 _documentationComment = _value; |
| 7267 } | 6955 } |
| 7268 | 6956 |
| 7269 @override | 6957 @override |
| 7270 String get name => _name ??= ''; | 6958 String get name => _name ??= ''; |
| 7271 | 6959 |
| 7272 /** | 6960 /** |
| 7273 * Name of the typedef. | 6961 * Name of the typedef. |
| 7274 */ | 6962 */ |
| 7275 void set name(String _value) { | 6963 void set name(String _value) { |
| 7276 assert(!_finished); | |
| 7277 _name = _value; | 6964 _name = _value; |
| 7278 } | 6965 } |
| 7279 | 6966 |
| 7280 @override | 6967 @override |
| 7281 int get nameOffset => _nameOffset ??= 0; | 6968 int get nameOffset => _nameOffset ??= 0; |
| 7282 | 6969 |
| 7283 /** | 6970 /** |
| 7284 * Offset of the typedef name relative to the beginning of the file. | 6971 * Offset of the typedef name relative to the beginning of the file. |
| 7285 */ | 6972 */ |
| 7286 void set nameOffset(int _value) { | 6973 void set nameOffset(int _value) { |
| 7287 assert(!_finished); | |
| 7288 assert(_value == null || _value >= 0); | 6974 assert(_value == null || _value >= 0); |
| 7289 _nameOffset = _value; | 6975 _nameOffset = _value; |
| 7290 } | 6976 } |
| 7291 | 6977 |
| 7292 @override | 6978 @override |
| 7293 List<UnlinkedParamBuilder> get parameters => _parameters ??= <UnlinkedParamBui
lder>[]; | 6979 List<UnlinkedParamBuilder> get parameters => _parameters ??= <UnlinkedParamBui
lder>[]; |
| 7294 | 6980 |
| 7295 /** | 6981 /** |
| 7296 * Parameters of the executable, if any. | 6982 * Parameters of the executable, if any. |
| 7297 */ | 6983 */ |
| 7298 void set parameters(List<UnlinkedParamBuilder> _value) { | 6984 void set parameters(List<UnlinkedParamBuilder> _value) { |
| 7299 assert(!_finished); | |
| 7300 _parameters = _value; | 6985 _parameters = _value; |
| 7301 } | 6986 } |
| 7302 | 6987 |
| 7303 @override | 6988 @override |
| 7304 EntityRefBuilder get returnType => _returnType; | 6989 EntityRefBuilder get returnType => _returnType; |
| 7305 | 6990 |
| 7306 /** | 6991 /** |
| 7307 * Return type of the typedef. | 6992 * Return type of the typedef. |
| 7308 */ | 6993 */ |
| 7309 void set returnType(EntityRefBuilder _value) { | 6994 void set returnType(EntityRefBuilder _value) { |
| 7310 assert(!_finished); | |
| 7311 _returnType = _value; | 6995 _returnType = _value; |
| 7312 } | 6996 } |
| 7313 | 6997 |
| 7314 @override | 6998 @override |
| 7315 List<UnlinkedTypeParamBuilder> get typeParameters => _typeParameters ??= <Unli
nkedTypeParamBuilder>[]; | 6999 List<UnlinkedTypeParamBuilder> get typeParameters => _typeParameters ??= <Unli
nkedTypeParamBuilder>[]; |
| 7316 | 7000 |
| 7317 /** | 7001 /** |
| 7318 * Type parameters of the typedef, if any. | 7002 * Type parameters of the typedef, if any. |
| 7319 */ | 7003 */ |
| 7320 void set typeParameters(List<UnlinkedTypeParamBuilder> _value) { | 7004 void set typeParameters(List<UnlinkedTypeParamBuilder> _value) { |
| 7321 assert(!_finished); | |
| 7322 _typeParameters = _value; | 7005 _typeParameters = _value; |
| 7323 } | 7006 } |
| 7324 | 7007 |
| 7325 UnlinkedTypedefBuilder({List<UnlinkedConstBuilder> annotations, CodeRangeBuild
er codeRange, UnlinkedDocumentationCommentBuilder documentationComment, String n
ame, int nameOffset, List<UnlinkedParamBuilder> parameters, EntityRefBuilder ret
urnType, List<UnlinkedTypeParamBuilder> typeParameters}) | 7008 UnlinkedTypedefBuilder({List<UnlinkedConstBuilder> annotations, CodeRangeBuild
er codeRange, UnlinkedDocumentationCommentBuilder documentationComment, String n
ame, int nameOffset, List<UnlinkedParamBuilder> parameters, EntityRefBuilder ret
urnType, List<UnlinkedTypeParamBuilder> typeParameters}) |
| 7326 : _annotations = annotations, | 7009 : _annotations = annotations, |
| 7327 _codeRange = codeRange, | 7010 _codeRange = codeRange, |
| 7328 _documentationComment = documentationComment, | 7011 _documentationComment = documentationComment, |
| 7329 _name = name, | 7012 _name = name, |
| 7330 _nameOffset = nameOffset, | 7013 _nameOffset = nameOffset, |
| 7331 _parameters = parameters, | 7014 _parameters = parameters, |
| 7332 _returnType = returnType, | 7015 _returnType = returnType, |
| 7333 _typeParameters = typeParameters; | 7016 _typeParameters = typeParameters; |
| 7334 | 7017 |
| 7335 /** | 7018 /** |
| 7336 * Flush [informative] data recursively. | 7019 * Flush [informative] data recursively. |
| 7337 */ | 7020 */ |
| 7338 void flushInformative() { | 7021 void flushInformative() { |
| 7339 _annotations?.forEach((b) => b.flushInformative()); | 7022 _annotations?.forEach((b) => b.flushInformative()); |
| 7340 _codeRange = null; | 7023 _codeRange = null; |
| 7341 _documentationComment = null; | 7024 _documentationComment = null; |
| 7342 _nameOffset = null; | 7025 _nameOffset = null; |
| 7343 _parameters?.forEach((b) => b.flushInformative()); | 7026 _parameters?.forEach((b) => b.flushInformative()); |
| 7344 _returnType?.flushInformative(); | 7027 _returnType?.flushInformative(); |
| 7345 _typeParameters?.forEach((b) => b.flushInformative()); | 7028 _typeParameters?.forEach((b) => b.flushInformative()); |
| 7346 } | 7029 } |
| 7347 | 7030 |
| 7348 fb.Offset finish(fb.Builder fbBuilder) { | 7031 fb.Offset finish(fb.Builder fbBuilder) { |
| 7349 assert(!_finished); | |
| 7350 _finished = true; | |
| 7351 fb.Offset offset_annotations; | 7032 fb.Offset offset_annotations; |
| 7352 fb.Offset offset_codeRange; | 7033 fb.Offset offset_codeRange; |
| 7353 fb.Offset offset_documentationComment; | 7034 fb.Offset offset_documentationComment; |
| 7354 fb.Offset offset_name; | 7035 fb.Offset offset_name; |
| 7355 fb.Offset offset_parameters; | 7036 fb.Offset offset_parameters; |
| 7356 fb.Offset offset_returnType; | 7037 fb.Offset offset_returnType; |
| 7357 fb.Offset offset_typeParameters; | 7038 fb.Offset offset_typeParameters; |
| 7358 if (!(_annotations == null || _annotations.isEmpty)) { | 7039 if (!(_annotations == null || _annotations.isEmpty)) { |
| 7359 offset_annotations = fbBuilder.writeList(_annotations.map((b) => b.finish(
fbBuilder)).toList()); | 7040 offset_annotations = fbBuilder.writeList(_annotations.map((b) => b.finish(
fbBuilder)).toList()); |
| 7360 } | 7041 } |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7501 "parameters": parameters, | 7182 "parameters": parameters, |
| 7502 "returnType": returnType, | 7183 "returnType": returnType, |
| 7503 "typeParameters": typeParameters, | 7184 "typeParameters": typeParameters, |
| 7504 }; | 7185 }; |
| 7505 | 7186 |
| 7506 @override | 7187 @override |
| 7507 String toString() => convert.JSON.encode(toJson()); | 7188 String toString() => convert.JSON.encode(toJson()); |
| 7508 } | 7189 } |
| 7509 | 7190 |
| 7510 class UnlinkedTypeParamBuilder extends Object with _UnlinkedTypeParamMixin imple
ments idl.UnlinkedTypeParam { | 7191 class UnlinkedTypeParamBuilder extends Object with _UnlinkedTypeParamMixin imple
ments idl.UnlinkedTypeParam { |
| 7511 bool _finished = false; | |
| 7512 | |
| 7513 List<UnlinkedConstBuilder> _annotations; | 7192 List<UnlinkedConstBuilder> _annotations; |
| 7514 EntityRefBuilder _bound; | 7193 EntityRefBuilder _bound; |
| 7515 CodeRangeBuilder _codeRange; | 7194 CodeRangeBuilder _codeRange; |
| 7516 String _name; | 7195 String _name; |
| 7517 int _nameOffset; | 7196 int _nameOffset; |
| 7518 | 7197 |
| 7519 @override | 7198 @override |
| 7520 List<UnlinkedConstBuilder> get annotations => _annotations ??= <UnlinkedConstB
uilder>[]; | 7199 List<UnlinkedConstBuilder> get annotations => _annotations ??= <UnlinkedConstB
uilder>[]; |
| 7521 | 7200 |
| 7522 /** | 7201 /** |
| 7523 * Annotations for this type parameter. | 7202 * Annotations for this type parameter. |
| 7524 */ | 7203 */ |
| 7525 void set annotations(List<UnlinkedConstBuilder> _value) { | 7204 void set annotations(List<UnlinkedConstBuilder> _value) { |
| 7526 assert(!_finished); | |
| 7527 _annotations = _value; | 7205 _annotations = _value; |
| 7528 } | 7206 } |
| 7529 | 7207 |
| 7530 @override | 7208 @override |
| 7531 EntityRefBuilder get bound => _bound; | 7209 EntityRefBuilder get bound => _bound; |
| 7532 | 7210 |
| 7533 /** | 7211 /** |
| 7534 * Bound of the type parameter, if a bound is explicitly declared. Otherwise | 7212 * Bound of the type parameter, if a bound is explicitly declared. Otherwise |
| 7535 * null. | 7213 * null. |
| 7536 */ | 7214 */ |
| 7537 void set bound(EntityRefBuilder _value) { | 7215 void set bound(EntityRefBuilder _value) { |
| 7538 assert(!_finished); | |
| 7539 _bound = _value; | 7216 _bound = _value; |
| 7540 } | 7217 } |
| 7541 | 7218 |
| 7542 @override | 7219 @override |
| 7543 CodeRangeBuilder get codeRange => _codeRange; | 7220 CodeRangeBuilder get codeRange => _codeRange; |
| 7544 | 7221 |
| 7545 /** | 7222 /** |
| 7546 * Code range of the type parameter. | 7223 * Code range of the type parameter. |
| 7547 */ | 7224 */ |
| 7548 void set codeRange(CodeRangeBuilder _value) { | 7225 void set codeRange(CodeRangeBuilder _value) { |
| 7549 assert(!_finished); | |
| 7550 _codeRange = _value; | 7226 _codeRange = _value; |
| 7551 } | 7227 } |
| 7552 | 7228 |
| 7553 @override | 7229 @override |
| 7554 String get name => _name ??= ''; | 7230 String get name => _name ??= ''; |
| 7555 | 7231 |
| 7556 /** | 7232 /** |
| 7557 * Name of the type parameter. | 7233 * Name of the type parameter. |
| 7558 */ | 7234 */ |
| 7559 void set name(String _value) { | 7235 void set name(String _value) { |
| 7560 assert(!_finished); | |
| 7561 _name = _value; | 7236 _name = _value; |
| 7562 } | 7237 } |
| 7563 | 7238 |
| 7564 @override | 7239 @override |
| 7565 int get nameOffset => _nameOffset ??= 0; | 7240 int get nameOffset => _nameOffset ??= 0; |
| 7566 | 7241 |
| 7567 /** | 7242 /** |
| 7568 * Offset of the type parameter name relative to the beginning of the file. | 7243 * Offset of the type parameter name relative to the beginning of the file. |
| 7569 */ | 7244 */ |
| 7570 void set nameOffset(int _value) { | 7245 void set nameOffset(int _value) { |
| 7571 assert(!_finished); | |
| 7572 assert(_value == null || _value >= 0); | 7246 assert(_value == null || _value >= 0); |
| 7573 _nameOffset = _value; | 7247 _nameOffset = _value; |
| 7574 } | 7248 } |
| 7575 | 7249 |
| 7576 UnlinkedTypeParamBuilder({List<UnlinkedConstBuilder> annotations, EntityRefBui
lder bound, CodeRangeBuilder codeRange, String name, int nameOffset}) | 7250 UnlinkedTypeParamBuilder({List<UnlinkedConstBuilder> annotations, EntityRefBui
lder bound, CodeRangeBuilder codeRange, String name, int nameOffset}) |
| 7577 : _annotations = annotations, | 7251 : _annotations = annotations, |
| 7578 _bound = bound, | 7252 _bound = bound, |
| 7579 _codeRange = codeRange, | 7253 _codeRange = codeRange, |
| 7580 _name = name, | 7254 _name = name, |
| 7581 _nameOffset = nameOffset; | 7255 _nameOffset = nameOffset; |
| 7582 | 7256 |
| 7583 /** | 7257 /** |
| 7584 * Flush [informative] data recursively. | 7258 * Flush [informative] data recursively. |
| 7585 */ | 7259 */ |
| 7586 void flushInformative() { | 7260 void flushInformative() { |
| 7587 _annotations?.forEach((b) => b.flushInformative()); | 7261 _annotations?.forEach((b) => b.flushInformative()); |
| 7588 _bound?.flushInformative(); | 7262 _bound?.flushInformative(); |
| 7589 _codeRange = null; | 7263 _codeRange = null; |
| 7590 _nameOffset = null; | 7264 _nameOffset = null; |
| 7591 } | 7265 } |
| 7592 | 7266 |
| 7593 fb.Offset finish(fb.Builder fbBuilder) { | 7267 fb.Offset finish(fb.Builder fbBuilder) { |
| 7594 assert(!_finished); | |
| 7595 _finished = true; | |
| 7596 fb.Offset offset_annotations; | 7268 fb.Offset offset_annotations; |
| 7597 fb.Offset offset_bound; | 7269 fb.Offset offset_bound; |
| 7598 fb.Offset offset_codeRange; | 7270 fb.Offset offset_codeRange; |
| 7599 fb.Offset offset_name; | 7271 fb.Offset offset_name; |
| 7600 if (!(_annotations == null || _annotations.isEmpty)) { | 7272 if (!(_annotations == null || _annotations.isEmpty)) { |
| 7601 offset_annotations = fbBuilder.writeList(_annotations.map((b) => b.finish(
fbBuilder)).toList()); | 7273 offset_annotations = fbBuilder.writeList(_annotations.map((b) => b.finish(
fbBuilder)).toList()); |
| 7602 } | 7274 } |
| 7603 if (_bound != null) { | 7275 if (_bound != null) { |
| 7604 offset_bound = _bound.finish(fbBuilder); | 7276 offset_bound = _bound.finish(fbBuilder); |
| 7605 } | 7277 } |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7698 "codeRange": codeRange, | 7370 "codeRange": codeRange, |
| 7699 "name": name, | 7371 "name": name, |
| 7700 "nameOffset": nameOffset, | 7372 "nameOffset": nameOffset, |
| 7701 }; | 7373 }; |
| 7702 | 7374 |
| 7703 @override | 7375 @override |
| 7704 String toString() => convert.JSON.encode(toJson()); | 7376 String toString() => convert.JSON.encode(toJson()); |
| 7705 } | 7377 } |
| 7706 | 7378 |
| 7707 class UnlinkedUnitBuilder extends Object with _UnlinkedUnitMixin implements idl.
UnlinkedUnit { | 7379 class UnlinkedUnitBuilder extends Object with _UnlinkedUnitMixin implements idl.
UnlinkedUnit { |
| 7708 bool _finished = false; | |
| 7709 | |
| 7710 List<UnlinkedClassBuilder> _classes; | 7380 List<UnlinkedClassBuilder> _classes; |
| 7711 CodeRangeBuilder _codeRange; | 7381 CodeRangeBuilder _codeRange; |
| 7712 List<UnlinkedEnumBuilder> _enums; | 7382 List<UnlinkedEnumBuilder> _enums; |
| 7713 List<UnlinkedExecutableBuilder> _executables; | 7383 List<UnlinkedExecutableBuilder> _executables; |
| 7714 List<UnlinkedExportNonPublicBuilder> _exports; | 7384 List<UnlinkedExportNonPublicBuilder> _exports; |
| 7715 String _fallbackModePath; | 7385 String _fallbackModePath; |
| 7716 List<UnlinkedImportBuilder> _imports; | 7386 List<UnlinkedImportBuilder> _imports; |
| 7717 List<UnlinkedConstBuilder> _libraryAnnotations; | 7387 List<UnlinkedConstBuilder> _libraryAnnotations; |
| 7718 UnlinkedDocumentationCommentBuilder _libraryDocumentationComment; | 7388 UnlinkedDocumentationCommentBuilder _libraryDocumentationComment; |
| 7719 String _libraryName; | 7389 String _libraryName; |
| 7720 int _libraryNameLength; | 7390 int _libraryNameLength; |
| 7721 int _libraryNameOffset; | 7391 int _libraryNameOffset; |
| 7722 List<UnlinkedPartBuilder> _parts; | 7392 List<UnlinkedPartBuilder> _parts; |
| 7723 UnlinkedPublicNamespaceBuilder _publicNamespace; | 7393 UnlinkedPublicNamespaceBuilder _publicNamespace; |
| 7724 List<UnlinkedReferenceBuilder> _references; | 7394 List<UnlinkedReferenceBuilder> _references; |
| 7725 List<UnlinkedTypedefBuilder> _typedefs; | 7395 List<UnlinkedTypedefBuilder> _typedefs; |
| 7726 List<UnlinkedVariableBuilder> _variables; | 7396 List<UnlinkedVariableBuilder> _variables; |
| 7727 | 7397 |
| 7728 @override | 7398 @override |
| 7729 List<UnlinkedClassBuilder> get classes => _classes ??= <UnlinkedClassBuilder>[
]; | 7399 List<UnlinkedClassBuilder> get classes => _classes ??= <UnlinkedClassBuilder>[
]; |
| 7730 | 7400 |
| 7731 /** | 7401 /** |
| 7732 * Classes declared in the compilation unit. | 7402 * Classes declared in the compilation unit. |
| 7733 */ | 7403 */ |
| 7734 void set classes(List<UnlinkedClassBuilder> _value) { | 7404 void set classes(List<UnlinkedClassBuilder> _value) { |
| 7735 assert(!_finished); | |
| 7736 _classes = _value; | 7405 _classes = _value; |
| 7737 } | 7406 } |
| 7738 | 7407 |
| 7739 @override | 7408 @override |
| 7740 CodeRangeBuilder get codeRange => _codeRange; | 7409 CodeRangeBuilder get codeRange => _codeRange; |
| 7741 | 7410 |
| 7742 /** | 7411 /** |
| 7743 * Code range of the unit. | 7412 * Code range of the unit. |
| 7744 */ | 7413 */ |
| 7745 void set codeRange(CodeRangeBuilder _value) { | 7414 void set codeRange(CodeRangeBuilder _value) { |
| 7746 assert(!_finished); | |
| 7747 _codeRange = _value; | 7415 _codeRange = _value; |
| 7748 } | 7416 } |
| 7749 | 7417 |
| 7750 @override | 7418 @override |
| 7751 List<UnlinkedEnumBuilder> get enums => _enums ??= <UnlinkedEnumBuilder>[]; | 7419 List<UnlinkedEnumBuilder> get enums => _enums ??= <UnlinkedEnumBuilder>[]; |
| 7752 | 7420 |
| 7753 /** | 7421 /** |
| 7754 * Enums declared in the compilation unit. | 7422 * Enums declared in the compilation unit. |
| 7755 */ | 7423 */ |
| 7756 void set enums(List<UnlinkedEnumBuilder> _value) { | 7424 void set enums(List<UnlinkedEnumBuilder> _value) { |
| 7757 assert(!_finished); | |
| 7758 _enums = _value; | 7425 _enums = _value; |
| 7759 } | 7426 } |
| 7760 | 7427 |
| 7761 @override | 7428 @override |
| 7762 List<UnlinkedExecutableBuilder> get executables => _executables ??= <UnlinkedE
xecutableBuilder>[]; | 7429 List<UnlinkedExecutableBuilder> get executables => _executables ??= <UnlinkedE
xecutableBuilder>[]; |
| 7763 | 7430 |
| 7764 /** | 7431 /** |
| 7765 * Top level executable objects (functions, getters, and setters) declared in | 7432 * Top level executable objects (functions, getters, and setters) declared in |
| 7766 * the compilation unit. | 7433 * the compilation unit. |
| 7767 */ | 7434 */ |
| 7768 void set executables(List<UnlinkedExecutableBuilder> _value) { | 7435 void set executables(List<UnlinkedExecutableBuilder> _value) { |
| 7769 assert(!_finished); | |
| 7770 _executables = _value; | 7436 _executables = _value; |
| 7771 } | 7437 } |
| 7772 | 7438 |
| 7773 @override | 7439 @override |
| 7774 List<UnlinkedExportNonPublicBuilder> get exports => _exports ??= <UnlinkedExpo
rtNonPublicBuilder>[]; | 7440 List<UnlinkedExportNonPublicBuilder> get exports => _exports ??= <UnlinkedExpo
rtNonPublicBuilder>[]; |
| 7775 | 7441 |
| 7776 /** | 7442 /** |
| 7777 * Export declarations in the compilation unit. | 7443 * Export declarations in the compilation unit. |
| 7778 */ | 7444 */ |
| 7779 void set exports(List<UnlinkedExportNonPublicBuilder> _value) { | 7445 void set exports(List<UnlinkedExportNonPublicBuilder> _value) { |
| 7780 assert(!_finished); | |
| 7781 _exports = _value; | 7446 _exports = _value; |
| 7782 } | 7447 } |
| 7783 | 7448 |
| 7784 @override | 7449 @override |
| 7785 String get fallbackModePath => _fallbackModePath ??= ''; | 7450 String get fallbackModePath => _fallbackModePath ??= ''; |
| 7786 | 7451 |
| 7787 /** | 7452 /** |
| 7788 * If this compilation unit was summarized in fallback mode, the path where | 7453 * If this compilation unit was summarized in fallback mode, the path where |
| 7789 * the compilation unit may be found on disk. Otherwise empty. | 7454 * the compilation unit may be found on disk. Otherwise empty. |
| 7790 * | 7455 * |
| 7791 * When this field is non-empty, all other fields in the data structure have | 7456 * When this field is non-empty, all other fields in the data structure have |
| 7792 * their default values. | 7457 * their default values. |
| 7793 */ | 7458 */ |
| 7794 void set fallbackModePath(String _value) { | 7459 void set fallbackModePath(String _value) { |
| 7795 assert(!_finished); | |
| 7796 _fallbackModePath = _value; | 7460 _fallbackModePath = _value; |
| 7797 } | 7461 } |
| 7798 | 7462 |
| 7799 @override | 7463 @override |
| 7800 List<UnlinkedImportBuilder> get imports => _imports ??= <UnlinkedImportBuilder
>[]; | 7464 List<UnlinkedImportBuilder> get imports => _imports ??= <UnlinkedImportBuilder
>[]; |
| 7801 | 7465 |
| 7802 /** | 7466 /** |
| 7803 * Import declarations in the compilation unit. | 7467 * Import declarations in the compilation unit. |
| 7804 */ | 7468 */ |
| 7805 void set imports(List<UnlinkedImportBuilder> _value) { | 7469 void set imports(List<UnlinkedImportBuilder> _value) { |
| 7806 assert(!_finished); | |
| 7807 _imports = _value; | 7470 _imports = _value; |
| 7808 } | 7471 } |
| 7809 | 7472 |
| 7810 @override | 7473 @override |
| 7811 List<UnlinkedConstBuilder> get libraryAnnotations => _libraryAnnotations ??= <
UnlinkedConstBuilder>[]; | 7474 List<UnlinkedConstBuilder> get libraryAnnotations => _libraryAnnotations ??= <
UnlinkedConstBuilder>[]; |
| 7812 | 7475 |
| 7813 /** | 7476 /** |
| 7814 * Annotations for the library declaration, or the empty list if there is no | 7477 * Annotations for the library declaration, or the empty list if there is no |
| 7815 * library declaration. | 7478 * library declaration. |
| 7816 */ | 7479 */ |
| 7817 void set libraryAnnotations(List<UnlinkedConstBuilder> _value) { | 7480 void set libraryAnnotations(List<UnlinkedConstBuilder> _value) { |
| 7818 assert(!_finished); | |
| 7819 _libraryAnnotations = _value; | 7481 _libraryAnnotations = _value; |
| 7820 } | 7482 } |
| 7821 | 7483 |
| 7822 @override | 7484 @override |
| 7823 UnlinkedDocumentationCommentBuilder get libraryDocumentationComment => _librar
yDocumentationComment; | 7485 UnlinkedDocumentationCommentBuilder get libraryDocumentationComment => _librar
yDocumentationComment; |
| 7824 | 7486 |
| 7825 /** | 7487 /** |
| 7826 * Documentation comment for the library, or `null` if there is no | 7488 * Documentation comment for the library, or `null` if there is no |
| 7827 * documentation comment. | 7489 * documentation comment. |
| 7828 */ | 7490 */ |
| 7829 void set libraryDocumentationComment(UnlinkedDocumentationCommentBuilder _valu
e) { | 7491 void set libraryDocumentationComment(UnlinkedDocumentationCommentBuilder _valu
e) { |
| 7830 assert(!_finished); | |
| 7831 _libraryDocumentationComment = _value; | 7492 _libraryDocumentationComment = _value; |
| 7832 } | 7493 } |
| 7833 | 7494 |
| 7834 @override | 7495 @override |
| 7835 String get libraryName => _libraryName ??= ''; | 7496 String get libraryName => _libraryName ??= ''; |
| 7836 | 7497 |
| 7837 /** | 7498 /** |
| 7838 * Name of the library (from a "library" declaration, if present). | 7499 * Name of the library (from a "library" declaration, if present). |
| 7839 */ | 7500 */ |
| 7840 void set libraryName(String _value) { | 7501 void set libraryName(String _value) { |
| 7841 assert(!_finished); | |
| 7842 _libraryName = _value; | 7502 _libraryName = _value; |
| 7843 } | 7503 } |
| 7844 | 7504 |
| 7845 @override | 7505 @override |
| 7846 int get libraryNameLength => _libraryNameLength ??= 0; | 7506 int get libraryNameLength => _libraryNameLength ??= 0; |
| 7847 | 7507 |
| 7848 /** | 7508 /** |
| 7849 * Length of the library name as it appears in the source code (or 0 if the | 7509 * Length of the library name as it appears in the source code (or 0 if the |
| 7850 * library has no name). | 7510 * library has no name). |
| 7851 */ | 7511 */ |
| 7852 void set libraryNameLength(int _value) { | 7512 void set libraryNameLength(int _value) { |
| 7853 assert(!_finished); | |
| 7854 assert(_value == null || _value >= 0); | 7513 assert(_value == null || _value >= 0); |
| 7855 _libraryNameLength = _value; | 7514 _libraryNameLength = _value; |
| 7856 } | 7515 } |
| 7857 | 7516 |
| 7858 @override | 7517 @override |
| 7859 int get libraryNameOffset => _libraryNameOffset ??= 0; | 7518 int get libraryNameOffset => _libraryNameOffset ??= 0; |
| 7860 | 7519 |
| 7861 /** | 7520 /** |
| 7862 * Offset of the library name relative to the beginning of the file (or 0 if | 7521 * Offset of the library name relative to the beginning of the file (or 0 if |
| 7863 * the library has no name). | 7522 * the library has no name). |
| 7864 */ | 7523 */ |
| 7865 void set libraryNameOffset(int _value) { | 7524 void set libraryNameOffset(int _value) { |
| 7866 assert(!_finished); | |
| 7867 assert(_value == null || _value >= 0); | 7525 assert(_value == null || _value >= 0); |
| 7868 _libraryNameOffset = _value; | 7526 _libraryNameOffset = _value; |
| 7869 } | 7527 } |
| 7870 | 7528 |
| 7871 @override | 7529 @override |
| 7872 List<UnlinkedPartBuilder> get parts => _parts ??= <UnlinkedPartBuilder>[]; | 7530 List<UnlinkedPartBuilder> get parts => _parts ??= <UnlinkedPartBuilder>[]; |
| 7873 | 7531 |
| 7874 /** | 7532 /** |
| 7875 * Part declarations in the compilation unit. | 7533 * Part declarations in the compilation unit. |
| 7876 */ | 7534 */ |
| 7877 void set parts(List<UnlinkedPartBuilder> _value) { | 7535 void set parts(List<UnlinkedPartBuilder> _value) { |
| 7878 assert(!_finished); | |
| 7879 _parts = _value; | 7536 _parts = _value; |
| 7880 } | 7537 } |
| 7881 | 7538 |
| 7882 @override | 7539 @override |
| 7883 UnlinkedPublicNamespaceBuilder get publicNamespace => _publicNamespace; | 7540 UnlinkedPublicNamespaceBuilder get publicNamespace => _publicNamespace; |
| 7884 | 7541 |
| 7885 /** | 7542 /** |
| 7886 * Unlinked public namespace of this compilation unit. | 7543 * Unlinked public namespace of this compilation unit. |
| 7887 */ | 7544 */ |
| 7888 void set publicNamespace(UnlinkedPublicNamespaceBuilder _value) { | 7545 void set publicNamespace(UnlinkedPublicNamespaceBuilder _value) { |
| 7889 assert(!_finished); | |
| 7890 _publicNamespace = _value; | 7546 _publicNamespace = _value; |
| 7891 } | 7547 } |
| 7892 | 7548 |
| 7893 @override | 7549 @override |
| 7894 List<UnlinkedReferenceBuilder> get references => _references ??= <UnlinkedRefe
renceBuilder>[]; | 7550 List<UnlinkedReferenceBuilder> get references => _references ??= <UnlinkedRefe
renceBuilder>[]; |
| 7895 | 7551 |
| 7896 /** | 7552 /** |
| 7897 * Top level and prefixed names referred to by this compilation unit. The | 7553 * Top level and prefixed names referred to by this compilation unit. The |
| 7898 * zeroth element of this array is always populated and is used to represent | 7554 * zeroth element of this array is always populated and is used to represent |
| 7899 * the absence of a reference in places where a reference is optional (for | 7555 * the absence of a reference in places where a reference is optional (for |
| 7900 * example [UnlinkedReference.prefixReference or | 7556 * example [UnlinkedReference.prefixReference or |
| 7901 * UnlinkedImport.prefixReference]). | 7557 * UnlinkedImport.prefixReference]). |
| 7902 */ | 7558 */ |
| 7903 void set references(List<UnlinkedReferenceBuilder> _value) { | 7559 void set references(List<UnlinkedReferenceBuilder> _value) { |
| 7904 assert(!_finished); | |
| 7905 _references = _value; | 7560 _references = _value; |
| 7906 } | 7561 } |
| 7907 | 7562 |
| 7908 @override | 7563 @override |
| 7909 List<UnlinkedTypedefBuilder> get typedefs => _typedefs ??= <UnlinkedTypedefBui
lder>[]; | 7564 List<UnlinkedTypedefBuilder> get typedefs => _typedefs ??= <UnlinkedTypedefBui
lder>[]; |
| 7910 | 7565 |
| 7911 /** | 7566 /** |
| 7912 * Typedefs declared in the compilation unit. | 7567 * Typedefs declared in the compilation unit. |
| 7913 */ | 7568 */ |
| 7914 void set typedefs(List<UnlinkedTypedefBuilder> _value) { | 7569 void set typedefs(List<UnlinkedTypedefBuilder> _value) { |
| 7915 assert(!_finished); | |
| 7916 _typedefs = _value; | 7570 _typedefs = _value; |
| 7917 } | 7571 } |
| 7918 | 7572 |
| 7919 @override | 7573 @override |
| 7920 List<UnlinkedVariableBuilder> get variables => _variables ??= <UnlinkedVariabl
eBuilder>[]; | 7574 List<UnlinkedVariableBuilder> get variables => _variables ??= <UnlinkedVariabl
eBuilder>[]; |
| 7921 | 7575 |
| 7922 /** | 7576 /** |
| 7923 * Top level variables declared in the compilation unit. | 7577 * Top level variables declared in the compilation unit. |
| 7924 */ | 7578 */ |
| 7925 void set variables(List<UnlinkedVariableBuilder> _value) { | 7579 void set variables(List<UnlinkedVariableBuilder> _value) { |
| 7926 assert(!_finished); | |
| 7927 _variables = _value; | 7580 _variables = _value; |
| 7928 } | 7581 } |
| 7929 | 7582 |
| 7930 UnlinkedUnitBuilder({List<UnlinkedClassBuilder> classes, CodeRangeBuilder code
Range, List<UnlinkedEnumBuilder> enums, List<UnlinkedExecutableBuilder> executab
les, List<UnlinkedExportNonPublicBuilder> exports, String fallbackModePath, List
<UnlinkedImportBuilder> imports, List<UnlinkedConstBuilder> libraryAnnotations,
UnlinkedDocumentationCommentBuilder libraryDocumentationComment, String libraryN
ame, int libraryNameLength, int libraryNameOffset, List<UnlinkedPartBuilder> par
ts, UnlinkedPublicNamespaceBuilder publicNamespace, List<UnlinkedReferenceBuilde
r> references, List<UnlinkedTypedefBuilder> typedefs, List<UnlinkedVariableBuild
er> variables}) | 7583 UnlinkedUnitBuilder({List<UnlinkedClassBuilder> classes, CodeRangeBuilder code
Range, List<UnlinkedEnumBuilder> enums, List<UnlinkedExecutableBuilder> executab
les, List<UnlinkedExportNonPublicBuilder> exports, String fallbackModePath, List
<UnlinkedImportBuilder> imports, List<UnlinkedConstBuilder> libraryAnnotations,
UnlinkedDocumentationCommentBuilder libraryDocumentationComment, String libraryN
ame, int libraryNameLength, int libraryNameOffset, List<UnlinkedPartBuilder> par
ts, UnlinkedPublicNamespaceBuilder publicNamespace, List<UnlinkedReferenceBuilde
r> references, List<UnlinkedTypedefBuilder> typedefs, List<UnlinkedVariableBuild
er> variables}) |
| 7931 : _classes = classes, | 7584 : _classes = classes, |
| 7932 _codeRange = codeRange, | 7585 _codeRange = codeRange, |
| 7933 _enums = enums, | 7586 _enums = enums, |
| 7934 _executables = executables, | 7587 _executables = executables, |
| 7935 _exports = exports, | 7588 _exports = exports, |
| 7936 _fallbackModePath = fallbackModePath, | 7589 _fallbackModePath = fallbackModePath, |
| (...skipping 29 matching lines...) Expand all Loading... |
| 7966 _typedefs?.forEach((b) => b.flushInformative()); | 7619 _typedefs?.forEach((b) => b.flushInformative()); |
| 7967 _variables?.forEach((b) => b.flushInformative()); | 7620 _variables?.forEach((b) => b.flushInformative()); |
| 7968 } | 7621 } |
| 7969 | 7622 |
| 7970 List<int> toBuffer() { | 7623 List<int> toBuffer() { |
| 7971 fb.Builder fbBuilder = new fb.Builder(); | 7624 fb.Builder fbBuilder = new fb.Builder(); |
| 7972 return fbBuilder.finish(finish(fbBuilder), "UUnt"); | 7625 return fbBuilder.finish(finish(fbBuilder), "UUnt"); |
| 7973 } | 7626 } |
| 7974 | 7627 |
| 7975 fb.Offset finish(fb.Builder fbBuilder) { | 7628 fb.Offset finish(fb.Builder fbBuilder) { |
| 7976 assert(!_finished); | |
| 7977 _finished = true; | |
| 7978 fb.Offset offset_classes; | 7629 fb.Offset offset_classes; |
| 7979 fb.Offset offset_codeRange; | 7630 fb.Offset offset_codeRange; |
| 7980 fb.Offset offset_enums; | 7631 fb.Offset offset_enums; |
| 7981 fb.Offset offset_executables; | 7632 fb.Offset offset_executables; |
| 7982 fb.Offset offset_exports; | 7633 fb.Offset offset_exports; |
| 7983 fb.Offset offset_fallbackModePath; | 7634 fb.Offset offset_fallbackModePath; |
| 7984 fb.Offset offset_imports; | 7635 fb.Offset offset_imports; |
| 7985 fb.Offset offset_libraryAnnotations; | 7636 fb.Offset offset_libraryAnnotations; |
| 7986 fb.Offset offset_libraryDocumentationComment; | 7637 fb.Offset offset_libraryDocumentationComment; |
| 7987 fb.Offset offset_libraryName; | 7638 fb.Offset offset_libraryName; |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8273 "references": references, | 7924 "references": references, |
| 8274 "typedefs": typedefs, | 7925 "typedefs": typedefs, |
| 8275 "variables": variables, | 7926 "variables": variables, |
| 8276 }; | 7927 }; |
| 8277 | 7928 |
| 8278 @override | 7929 @override |
| 8279 String toString() => convert.JSON.encode(toJson()); | 7930 String toString() => convert.JSON.encode(toJson()); |
| 8280 } | 7931 } |
| 8281 | 7932 |
| 8282 class UnlinkedVariableBuilder extends Object with _UnlinkedVariableMixin impleme
nts idl.UnlinkedVariable { | 7933 class UnlinkedVariableBuilder extends Object with _UnlinkedVariableMixin impleme
nts idl.UnlinkedVariable { |
| 8283 bool _finished = false; | |
| 8284 | |
| 8285 List<UnlinkedConstBuilder> _annotations; | 7934 List<UnlinkedConstBuilder> _annotations; |
| 8286 CodeRangeBuilder _codeRange; | 7935 CodeRangeBuilder _codeRange; |
| 8287 UnlinkedDocumentationCommentBuilder _documentationComment; | 7936 UnlinkedDocumentationCommentBuilder _documentationComment; |
| 8288 int _inferredTypeSlot; | 7937 int _inferredTypeSlot; |
| 8289 UnlinkedExecutableBuilder _initializer; | 7938 UnlinkedExecutableBuilder _initializer; |
| 8290 bool _isConst; | 7939 bool _isConst; |
| 8291 bool _isFinal; | 7940 bool _isFinal; |
| 8292 bool _isStatic; | 7941 bool _isStatic; |
| 8293 String _name; | 7942 String _name; |
| 8294 int _nameOffset; | 7943 int _nameOffset; |
| 8295 int _propagatedTypeSlot; | 7944 int _propagatedTypeSlot; |
| 8296 EntityRefBuilder _type; | 7945 EntityRefBuilder _type; |
| 8297 int _visibleLength; | 7946 int _visibleLength; |
| 8298 int _visibleOffset; | 7947 int _visibleOffset; |
| 8299 | 7948 |
| 8300 @override | 7949 @override |
| 8301 List<UnlinkedConstBuilder> get annotations => _annotations ??= <UnlinkedConstB
uilder>[]; | 7950 List<UnlinkedConstBuilder> get annotations => _annotations ??= <UnlinkedConstB
uilder>[]; |
| 8302 | 7951 |
| 8303 /** | 7952 /** |
| 8304 * Annotations for this variable. | 7953 * Annotations for this variable. |
| 8305 */ | 7954 */ |
| 8306 void set annotations(List<UnlinkedConstBuilder> _value) { | 7955 void set annotations(List<UnlinkedConstBuilder> _value) { |
| 8307 assert(!_finished); | |
| 8308 _annotations = _value; | 7956 _annotations = _value; |
| 8309 } | 7957 } |
| 8310 | 7958 |
| 8311 @override | 7959 @override |
| 8312 CodeRangeBuilder get codeRange => _codeRange; | 7960 CodeRangeBuilder get codeRange => _codeRange; |
| 8313 | 7961 |
| 8314 /** | 7962 /** |
| 8315 * Code range of the variable. | 7963 * Code range of the variable. |
| 8316 */ | 7964 */ |
| 8317 void set codeRange(CodeRangeBuilder _value) { | 7965 void set codeRange(CodeRangeBuilder _value) { |
| 8318 assert(!_finished); | |
| 8319 _codeRange = _value; | 7966 _codeRange = _value; |
| 8320 } | 7967 } |
| 8321 | 7968 |
| 8322 @override | 7969 @override |
| 8323 UnlinkedDocumentationCommentBuilder get documentationComment => _documentation
Comment; | 7970 UnlinkedDocumentationCommentBuilder get documentationComment => _documentation
Comment; |
| 8324 | 7971 |
| 8325 /** | 7972 /** |
| 8326 * Documentation comment for the variable, or `null` if there is no | 7973 * Documentation comment for the variable, or `null` if there is no |
| 8327 * documentation comment. | 7974 * documentation comment. |
| 8328 */ | 7975 */ |
| 8329 void set documentationComment(UnlinkedDocumentationCommentBuilder _value) { | 7976 void set documentationComment(UnlinkedDocumentationCommentBuilder _value) { |
| 8330 assert(!_finished); | |
| 8331 _documentationComment = _value; | 7977 _documentationComment = _value; |
| 8332 } | 7978 } |
| 8333 | 7979 |
| 8334 @override | 7980 @override |
| 8335 int get inferredTypeSlot => _inferredTypeSlot ??= 0; | 7981 int get inferredTypeSlot => _inferredTypeSlot ??= 0; |
| 8336 | 7982 |
| 8337 /** | 7983 /** |
| 8338 * If this variable is inferable, nonzero slot id identifying which entry in | 7984 * If this variable is inferable, nonzero slot id identifying which entry in |
| 8339 * [LinkedLibrary.types] contains the inferred type for this variable. If | 7985 * [LinkedLibrary.types] contains the inferred type for this variable. If |
| 8340 * there is no matching entry in [LinkedLibrary.types], then no type was | 7986 * there is no matching entry in [LinkedLibrary.types], then no type was |
| 8341 * inferred for this variable, so its static type is `dynamic`. | 7987 * inferred for this variable, so its static type is `dynamic`. |
| 8342 */ | 7988 */ |
| 8343 void set inferredTypeSlot(int _value) { | 7989 void set inferredTypeSlot(int _value) { |
| 8344 assert(!_finished); | |
| 8345 assert(_value == null || _value >= 0); | 7990 assert(_value == null || _value >= 0); |
| 8346 _inferredTypeSlot = _value; | 7991 _inferredTypeSlot = _value; |
| 8347 } | 7992 } |
| 8348 | 7993 |
| 8349 @override | 7994 @override |
| 8350 UnlinkedExecutableBuilder get initializer => _initializer; | 7995 UnlinkedExecutableBuilder get initializer => _initializer; |
| 8351 | 7996 |
| 8352 /** | 7997 /** |
| 8353 * The synthetic initializer function of the variable. Absent if the variable | 7998 * The synthetic initializer function of the variable. Absent if the variable |
| 8354 * does not have an initializer. | 7999 * does not have an initializer. |
| 8355 */ | 8000 */ |
| 8356 void set initializer(UnlinkedExecutableBuilder _value) { | 8001 void set initializer(UnlinkedExecutableBuilder _value) { |
| 8357 assert(!_finished); | |
| 8358 _initializer = _value; | 8002 _initializer = _value; |
| 8359 } | 8003 } |
| 8360 | 8004 |
| 8361 @override | 8005 @override |
| 8362 bool get isConst => _isConst ??= false; | 8006 bool get isConst => _isConst ??= false; |
| 8363 | 8007 |
| 8364 /** | 8008 /** |
| 8365 * Indicates whether the variable is declared using the `const` keyword. | 8009 * Indicates whether the variable is declared using the `const` keyword. |
| 8366 */ | 8010 */ |
| 8367 void set isConst(bool _value) { | 8011 void set isConst(bool _value) { |
| 8368 assert(!_finished); | |
| 8369 _isConst = _value; | 8012 _isConst = _value; |
| 8370 } | 8013 } |
| 8371 | 8014 |
| 8372 @override | 8015 @override |
| 8373 bool get isFinal => _isFinal ??= false; | 8016 bool get isFinal => _isFinal ??= false; |
| 8374 | 8017 |
| 8375 /** | 8018 /** |
| 8376 * Indicates whether the variable is declared using the `final` keyword. | 8019 * Indicates whether the variable is declared using the `final` keyword. |
| 8377 */ | 8020 */ |
| 8378 void set isFinal(bool _value) { | 8021 void set isFinal(bool _value) { |
| 8379 assert(!_finished); | |
| 8380 _isFinal = _value; | 8022 _isFinal = _value; |
| 8381 } | 8023 } |
| 8382 | 8024 |
| 8383 @override | 8025 @override |
| 8384 bool get isStatic => _isStatic ??= false; | 8026 bool get isStatic => _isStatic ??= false; |
| 8385 | 8027 |
| 8386 /** | 8028 /** |
| 8387 * Indicates whether the variable is declared using the `static` keyword. | 8029 * Indicates whether the variable is declared using the `static` keyword. |
| 8388 * | 8030 * |
| 8389 * Note that for top level variables, this flag is false, since they are not | 8031 * Note that for top level variables, this flag is false, since they are not |
| 8390 * declared using the `static` keyword (even though they are considered | 8032 * declared using the `static` keyword (even though they are considered |
| 8391 * static for semantic purposes). | 8033 * static for semantic purposes). |
| 8392 */ | 8034 */ |
| 8393 void set isStatic(bool _value) { | 8035 void set isStatic(bool _value) { |
| 8394 assert(!_finished); | |
| 8395 _isStatic = _value; | 8036 _isStatic = _value; |
| 8396 } | 8037 } |
| 8397 | 8038 |
| 8398 @override | 8039 @override |
| 8399 String get name => _name ??= ''; | 8040 String get name => _name ??= ''; |
| 8400 | 8041 |
| 8401 /** | 8042 /** |
| 8402 * Name of the variable. | 8043 * Name of the variable. |
| 8403 */ | 8044 */ |
| 8404 void set name(String _value) { | 8045 void set name(String _value) { |
| 8405 assert(!_finished); | |
| 8406 _name = _value; | 8046 _name = _value; |
| 8407 } | 8047 } |
| 8408 | 8048 |
| 8409 @override | 8049 @override |
| 8410 int get nameOffset => _nameOffset ??= 0; | 8050 int get nameOffset => _nameOffset ??= 0; |
| 8411 | 8051 |
| 8412 /** | 8052 /** |
| 8413 * Offset of the variable name relative to the beginning of the file. | 8053 * Offset of the variable name relative to the beginning of the file. |
| 8414 */ | 8054 */ |
| 8415 void set nameOffset(int _value) { | 8055 void set nameOffset(int _value) { |
| 8416 assert(!_finished); | |
| 8417 assert(_value == null || _value >= 0); | 8056 assert(_value == null || _value >= 0); |
| 8418 _nameOffset = _value; | 8057 _nameOffset = _value; |
| 8419 } | 8058 } |
| 8420 | 8059 |
| 8421 @override | 8060 @override |
| 8422 int get propagatedTypeSlot => _propagatedTypeSlot ??= 0; | 8061 int get propagatedTypeSlot => _propagatedTypeSlot ??= 0; |
| 8423 | 8062 |
| 8424 /** | 8063 /** |
| 8425 * If this variable is propagable, nonzero slot id identifying which entry in | 8064 * If this variable is propagable, nonzero slot id identifying which entry in |
| 8426 * [LinkedLibrary.types] contains the propagated type for this variable. If | 8065 * [LinkedLibrary.types] contains the propagated type for this variable. If |
| 8427 * there is no matching entry in [LinkedLibrary.types], then this variable's | 8066 * there is no matching entry in [LinkedLibrary.types], then this variable's |
| 8428 * propagated type is the same as its declared type. | 8067 * propagated type is the same as its declared type. |
| 8429 * | 8068 * |
| 8430 * Non-propagable variables have a [propagatedTypeSlot] of zero. | 8069 * Non-propagable variables have a [propagatedTypeSlot] of zero. |
| 8431 */ | 8070 */ |
| 8432 void set propagatedTypeSlot(int _value) { | 8071 void set propagatedTypeSlot(int _value) { |
| 8433 assert(!_finished); | |
| 8434 assert(_value == null || _value >= 0); | 8072 assert(_value == null || _value >= 0); |
| 8435 _propagatedTypeSlot = _value; | 8073 _propagatedTypeSlot = _value; |
| 8436 } | 8074 } |
| 8437 | 8075 |
| 8438 @override | 8076 @override |
| 8439 EntityRefBuilder get type => _type; | 8077 EntityRefBuilder get type => _type; |
| 8440 | 8078 |
| 8441 /** | 8079 /** |
| 8442 * Declared type of the variable. Absent if the type is implicit. | 8080 * Declared type of the variable. Absent if the type is implicit. |
| 8443 */ | 8081 */ |
| 8444 void set type(EntityRefBuilder _value) { | 8082 void set type(EntityRefBuilder _value) { |
| 8445 assert(!_finished); | |
| 8446 _type = _value; | 8083 _type = _value; |
| 8447 } | 8084 } |
| 8448 | 8085 |
| 8449 @override | 8086 @override |
| 8450 int get visibleLength => _visibleLength ??= 0; | 8087 int get visibleLength => _visibleLength ??= 0; |
| 8451 | 8088 |
| 8452 /** | 8089 /** |
| 8453 * If a local variable, the length of the visible range; zero otherwise. | 8090 * If a local variable, the length of the visible range; zero otherwise. |
| 8454 */ | 8091 */ |
| 8455 void set visibleLength(int _value) { | 8092 void set visibleLength(int _value) { |
| 8456 assert(!_finished); | |
| 8457 assert(_value == null || _value >= 0); | 8093 assert(_value == null || _value >= 0); |
| 8458 _visibleLength = _value; | 8094 _visibleLength = _value; |
| 8459 } | 8095 } |
| 8460 | 8096 |
| 8461 @override | 8097 @override |
| 8462 int get visibleOffset => _visibleOffset ??= 0; | 8098 int get visibleOffset => _visibleOffset ??= 0; |
| 8463 | 8099 |
| 8464 /** | 8100 /** |
| 8465 * If a local variable, the beginning of the visible range; zero otherwise. | 8101 * If a local variable, the beginning of the visible range; zero otherwise. |
| 8466 */ | 8102 */ |
| 8467 void set visibleOffset(int _value) { | 8103 void set visibleOffset(int _value) { |
| 8468 assert(!_finished); | |
| 8469 assert(_value == null || _value >= 0); | 8104 assert(_value == null || _value >= 0); |
| 8470 _visibleOffset = _value; | 8105 _visibleOffset = _value; |
| 8471 } | 8106 } |
| 8472 | 8107 |
| 8473 UnlinkedVariableBuilder({List<UnlinkedConstBuilder> annotations, CodeRangeBuil
der codeRange, UnlinkedDocumentationCommentBuilder documentationComment, int inf
erredTypeSlot, UnlinkedExecutableBuilder initializer, bool isConst, bool isFinal
, bool isStatic, String name, int nameOffset, int propagatedTypeSlot, EntityRefB
uilder type, int visibleLength, int visibleOffset}) | 8108 UnlinkedVariableBuilder({List<UnlinkedConstBuilder> annotations, CodeRangeBuil
der codeRange, UnlinkedDocumentationCommentBuilder documentationComment, int inf
erredTypeSlot, UnlinkedExecutableBuilder initializer, bool isConst, bool isFinal
, bool isStatic, String name, int nameOffset, int propagatedTypeSlot, EntityRefB
uilder type, int visibleLength, int visibleOffset}) |
| 8474 : _annotations = annotations, | 8109 : _annotations = annotations, |
| 8475 _codeRange = codeRange, | 8110 _codeRange = codeRange, |
| 8476 _documentationComment = documentationComment, | 8111 _documentationComment = documentationComment, |
| 8477 _inferredTypeSlot = inferredTypeSlot, | 8112 _inferredTypeSlot = inferredTypeSlot, |
| 8478 _initializer = initializer, | 8113 _initializer = initializer, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 8492 void flushInformative() { | 8127 void flushInformative() { |
| 8493 _annotations?.forEach((b) => b.flushInformative()); | 8128 _annotations?.forEach((b) => b.flushInformative()); |
| 8494 _codeRange = null; | 8129 _codeRange = null; |
| 8495 _documentationComment = null; | 8130 _documentationComment = null; |
| 8496 _initializer?.flushInformative(); | 8131 _initializer?.flushInformative(); |
| 8497 _nameOffset = null; | 8132 _nameOffset = null; |
| 8498 _type?.flushInformative(); | 8133 _type?.flushInformative(); |
| 8499 } | 8134 } |
| 8500 | 8135 |
| 8501 fb.Offset finish(fb.Builder fbBuilder) { | 8136 fb.Offset finish(fb.Builder fbBuilder) { |
| 8502 assert(!_finished); | |
| 8503 _finished = true; | |
| 8504 fb.Offset offset_annotations; | 8137 fb.Offset offset_annotations; |
| 8505 fb.Offset offset_codeRange; | 8138 fb.Offset offset_codeRange; |
| 8506 fb.Offset offset_documentationComment; | 8139 fb.Offset offset_documentationComment; |
| 8507 fb.Offset offset_initializer; | 8140 fb.Offset offset_initializer; |
| 8508 fb.Offset offset_name; | 8141 fb.Offset offset_name; |
| 8509 fb.Offset offset_type; | 8142 fb.Offset offset_type; |
| 8510 if (!(_annotations == null || _annotations.isEmpty)) { | 8143 if (!(_annotations == null || _annotations.isEmpty)) { |
| 8511 offset_annotations = fbBuilder.writeList(_annotations.map((b) => b.finish(
fbBuilder)).toList()); | 8144 offset_annotations = fbBuilder.writeList(_annotations.map((b) => b.finish(
fbBuilder)).toList()); |
| 8512 } | 8145 } |
| 8513 if (_codeRange != null) { | 8146 if (_codeRange != null) { |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8721 "propagatedTypeSlot": propagatedTypeSlot, | 8354 "propagatedTypeSlot": propagatedTypeSlot, |
| 8722 "type": type, | 8355 "type": type, |
| 8723 "visibleLength": visibleLength, | 8356 "visibleLength": visibleLength, |
| 8724 "visibleOffset": visibleOffset, | 8357 "visibleOffset": visibleOffset, |
| 8725 }; | 8358 }; |
| 8726 | 8359 |
| 8727 @override | 8360 @override |
| 8728 String toString() => convert.JSON.encode(toJson()); | 8361 String toString() => convert.JSON.encode(toJson()); |
| 8729 } | 8362 } |
| 8730 | 8363 |
| OLD | NEW |