| 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 'dart:convert'; | 10 import 'dart:convert'; |
| (...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 builder.unlinkedUnits = unlinkedUnits; | 504 builder.unlinkedUnits = unlinkedUnits; |
| 505 return builder; | 505 return builder; |
| 506 } | 506 } |
| 507 | 507 |
| 508 /** | 508 /** |
| 509 * Unlinked summary information about a class declaration. | 509 * Unlinked summary information about a class declaration. |
| 510 */ | 510 */ |
| 511 class UnlinkedClass extends base.SummaryClass { | 511 class UnlinkedClass extends base.SummaryClass { |
| 512 String _name; | 512 String _name; |
| 513 int _nameOffset; | 513 int _nameOffset; |
| 514 UnlinkedDocumentationComment _documentationComment; |
| 514 List<UnlinkedTypeParam> _typeParameters; | 515 List<UnlinkedTypeParam> _typeParameters; |
| 515 UnlinkedTypeRef _supertype; | 516 UnlinkedTypeRef _supertype; |
| 516 List<UnlinkedTypeRef> _mixins; | 517 List<UnlinkedTypeRef> _mixins; |
| 517 List<UnlinkedTypeRef> _interfaces; | 518 List<UnlinkedTypeRef> _interfaces; |
| 518 List<UnlinkedVariable> _fields; | 519 List<UnlinkedVariable> _fields; |
| 519 List<UnlinkedExecutable> _executables; | 520 List<UnlinkedExecutable> _executables; |
| 520 bool _isAbstract; | 521 bool _isAbstract; |
| 521 bool _isMixinApplication; | 522 bool _isMixinApplication; |
| 522 bool _hasNoSupertype; | 523 bool _hasNoSupertype; |
| 523 | 524 |
| 524 UnlinkedClass.fromJson(Map json) | 525 UnlinkedClass.fromJson(Map json) |
| 525 : _name = json["name"], | 526 : _name = json["name"], |
| 526 _nameOffset = json["nameOffset"], | 527 _nameOffset = json["nameOffset"], |
| 528 _documentationComment = json["documentationComment"] == null ? null : new
UnlinkedDocumentationComment.fromJson(json["documentationComment"]), |
| 527 _typeParameters = json["typeParameters"]?.map((x) => new UnlinkedTypeParam
.fromJson(x))?.toList(), | 529 _typeParameters = json["typeParameters"]?.map((x) => new UnlinkedTypeParam
.fromJson(x))?.toList(), |
| 528 _supertype = json["supertype"] == null ? null : new UnlinkedTypeRef.fromJs
on(json["supertype"]), | 530 _supertype = json["supertype"] == null ? null : new UnlinkedTypeRef.fromJs
on(json["supertype"]), |
| 529 _mixins = json["mixins"]?.map((x) => new UnlinkedTypeRef.fromJson(x))?.toL
ist(), | 531 _mixins = json["mixins"]?.map((x) => new UnlinkedTypeRef.fromJson(x))?.toL
ist(), |
| 530 _interfaces = json["interfaces"]?.map((x) => new UnlinkedTypeRef.fromJson(
x))?.toList(), | 532 _interfaces = json["interfaces"]?.map((x) => new UnlinkedTypeRef.fromJson(
x))?.toList(), |
| 531 _fields = json["fields"]?.map((x) => new UnlinkedVariable.fromJson(x))?.to
List(), | 533 _fields = json["fields"]?.map((x) => new UnlinkedVariable.fromJson(x))?.to
List(), |
| 532 _executables = json["executables"]?.map((x) => new UnlinkedExecutable.from
Json(x))?.toList(), | 534 _executables = json["executables"]?.map((x) => new UnlinkedExecutable.from
Json(x))?.toList(), |
| 533 _isAbstract = json["isAbstract"], | 535 _isAbstract = json["isAbstract"], |
| 534 _isMixinApplication = json["isMixinApplication"], | 536 _isMixinApplication = json["isMixinApplication"], |
| 535 _hasNoSupertype = json["hasNoSupertype"]; | 537 _hasNoSupertype = json["hasNoSupertype"]; |
| 536 | 538 |
| 537 @override | 539 @override |
| 538 Map<String, Object> toMap() => { | 540 Map<String, Object> toMap() => { |
| 539 "name": name, | 541 "name": name, |
| 540 "nameOffset": nameOffset, | 542 "nameOffset": nameOffset, |
| 543 "documentationComment": documentationComment, |
| 541 "typeParameters": typeParameters, | 544 "typeParameters": typeParameters, |
| 542 "supertype": supertype, | 545 "supertype": supertype, |
| 543 "mixins": mixins, | 546 "mixins": mixins, |
| 544 "interfaces": interfaces, | 547 "interfaces": interfaces, |
| 545 "fields": fields, | 548 "fields": fields, |
| 546 "executables": executables, | 549 "executables": executables, |
| 547 "isAbstract": isAbstract, | 550 "isAbstract": isAbstract, |
| 548 "isMixinApplication": isMixinApplication, | 551 "isMixinApplication": isMixinApplication, |
| 549 "hasNoSupertype": hasNoSupertype, | 552 "hasNoSupertype": hasNoSupertype, |
| 550 }; | 553 }; |
| 551 | 554 |
| 552 /** | 555 /** |
| 553 * Name of the class. | 556 * Name of the class. |
| 554 */ | 557 */ |
| 555 String get name => _name ?? ''; | 558 String get name => _name ?? ''; |
| 556 | 559 |
| 557 /** | 560 /** |
| 558 * Offset of the class name relative to the beginning of the file. | 561 * Offset of the class name relative to the beginning of the file. |
| 559 */ | 562 */ |
| 560 int get nameOffset => _nameOffset ?? 0; | 563 int get nameOffset => _nameOffset ?? 0; |
| 561 | 564 |
| 562 /** | 565 /** |
| 566 * Documentation comment for the class, or `null` if there is no |
| 567 * documentation comment. |
| 568 */ |
| 569 UnlinkedDocumentationComment get documentationComment => _documentationComment
; |
| 570 |
| 571 /** |
| 563 * Type parameters of the class, if any. | 572 * Type parameters of the class, if any. |
| 564 */ | 573 */ |
| 565 List<UnlinkedTypeParam> get typeParameters => _typeParameters ?? const <Unlink
edTypeParam>[]; | 574 List<UnlinkedTypeParam> get typeParameters => _typeParameters ?? const <Unlink
edTypeParam>[]; |
| 566 | 575 |
| 567 /** | 576 /** |
| 568 * Supertype of the class, or `null` if either (a) the class doesn't | 577 * Supertype of the class, or `null` if either (a) the class doesn't |
| 569 * explicitly declare a supertype (and hence has supertype `Object`), or (b) | 578 * explicitly declare a supertype (and hence has supertype `Object`), or (b) |
| 570 * the class *is* `Object` (and hence has no supertype). | 579 * the class *is* `Object` (and hence has no supertype). |
| 571 */ | 580 */ |
| 572 UnlinkedTypeRef get supertype => _supertype; | 581 UnlinkedTypeRef get supertype => _supertype; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 631 */ | 640 */ |
| 632 void set nameOffset(int _value) { | 641 void set nameOffset(int _value) { |
| 633 assert(!_finished); | 642 assert(!_finished); |
| 634 assert(!_json.containsKey("nameOffset")); | 643 assert(!_json.containsKey("nameOffset")); |
| 635 if (_value != null) { | 644 if (_value != null) { |
| 636 _json["nameOffset"] = _value; | 645 _json["nameOffset"] = _value; |
| 637 } | 646 } |
| 638 } | 647 } |
| 639 | 648 |
| 640 /** | 649 /** |
| 650 * Documentation comment for the class, or `null` if there is no |
| 651 * documentation comment. |
| 652 */ |
| 653 void set documentationComment(UnlinkedDocumentationCommentBuilder _value) { |
| 654 assert(!_finished); |
| 655 assert(!_json.containsKey("documentationComment")); |
| 656 if (_value != null) { |
| 657 _json["documentationComment"] = _value.finish(); |
| 658 } |
| 659 } |
| 660 |
| 661 /** |
| 641 * Type parameters of the class, if any. | 662 * Type parameters of the class, if any. |
| 642 */ | 663 */ |
| 643 void set typeParameters(List<UnlinkedTypeParamBuilder> _value) { | 664 void set typeParameters(List<UnlinkedTypeParamBuilder> _value) { |
| 644 assert(!_finished); | 665 assert(!_finished); |
| 645 assert(!_json.containsKey("typeParameters")); | 666 assert(!_json.containsKey("typeParameters")); |
| 646 if (!(_value == null || _value.isEmpty)) { | 667 if (!(_value == null || _value.isEmpty)) { |
| 647 _json["typeParameters"] = _value.map((b) => b.finish()).toList(); | 668 _json["typeParameters"] = _value.map((b) => b.finish()).toList(); |
| 648 } | 669 } |
| 649 } | 670 } |
| 650 | 671 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 739 } | 760 } |
| 740 } | 761 } |
| 741 | 762 |
| 742 Map finish() { | 763 Map finish() { |
| 743 assert(!_finished); | 764 assert(!_finished); |
| 744 _finished = true; | 765 _finished = true; |
| 745 return _json; | 766 return _json; |
| 746 } | 767 } |
| 747 } | 768 } |
| 748 | 769 |
| 749 UnlinkedClassBuilder encodeUnlinkedClass(base.BuilderContext builderContext, {St
ring name, int nameOffset, List<UnlinkedTypeParamBuilder> typeParameters, Unlink
edTypeRefBuilder supertype, List<UnlinkedTypeRefBuilder> mixins, List<UnlinkedTy
peRefBuilder> interfaces, List<UnlinkedVariableBuilder> fields, List<UnlinkedExe
cutableBuilder> executables, bool isAbstract, bool isMixinApplication, bool hasN
oSupertype}) { | 770 UnlinkedClassBuilder encodeUnlinkedClass(base.BuilderContext builderContext, {St
ring name, int nameOffset, UnlinkedDocumentationCommentBuilder documentationComm
ent, List<UnlinkedTypeParamBuilder> typeParameters, UnlinkedTypeRefBuilder super
type, List<UnlinkedTypeRefBuilder> mixins, List<UnlinkedTypeRefBuilder> interfac
es, List<UnlinkedVariableBuilder> fields, List<UnlinkedExecutableBuilder> execut
ables, bool isAbstract, bool isMixinApplication, bool hasNoSupertype}) { |
| 750 UnlinkedClassBuilder builder = new UnlinkedClassBuilder(builderContext); | 771 UnlinkedClassBuilder builder = new UnlinkedClassBuilder(builderContext); |
| 751 builder.name = name; | 772 builder.name = name; |
| 752 builder.nameOffset = nameOffset; | 773 builder.nameOffset = nameOffset; |
| 774 builder.documentationComment = documentationComment; |
| 753 builder.typeParameters = typeParameters; | 775 builder.typeParameters = typeParameters; |
| 754 builder.supertype = supertype; | 776 builder.supertype = supertype; |
| 755 builder.mixins = mixins; | 777 builder.mixins = mixins; |
| 756 builder.interfaces = interfaces; | 778 builder.interfaces = interfaces; |
| 757 builder.fields = fields; | 779 builder.fields = fields; |
| 758 builder.executables = executables; | 780 builder.executables = executables; |
| 759 builder.isAbstract = isAbstract; | 781 builder.isAbstract = isAbstract; |
| 760 builder.isMixinApplication = isMixinApplication; | 782 builder.isMixinApplication = isMixinApplication; |
| 761 builder.hasNoSupertype = hasNoSupertype; | 783 builder.hasNoSupertype = hasNoSupertype; |
| 762 return builder; | 784 return builder; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 828 } | 850 } |
| 829 | 851 |
| 830 UnlinkedCombinatorBuilder encodeUnlinkedCombinator(base.BuilderContext builderCo
ntext, {List<String> shows, List<String> hides}) { | 852 UnlinkedCombinatorBuilder encodeUnlinkedCombinator(base.BuilderContext builderCo
ntext, {List<String> shows, List<String> hides}) { |
| 831 UnlinkedCombinatorBuilder builder = new UnlinkedCombinatorBuilder(builderConte
xt); | 853 UnlinkedCombinatorBuilder builder = new UnlinkedCombinatorBuilder(builderConte
xt); |
| 832 builder.shows = shows; | 854 builder.shows = shows; |
| 833 builder.hides = hides; | 855 builder.hides = hides; |
| 834 return builder; | 856 return builder; |
| 835 } | 857 } |
| 836 | 858 |
| 837 /** | 859 /** |
| 860 * Unlinked summary information about a documentation comment. |
| 861 */ |
| 862 class UnlinkedDocumentationComment extends base.SummaryClass { |
| 863 String _text; |
| 864 |
| 865 UnlinkedDocumentationComment.fromJson(Map json) |
| 866 : _text = json["text"]; |
| 867 |
| 868 @override |
| 869 Map<String, Object> toMap() => { |
| 870 "text": text, |
| 871 }; |
| 872 |
| 873 /** |
| 874 * Text of the documentation comment, with '\r\n' replaced by '\n'. |
| 875 * |
| 876 * References appearing within the doc comment in square brackets are not |
| 877 * specially encoded. |
| 878 */ |
| 879 String get text => _text ?? ''; |
| 880 } |
| 881 |
| 882 class UnlinkedDocumentationCommentBuilder { |
| 883 final Map _json = {}; |
| 884 |
| 885 bool _finished = false; |
| 886 |
| 887 UnlinkedDocumentationCommentBuilder(base.BuilderContext context); |
| 888 |
| 889 /** |
| 890 * Text of the documentation comment, with '\r\n' replaced by '\n'. |
| 891 * |
| 892 * References appearing within the doc comment in square brackets are not |
| 893 * specially encoded. |
| 894 */ |
| 895 void set text(String _value) { |
| 896 assert(!_finished); |
| 897 assert(!_json.containsKey("text")); |
| 898 if (_value != null) { |
| 899 _json["text"] = _value; |
| 900 } |
| 901 } |
| 902 |
| 903 Map finish() { |
| 904 assert(!_finished); |
| 905 _finished = true; |
| 906 return _json; |
| 907 } |
| 908 } |
| 909 |
| 910 UnlinkedDocumentationCommentBuilder encodeUnlinkedDocumentationComment(base.Buil
derContext builderContext, {String text}) { |
| 911 UnlinkedDocumentationCommentBuilder builder = new UnlinkedDocumentationComment
Builder(builderContext); |
| 912 builder.text = text; |
| 913 return builder; |
| 914 } |
| 915 |
| 916 /** |
| 838 * Unlinked summary information about an enum declaration. | 917 * Unlinked summary information about an enum declaration. |
| 839 */ | 918 */ |
| 840 class UnlinkedEnum extends base.SummaryClass { | 919 class UnlinkedEnum extends base.SummaryClass { |
| 841 String _name; | 920 String _name; |
| 842 int _nameOffset; | 921 int _nameOffset; |
| 922 UnlinkedDocumentationComment _documentationComment; |
| 843 List<UnlinkedEnumValue> _values; | 923 List<UnlinkedEnumValue> _values; |
| 844 | 924 |
| 845 UnlinkedEnum.fromJson(Map json) | 925 UnlinkedEnum.fromJson(Map json) |
| 846 : _name = json["name"], | 926 : _name = json["name"], |
| 847 _nameOffset = json["nameOffset"], | 927 _nameOffset = json["nameOffset"], |
| 928 _documentationComment = json["documentationComment"] == null ? null : new
UnlinkedDocumentationComment.fromJson(json["documentationComment"]), |
| 848 _values = json["values"]?.map((x) => new UnlinkedEnumValue.fromJson(x))?.t
oList(); | 929 _values = json["values"]?.map((x) => new UnlinkedEnumValue.fromJson(x))?.t
oList(); |
| 849 | 930 |
| 850 @override | 931 @override |
| 851 Map<String, Object> toMap() => { | 932 Map<String, Object> toMap() => { |
| 852 "name": name, | 933 "name": name, |
| 853 "nameOffset": nameOffset, | 934 "nameOffset": nameOffset, |
| 935 "documentationComment": documentationComment, |
| 854 "values": values, | 936 "values": values, |
| 855 }; | 937 }; |
| 856 | 938 |
| 857 /** | 939 /** |
| 858 * Name of the enum type. | 940 * Name of the enum type. |
| 859 */ | 941 */ |
| 860 String get name => _name ?? ''; | 942 String get name => _name ?? ''; |
| 861 | 943 |
| 862 /** | 944 /** |
| 863 * Offset of the enum name relative to the beginning of the file. | 945 * Offset of the enum name relative to the beginning of the file. |
| 864 */ | 946 */ |
| 865 int get nameOffset => _nameOffset ?? 0; | 947 int get nameOffset => _nameOffset ?? 0; |
| 866 | 948 |
| 867 /** | 949 /** |
| 950 * Documentation comment for the enum, or `null` if there is no documentation |
| 951 * comment. |
| 952 */ |
| 953 UnlinkedDocumentationComment get documentationComment => _documentationComment
; |
| 954 |
| 955 /** |
| 868 * Values listed in the enum declaration, in declaration order. | 956 * Values listed in the enum declaration, in declaration order. |
| 869 */ | 957 */ |
| 870 List<UnlinkedEnumValue> get values => _values ?? const <UnlinkedEnumValue>[]; | 958 List<UnlinkedEnumValue> get values => _values ?? const <UnlinkedEnumValue>[]; |
| 871 } | 959 } |
| 872 | 960 |
| 873 class UnlinkedEnumBuilder { | 961 class UnlinkedEnumBuilder { |
| 874 final Map _json = {}; | 962 final Map _json = {}; |
| 875 | 963 |
| 876 bool _finished = false; | 964 bool _finished = false; |
| 877 | 965 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 893 */ | 981 */ |
| 894 void set nameOffset(int _value) { | 982 void set nameOffset(int _value) { |
| 895 assert(!_finished); | 983 assert(!_finished); |
| 896 assert(!_json.containsKey("nameOffset")); | 984 assert(!_json.containsKey("nameOffset")); |
| 897 if (_value != null) { | 985 if (_value != null) { |
| 898 _json["nameOffset"] = _value; | 986 _json["nameOffset"] = _value; |
| 899 } | 987 } |
| 900 } | 988 } |
| 901 | 989 |
| 902 /** | 990 /** |
| 991 * Documentation comment for the enum, or `null` if there is no documentation |
| 992 * comment. |
| 993 */ |
| 994 void set documentationComment(UnlinkedDocumentationCommentBuilder _value) { |
| 995 assert(!_finished); |
| 996 assert(!_json.containsKey("documentationComment")); |
| 997 if (_value != null) { |
| 998 _json["documentationComment"] = _value.finish(); |
| 999 } |
| 1000 } |
| 1001 |
| 1002 /** |
| 903 * Values listed in the enum declaration, in declaration order. | 1003 * Values listed in the enum declaration, in declaration order. |
| 904 */ | 1004 */ |
| 905 void set values(List<UnlinkedEnumValueBuilder> _value) { | 1005 void set values(List<UnlinkedEnumValueBuilder> _value) { |
| 906 assert(!_finished); | 1006 assert(!_finished); |
| 907 assert(!_json.containsKey("values")); | 1007 assert(!_json.containsKey("values")); |
| 908 if (!(_value == null || _value.isEmpty)) { | 1008 if (!(_value == null || _value.isEmpty)) { |
| 909 _json["values"] = _value.map((b) => b.finish()).toList(); | 1009 _json["values"] = _value.map((b) => b.finish()).toList(); |
| 910 } | 1010 } |
| 911 } | 1011 } |
| 912 | 1012 |
| 913 Map finish() { | 1013 Map finish() { |
| 914 assert(!_finished); | 1014 assert(!_finished); |
| 915 _finished = true; | 1015 _finished = true; |
| 916 return _json; | 1016 return _json; |
| 917 } | 1017 } |
| 918 } | 1018 } |
| 919 | 1019 |
| 920 UnlinkedEnumBuilder encodeUnlinkedEnum(base.BuilderContext builderContext, {Stri
ng name, int nameOffset, List<UnlinkedEnumValueBuilder> values}) { | 1020 UnlinkedEnumBuilder encodeUnlinkedEnum(base.BuilderContext builderContext, {Stri
ng name, int nameOffset, UnlinkedDocumentationCommentBuilder documentationCommen
t, List<UnlinkedEnumValueBuilder> values}) { |
| 921 UnlinkedEnumBuilder builder = new UnlinkedEnumBuilder(builderContext); | 1021 UnlinkedEnumBuilder builder = new UnlinkedEnumBuilder(builderContext); |
| 922 builder.name = name; | 1022 builder.name = name; |
| 923 builder.nameOffset = nameOffset; | 1023 builder.nameOffset = nameOffset; |
| 1024 builder.documentationComment = documentationComment; |
| 924 builder.values = values; | 1025 builder.values = values; |
| 925 return builder; | 1026 return builder; |
| 926 } | 1027 } |
| 927 | 1028 |
| 928 /** | 1029 /** |
| 929 * Unlinked summary information about a single enumerated value in an enum | 1030 * Unlinked summary information about a single enumerated value in an enum |
| 930 * declaration. | 1031 * declaration. |
| 931 */ | 1032 */ |
| 932 class UnlinkedEnumValue extends base.SummaryClass { | 1033 class UnlinkedEnumValue extends base.SummaryClass { |
| 933 String _name; | 1034 String _name; |
| 934 int _nameOffset; | 1035 int _nameOffset; |
| 1036 UnlinkedDocumentationComment _documentationComment; |
| 935 | 1037 |
| 936 UnlinkedEnumValue.fromJson(Map json) | 1038 UnlinkedEnumValue.fromJson(Map json) |
| 937 : _name = json["name"], | 1039 : _name = json["name"], |
| 938 _nameOffset = json["nameOffset"]; | 1040 _nameOffset = json["nameOffset"], |
| 1041 _documentationComment = json["documentationComment"] == null ? null : new
UnlinkedDocumentationComment.fromJson(json["documentationComment"]); |
| 939 | 1042 |
| 940 @override | 1043 @override |
| 941 Map<String, Object> toMap() => { | 1044 Map<String, Object> toMap() => { |
| 942 "name": name, | 1045 "name": name, |
| 943 "nameOffset": nameOffset, | 1046 "nameOffset": nameOffset, |
| 1047 "documentationComment": documentationComment, |
| 944 }; | 1048 }; |
| 945 | 1049 |
| 946 /** | 1050 /** |
| 947 * Name of the enumerated value. | 1051 * Name of the enumerated value. |
| 948 */ | 1052 */ |
| 949 String get name => _name ?? ''; | 1053 String get name => _name ?? ''; |
| 950 | 1054 |
| 951 /** | 1055 /** |
| 952 * Offset of the enum value name relative to the beginning of the file. | 1056 * Offset of the enum value name relative to the beginning of the file. |
| 953 */ | 1057 */ |
| 954 int get nameOffset => _nameOffset ?? 0; | 1058 int get nameOffset => _nameOffset ?? 0; |
| 1059 |
| 1060 /** |
| 1061 * Documentation comment for the enum value, or `null` if there is no |
| 1062 * documentation comment. |
| 1063 */ |
| 1064 UnlinkedDocumentationComment get documentationComment => _documentationComment
; |
| 955 } | 1065 } |
| 956 | 1066 |
| 957 class UnlinkedEnumValueBuilder { | 1067 class UnlinkedEnumValueBuilder { |
| 958 final Map _json = {}; | 1068 final Map _json = {}; |
| 959 | 1069 |
| 960 bool _finished = false; | 1070 bool _finished = false; |
| 961 | 1071 |
| 962 UnlinkedEnumValueBuilder(base.BuilderContext context); | 1072 UnlinkedEnumValueBuilder(base.BuilderContext context); |
| 963 | 1073 |
| 964 /** | 1074 /** |
| (...skipping 11 matching lines...) Expand all Loading... |
| 976 * Offset of the enum value name relative to the beginning of the file. | 1086 * Offset of the enum value name relative to the beginning of the file. |
| 977 */ | 1087 */ |
| 978 void set nameOffset(int _value) { | 1088 void set nameOffset(int _value) { |
| 979 assert(!_finished); | 1089 assert(!_finished); |
| 980 assert(!_json.containsKey("nameOffset")); | 1090 assert(!_json.containsKey("nameOffset")); |
| 981 if (_value != null) { | 1091 if (_value != null) { |
| 982 _json["nameOffset"] = _value; | 1092 _json["nameOffset"] = _value; |
| 983 } | 1093 } |
| 984 } | 1094 } |
| 985 | 1095 |
| 1096 /** |
| 1097 * Documentation comment for the enum value, or `null` if there is no |
| 1098 * documentation comment. |
| 1099 */ |
| 1100 void set documentationComment(UnlinkedDocumentationCommentBuilder _value) { |
| 1101 assert(!_finished); |
| 1102 assert(!_json.containsKey("documentationComment")); |
| 1103 if (_value != null) { |
| 1104 _json["documentationComment"] = _value.finish(); |
| 1105 } |
| 1106 } |
| 1107 |
| 986 Map finish() { | 1108 Map finish() { |
| 987 assert(!_finished); | 1109 assert(!_finished); |
| 988 _finished = true; | 1110 _finished = true; |
| 989 return _json; | 1111 return _json; |
| 990 } | 1112 } |
| 991 } | 1113 } |
| 992 | 1114 |
| 993 UnlinkedEnumValueBuilder encodeUnlinkedEnumValue(base.BuilderContext builderCont
ext, {String name, int nameOffset}) { | 1115 UnlinkedEnumValueBuilder encodeUnlinkedEnumValue(base.BuilderContext builderCont
ext, {String name, int nameOffset, UnlinkedDocumentationCommentBuilder documenta
tionComment}) { |
| 994 UnlinkedEnumValueBuilder builder = new UnlinkedEnumValueBuilder(builderContext
); | 1116 UnlinkedEnumValueBuilder builder = new UnlinkedEnumValueBuilder(builderContext
); |
| 995 builder.name = name; | 1117 builder.name = name; |
| 996 builder.nameOffset = nameOffset; | 1118 builder.nameOffset = nameOffset; |
| 1119 builder.documentationComment = documentationComment; |
| 997 return builder; | 1120 return builder; |
| 998 } | 1121 } |
| 999 | 1122 |
| 1000 /** | 1123 /** |
| 1001 * Unlinked summary information about a function, method, getter, or setter | 1124 * Unlinked summary information about a function, method, getter, or setter |
| 1002 * declaration. | 1125 * declaration. |
| 1003 */ | 1126 */ |
| 1004 class UnlinkedExecutable extends base.SummaryClass { | 1127 class UnlinkedExecutable extends base.SummaryClass { |
| 1005 String _name; | 1128 String _name; |
| 1006 int _nameOffset; | 1129 int _nameOffset; |
| 1130 UnlinkedDocumentationComment _documentationComment; |
| 1007 List<UnlinkedTypeParam> _typeParameters; | 1131 List<UnlinkedTypeParam> _typeParameters; |
| 1008 UnlinkedTypeRef _returnType; | 1132 UnlinkedTypeRef _returnType; |
| 1009 List<UnlinkedParam> _parameters; | 1133 List<UnlinkedParam> _parameters; |
| 1010 UnlinkedExecutableKind _kind; | 1134 UnlinkedExecutableKind _kind; |
| 1011 bool _isAbstract; | 1135 bool _isAbstract; |
| 1012 bool _isStatic; | 1136 bool _isStatic; |
| 1013 bool _isConst; | 1137 bool _isConst; |
| 1014 bool _isFactory; | 1138 bool _isFactory; |
| 1015 bool _hasImplicitReturnType; | 1139 bool _hasImplicitReturnType; |
| 1016 bool _isExternal; | 1140 bool _isExternal; |
| 1017 | 1141 |
| 1018 UnlinkedExecutable.fromJson(Map json) | 1142 UnlinkedExecutable.fromJson(Map json) |
| 1019 : _name = json["name"], | 1143 : _name = json["name"], |
| 1020 _nameOffset = json["nameOffset"], | 1144 _nameOffset = json["nameOffset"], |
| 1145 _documentationComment = json["documentationComment"] == null ? null : new
UnlinkedDocumentationComment.fromJson(json["documentationComment"]), |
| 1021 _typeParameters = json["typeParameters"]?.map((x) => new UnlinkedTypeParam
.fromJson(x))?.toList(), | 1146 _typeParameters = json["typeParameters"]?.map((x) => new UnlinkedTypeParam
.fromJson(x))?.toList(), |
| 1022 _returnType = json["returnType"] == null ? null : new UnlinkedTypeRef.from
Json(json["returnType"]), | 1147 _returnType = json["returnType"] == null ? null : new UnlinkedTypeRef.from
Json(json["returnType"]), |
| 1023 _parameters = json["parameters"]?.map((x) => new UnlinkedParam.fromJson(x)
)?.toList(), | 1148 _parameters = json["parameters"]?.map((x) => new UnlinkedParam.fromJson(x)
)?.toList(), |
| 1024 _kind = json["kind"] == null ? null : UnlinkedExecutableKind.values[json["
kind"]], | 1149 _kind = json["kind"] == null ? null : UnlinkedExecutableKind.values[json["
kind"]], |
| 1025 _isAbstract = json["isAbstract"], | 1150 _isAbstract = json["isAbstract"], |
| 1026 _isStatic = json["isStatic"], | 1151 _isStatic = json["isStatic"], |
| 1027 _isConst = json["isConst"], | 1152 _isConst = json["isConst"], |
| 1028 _isFactory = json["isFactory"], | 1153 _isFactory = json["isFactory"], |
| 1029 _hasImplicitReturnType = json["hasImplicitReturnType"], | 1154 _hasImplicitReturnType = json["hasImplicitReturnType"], |
| 1030 _isExternal = json["isExternal"]; | 1155 _isExternal = json["isExternal"]; |
| 1031 | 1156 |
| 1032 @override | 1157 @override |
| 1033 Map<String, Object> toMap() => { | 1158 Map<String, Object> toMap() => { |
| 1034 "name": name, | 1159 "name": name, |
| 1035 "nameOffset": nameOffset, | 1160 "nameOffset": nameOffset, |
| 1161 "documentationComment": documentationComment, |
| 1036 "typeParameters": typeParameters, | 1162 "typeParameters": typeParameters, |
| 1037 "returnType": returnType, | 1163 "returnType": returnType, |
| 1038 "parameters": parameters, | 1164 "parameters": parameters, |
| 1039 "kind": kind, | 1165 "kind": kind, |
| 1040 "isAbstract": isAbstract, | 1166 "isAbstract": isAbstract, |
| 1041 "isStatic": isStatic, | 1167 "isStatic": isStatic, |
| 1042 "isConst": isConst, | 1168 "isConst": isConst, |
| 1043 "isFactory": isFactory, | 1169 "isFactory": isFactory, |
| 1044 "hasImplicitReturnType": hasImplicitReturnType, | 1170 "hasImplicitReturnType": hasImplicitReturnType, |
| 1045 "isExternal": isExternal, | 1171 "isExternal": isExternal, |
| 1046 }; | 1172 }; |
| 1047 | 1173 |
| 1048 /** | 1174 /** |
| 1049 * Name of the executable. For setters, this includes the trailing "=". For | 1175 * Name of the executable. For setters, this includes the trailing "=". For |
| 1050 * named constructors, this excludes the class name and excludes the ".". | 1176 * named constructors, this excludes the class name and excludes the ".". |
| 1051 * For unnamed constructors, this is the empty string. | 1177 * For unnamed constructors, this is the empty string. |
| 1052 */ | 1178 */ |
| 1053 String get name => _name ?? ''; | 1179 String get name => _name ?? ''; |
| 1054 | 1180 |
| 1055 /** | 1181 /** |
| 1056 * Offset of the executable name relative to the beginning of the file. For | 1182 * Offset of the executable name relative to the beginning of the file. For |
| 1057 * named constructors, this excludes the class name and excludes the ".". | 1183 * named constructors, this excludes the class name and excludes the ".". |
| 1058 * For unnamed constructors, this is the offset of the class name (i.e. the | 1184 * For unnamed constructors, this is the offset of the class name (i.e. the |
| 1059 * offset of the second "C" in "class C { C(); }"). | 1185 * offset of the second "C" in "class C { C(); }"). |
| 1060 */ | 1186 */ |
| 1061 int get nameOffset => _nameOffset ?? 0; | 1187 int get nameOffset => _nameOffset ?? 0; |
| 1062 | 1188 |
| 1063 /** | 1189 /** |
| 1190 * Documentation comment for the executable, or `null` if there is no |
| 1191 * documentation comment. |
| 1192 */ |
| 1193 UnlinkedDocumentationComment get documentationComment => _documentationComment
; |
| 1194 |
| 1195 /** |
| 1064 * Type parameters of the executable, if any. Empty if support for generic | 1196 * Type parameters of the executable, if any. Empty if support for generic |
| 1065 * method syntax is disabled. | 1197 * method syntax is disabled. |
| 1066 */ | 1198 */ |
| 1067 List<UnlinkedTypeParam> get typeParameters => _typeParameters ?? const <Unlink
edTypeParam>[]; | 1199 List<UnlinkedTypeParam> get typeParameters => _typeParameters ?? const <Unlink
edTypeParam>[]; |
| 1068 | 1200 |
| 1069 /** | 1201 /** |
| 1070 * Declared return type of the executable. Absent if the return type is | 1202 * Declared return type of the executable. Absent if the return type is |
| 1071 * `void` or the executable is a constructor. Note that when strong mode is | 1203 * `void` or the executable is a constructor. Note that when strong mode is |
| 1072 * enabled, the actual return type may be different due to type inference. | 1204 * enabled, the actual return type may be different due to type inference. |
| 1073 */ | 1205 */ |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1150 */ | 1282 */ |
| 1151 void set nameOffset(int _value) { | 1283 void set nameOffset(int _value) { |
| 1152 assert(!_finished); | 1284 assert(!_finished); |
| 1153 assert(!_json.containsKey("nameOffset")); | 1285 assert(!_json.containsKey("nameOffset")); |
| 1154 if (_value != null) { | 1286 if (_value != null) { |
| 1155 _json["nameOffset"] = _value; | 1287 _json["nameOffset"] = _value; |
| 1156 } | 1288 } |
| 1157 } | 1289 } |
| 1158 | 1290 |
| 1159 /** | 1291 /** |
| 1292 * Documentation comment for the executable, or `null` if there is no |
| 1293 * documentation comment. |
| 1294 */ |
| 1295 void set documentationComment(UnlinkedDocumentationCommentBuilder _value) { |
| 1296 assert(!_finished); |
| 1297 assert(!_json.containsKey("documentationComment")); |
| 1298 if (_value != null) { |
| 1299 _json["documentationComment"] = _value.finish(); |
| 1300 } |
| 1301 } |
| 1302 |
| 1303 /** |
| 1160 * Type parameters of the executable, if any. Empty if support for generic | 1304 * Type parameters of the executable, if any. Empty if support for generic |
| 1161 * method syntax is disabled. | 1305 * method syntax is disabled. |
| 1162 */ | 1306 */ |
| 1163 void set typeParameters(List<UnlinkedTypeParamBuilder> _value) { | 1307 void set typeParameters(List<UnlinkedTypeParamBuilder> _value) { |
| 1164 assert(!_finished); | 1308 assert(!_finished); |
| 1165 assert(!_json.containsKey("typeParameters")); | 1309 assert(!_json.containsKey("typeParameters")); |
| 1166 if (!(_value == null || _value.isEmpty)) { | 1310 if (!(_value == null || _value.isEmpty)) { |
| 1167 _json["typeParameters"] = _value.map((b) => b.finish()).toList(); | 1311 _json["typeParameters"] = _value.map((b) => b.finish()).toList(); |
| 1168 } | 1312 } |
| 1169 } | 1313 } |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1277 } | 1421 } |
| 1278 } | 1422 } |
| 1279 | 1423 |
| 1280 Map finish() { | 1424 Map finish() { |
| 1281 assert(!_finished); | 1425 assert(!_finished); |
| 1282 _finished = true; | 1426 _finished = true; |
| 1283 return _json; | 1427 return _json; |
| 1284 } | 1428 } |
| 1285 } | 1429 } |
| 1286 | 1430 |
| 1287 UnlinkedExecutableBuilder encodeUnlinkedExecutable(base.BuilderContext builderCo
ntext, {String name, int nameOffset, List<UnlinkedTypeParamBuilder> typeParamete
rs, UnlinkedTypeRefBuilder returnType, List<UnlinkedParamBuilder> parameters, Un
linkedExecutableKind kind, bool isAbstract, bool isStatic, bool isConst, bool is
Factory, bool hasImplicitReturnType, bool isExternal}) { | 1431 UnlinkedExecutableBuilder encodeUnlinkedExecutable(base.BuilderContext builderCo
ntext, {String name, int nameOffset, UnlinkedDocumentationCommentBuilder documen
tationComment, List<UnlinkedTypeParamBuilder> typeParameters, UnlinkedTypeRefBui
lder returnType, List<UnlinkedParamBuilder> parameters, UnlinkedExecutableKind k
ind, bool isAbstract, bool isStatic, bool isConst, bool isFactory, bool hasImpli
citReturnType, bool isExternal}) { |
| 1288 UnlinkedExecutableBuilder builder = new UnlinkedExecutableBuilder(builderConte
xt); | 1432 UnlinkedExecutableBuilder builder = new UnlinkedExecutableBuilder(builderConte
xt); |
| 1289 builder.name = name; | 1433 builder.name = name; |
| 1290 builder.nameOffset = nameOffset; | 1434 builder.nameOffset = nameOffset; |
| 1435 builder.documentationComment = documentationComment; |
| 1291 builder.typeParameters = typeParameters; | 1436 builder.typeParameters = typeParameters; |
| 1292 builder.returnType = returnType; | 1437 builder.returnType = returnType; |
| 1293 builder.parameters = parameters; | 1438 builder.parameters = parameters; |
| 1294 builder.kind = kind; | 1439 builder.kind = kind; |
| 1295 builder.isAbstract = isAbstract; | 1440 builder.isAbstract = isAbstract; |
| 1296 builder.isStatic = isStatic; | 1441 builder.isStatic = isStatic; |
| 1297 builder.isConst = isConst; | 1442 builder.isConst = isConst; |
| 1298 builder.isFactory = isFactory; | 1443 builder.isFactory = isFactory; |
| 1299 builder.hasImplicitReturnType = hasImplicitReturnType; | 1444 builder.hasImplicitReturnType = hasImplicitReturnType; |
| 1300 builder.isExternal = isExternal; | 1445 builder.isExternal = isExternal; |
| (...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2254 builder.prefixReference = prefixReference; | 2399 builder.prefixReference = prefixReference; |
| 2255 return builder; | 2400 return builder; |
| 2256 } | 2401 } |
| 2257 | 2402 |
| 2258 /** | 2403 /** |
| 2259 * Unlinked summary information about a typedef declaration. | 2404 * Unlinked summary information about a typedef declaration. |
| 2260 */ | 2405 */ |
| 2261 class UnlinkedTypedef extends base.SummaryClass { | 2406 class UnlinkedTypedef extends base.SummaryClass { |
| 2262 String _name; | 2407 String _name; |
| 2263 int _nameOffset; | 2408 int _nameOffset; |
| 2409 UnlinkedDocumentationComment _documentationComment; |
| 2264 List<UnlinkedTypeParam> _typeParameters; | 2410 List<UnlinkedTypeParam> _typeParameters; |
| 2265 UnlinkedTypeRef _returnType; | 2411 UnlinkedTypeRef _returnType; |
| 2266 List<UnlinkedParam> _parameters; | 2412 List<UnlinkedParam> _parameters; |
| 2267 | 2413 |
| 2268 UnlinkedTypedef.fromJson(Map json) | 2414 UnlinkedTypedef.fromJson(Map json) |
| 2269 : _name = json["name"], | 2415 : _name = json["name"], |
| 2270 _nameOffset = json["nameOffset"], | 2416 _nameOffset = json["nameOffset"], |
| 2417 _documentationComment = json["documentationComment"] == null ? null : new
UnlinkedDocumentationComment.fromJson(json["documentationComment"]), |
| 2271 _typeParameters = json["typeParameters"]?.map((x) => new UnlinkedTypeParam
.fromJson(x))?.toList(), | 2418 _typeParameters = json["typeParameters"]?.map((x) => new UnlinkedTypeParam
.fromJson(x))?.toList(), |
| 2272 _returnType = json["returnType"] == null ? null : new UnlinkedTypeRef.from
Json(json["returnType"]), | 2419 _returnType = json["returnType"] == null ? null : new UnlinkedTypeRef.from
Json(json["returnType"]), |
| 2273 _parameters = json["parameters"]?.map((x) => new UnlinkedParam.fromJson(x)
)?.toList(); | 2420 _parameters = json["parameters"]?.map((x) => new UnlinkedParam.fromJson(x)
)?.toList(); |
| 2274 | 2421 |
| 2275 @override | 2422 @override |
| 2276 Map<String, Object> toMap() => { | 2423 Map<String, Object> toMap() => { |
| 2277 "name": name, | 2424 "name": name, |
| 2278 "nameOffset": nameOffset, | 2425 "nameOffset": nameOffset, |
| 2426 "documentationComment": documentationComment, |
| 2279 "typeParameters": typeParameters, | 2427 "typeParameters": typeParameters, |
| 2280 "returnType": returnType, | 2428 "returnType": returnType, |
| 2281 "parameters": parameters, | 2429 "parameters": parameters, |
| 2282 }; | 2430 }; |
| 2283 | 2431 |
| 2284 /** | 2432 /** |
| 2285 * Name of the typedef. | 2433 * Name of the typedef. |
| 2286 */ | 2434 */ |
| 2287 String get name => _name ?? ''; | 2435 String get name => _name ?? ''; |
| 2288 | 2436 |
| 2289 /** | 2437 /** |
| 2290 * Offset of the typedef name relative to the beginning of the file. | 2438 * Offset of the typedef name relative to the beginning of the file. |
| 2291 */ | 2439 */ |
| 2292 int get nameOffset => _nameOffset ?? 0; | 2440 int get nameOffset => _nameOffset ?? 0; |
| 2293 | 2441 |
| 2294 /** | 2442 /** |
| 2443 * Documentation comment for the typedef, or `null` if there is no |
| 2444 * documentation comment. |
| 2445 */ |
| 2446 UnlinkedDocumentationComment get documentationComment => _documentationComment
; |
| 2447 |
| 2448 /** |
| 2295 * Type parameters of the typedef, if any. | 2449 * Type parameters of the typedef, if any. |
| 2296 */ | 2450 */ |
| 2297 List<UnlinkedTypeParam> get typeParameters => _typeParameters ?? const <Unlink
edTypeParam>[]; | 2451 List<UnlinkedTypeParam> get typeParameters => _typeParameters ?? const <Unlink
edTypeParam>[]; |
| 2298 | 2452 |
| 2299 /** | 2453 /** |
| 2300 * Return type of the typedef. Absent if the return type is `void`. | 2454 * Return type of the typedef. Absent if the return type is `void`. |
| 2301 */ | 2455 */ |
| 2302 UnlinkedTypeRef get returnType => _returnType; | 2456 UnlinkedTypeRef get returnType => _returnType; |
| 2303 | 2457 |
| 2304 /** | 2458 /** |
| (...skipping 25 matching lines...) Expand all Loading... |
| 2330 */ | 2484 */ |
| 2331 void set nameOffset(int _value) { | 2485 void set nameOffset(int _value) { |
| 2332 assert(!_finished); | 2486 assert(!_finished); |
| 2333 assert(!_json.containsKey("nameOffset")); | 2487 assert(!_json.containsKey("nameOffset")); |
| 2334 if (_value != null) { | 2488 if (_value != null) { |
| 2335 _json["nameOffset"] = _value; | 2489 _json["nameOffset"] = _value; |
| 2336 } | 2490 } |
| 2337 } | 2491 } |
| 2338 | 2492 |
| 2339 /** | 2493 /** |
| 2494 * Documentation comment for the typedef, or `null` if there is no |
| 2495 * documentation comment. |
| 2496 */ |
| 2497 void set documentationComment(UnlinkedDocumentationCommentBuilder _value) { |
| 2498 assert(!_finished); |
| 2499 assert(!_json.containsKey("documentationComment")); |
| 2500 if (_value != null) { |
| 2501 _json["documentationComment"] = _value.finish(); |
| 2502 } |
| 2503 } |
| 2504 |
| 2505 /** |
| 2340 * Type parameters of the typedef, if any. | 2506 * Type parameters of the typedef, if any. |
| 2341 */ | 2507 */ |
| 2342 void set typeParameters(List<UnlinkedTypeParamBuilder> _value) { | 2508 void set typeParameters(List<UnlinkedTypeParamBuilder> _value) { |
| 2343 assert(!_finished); | 2509 assert(!_finished); |
| 2344 assert(!_json.containsKey("typeParameters")); | 2510 assert(!_json.containsKey("typeParameters")); |
| 2345 if (!(_value == null || _value.isEmpty)) { | 2511 if (!(_value == null || _value.isEmpty)) { |
| 2346 _json["typeParameters"] = _value.map((b) => b.finish()).toList(); | 2512 _json["typeParameters"] = _value.map((b) => b.finish()).toList(); |
| 2347 } | 2513 } |
| 2348 } | 2514 } |
| 2349 | 2515 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 2369 } | 2535 } |
| 2370 } | 2536 } |
| 2371 | 2537 |
| 2372 Map finish() { | 2538 Map finish() { |
| 2373 assert(!_finished); | 2539 assert(!_finished); |
| 2374 _finished = true; | 2540 _finished = true; |
| 2375 return _json; | 2541 return _json; |
| 2376 } | 2542 } |
| 2377 } | 2543 } |
| 2378 | 2544 |
| 2379 UnlinkedTypedefBuilder encodeUnlinkedTypedef(base.BuilderContext builderContext,
{String name, int nameOffset, List<UnlinkedTypeParamBuilder> typeParameters, Un
linkedTypeRefBuilder returnType, List<UnlinkedParamBuilder> parameters}) { | 2545 UnlinkedTypedefBuilder encodeUnlinkedTypedef(base.BuilderContext builderContext,
{String name, int nameOffset, UnlinkedDocumentationCommentBuilder documentation
Comment, List<UnlinkedTypeParamBuilder> typeParameters, UnlinkedTypeRefBuilder r
eturnType, List<UnlinkedParamBuilder> parameters}) { |
| 2380 UnlinkedTypedefBuilder builder = new UnlinkedTypedefBuilder(builderContext); | 2546 UnlinkedTypedefBuilder builder = new UnlinkedTypedefBuilder(builderContext); |
| 2381 builder.name = name; | 2547 builder.name = name; |
| 2382 builder.nameOffset = nameOffset; | 2548 builder.nameOffset = nameOffset; |
| 2549 builder.documentationComment = documentationComment; |
| 2383 builder.typeParameters = typeParameters; | 2550 builder.typeParameters = typeParameters; |
| 2384 builder.returnType = returnType; | 2551 builder.returnType = returnType; |
| 2385 builder.parameters = parameters; | 2552 builder.parameters = parameters; |
| 2386 return builder; | 2553 return builder; |
| 2387 } | 2554 } |
| 2388 | 2555 |
| 2389 /** | 2556 /** |
| 2390 * Unlinked summary information about a type parameter declaration. | 2557 * Unlinked summary information about a type parameter declaration. |
| 2391 */ | 2558 */ |
| 2392 class UnlinkedTypeParam extends base.SummaryClass { | 2559 class UnlinkedTypeParam extends base.SummaryClass { |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2618 return builder; | 2785 return builder; |
| 2619 } | 2786 } |
| 2620 | 2787 |
| 2621 /** | 2788 /** |
| 2622 * Unlinked summary information about a compilation unit ("part file"). | 2789 * Unlinked summary information about a compilation unit ("part file"). |
| 2623 */ | 2790 */ |
| 2624 class UnlinkedUnit extends base.SummaryClass { | 2791 class UnlinkedUnit extends base.SummaryClass { |
| 2625 String _libraryName; | 2792 String _libraryName; |
| 2626 int _libraryNameOffset; | 2793 int _libraryNameOffset; |
| 2627 int _libraryNameLength; | 2794 int _libraryNameLength; |
| 2795 UnlinkedDocumentationComment _libraryDocumentationComment; |
| 2628 UnlinkedPublicNamespace _publicNamespace; | 2796 UnlinkedPublicNamespace _publicNamespace; |
| 2629 List<UnlinkedReference> _references; | 2797 List<UnlinkedReference> _references; |
| 2630 List<UnlinkedClass> _classes; | 2798 List<UnlinkedClass> _classes; |
| 2631 List<UnlinkedEnum> _enums; | 2799 List<UnlinkedEnum> _enums; |
| 2632 List<UnlinkedExecutable> _executables; | 2800 List<UnlinkedExecutable> _executables; |
| 2633 List<UnlinkedExportNonPublic> _exports; | 2801 List<UnlinkedExportNonPublic> _exports; |
| 2634 List<UnlinkedImport> _imports; | 2802 List<UnlinkedImport> _imports; |
| 2635 List<UnlinkedPart> _parts; | 2803 List<UnlinkedPart> _parts; |
| 2636 List<UnlinkedTypedef> _typedefs; | 2804 List<UnlinkedTypedef> _typedefs; |
| 2637 List<UnlinkedVariable> _variables; | 2805 List<UnlinkedVariable> _variables; |
| 2638 | 2806 |
| 2639 UnlinkedUnit.fromJson(Map json) | 2807 UnlinkedUnit.fromJson(Map json) |
| 2640 : _libraryName = json["libraryName"], | 2808 : _libraryName = json["libraryName"], |
| 2641 _libraryNameOffset = json["libraryNameOffset"], | 2809 _libraryNameOffset = json["libraryNameOffset"], |
| 2642 _libraryNameLength = json["libraryNameLength"], | 2810 _libraryNameLength = json["libraryNameLength"], |
| 2811 _libraryDocumentationComment = json["libraryDocumentationComment"] == null
? null : new UnlinkedDocumentationComment.fromJson(json["libraryDocumentationCo
mment"]), |
| 2643 _publicNamespace = json["publicNamespace"] == null ? null : new UnlinkedPu
blicNamespace.fromJson(json["publicNamespace"]), | 2812 _publicNamespace = json["publicNamespace"] == null ? null : new UnlinkedPu
blicNamespace.fromJson(json["publicNamespace"]), |
| 2644 _references = json["references"]?.map((x) => new UnlinkedReference.fromJso
n(x))?.toList(), | 2813 _references = json["references"]?.map((x) => new UnlinkedReference.fromJso
n(x))?.toList(), |
| 2645 _classes = json["classes"]?.map((x) => new UnlinkedClass.fromJson(x))?.toL
ist(), | 2814 _classes = json["classes"]?.map((x) => new UnlinkedClass.fromJson(x))?.toL
ist(), |
| 2646 _enums = json["enums"]?.map((x) => new UnlinkedEnum.fromJson(x))?.toList()
, | 2815 _enums = json["enums"]?.map((x) => new UnlinkedEnum.fromJson(x))?.toList()
, |
| 2647 _executables = json["executables"]?.map((x) => new UnlinkedExecutable.from
Json(x))?.toList(), | 2816 _executables = json["executables"]?.map((x) => new UnlinkedExecutable.from
Json(x))?.toList(), |
| 2648 _exports = json["exports"]?.map((x) => new UnlinkedExportNonPublic.fromJso
n(x))?.toList(), | 2817 _exports = json["exports"]?.map((x) => new UnlinkedExportNonPublic.fromJso
n(x))?.toList(), |
| 2649 _imports = json["imports"]?.map((x) => new UnlinkedImport.fromJson(x))?.to
List(), | 2818 _imports = json["imports"]?.map((x) => new UnlinkedImport.fromJson(x))?.to
List(), |
| 2650 _parts = json["parts"]?.map((x) => new UnlinkedPart.fromJson(x))?.toList()
, | 2819 _parts = json["parts"]?.map((x) => new UnlinkedPart.fromJson(x))?.toList()
, |
| 2651 _typedefs = json["typedefs"]?.map((x) => new UnlinkedTypedef.fromJson(x))?
.toList(), | 2820 _typedefs = json["typedefs"]?.map((x) => new UnlinkedTypedef.fromJson(x))?
.toList(), |
| 2652 _variables = json["variables"]?.map((x) => new UnlinkedVariable.fromJson(x
))?.toList(); | 2821 _variables = json["variables"]?.map((x) => new UnlinkedVariable.fromJson(x
))?.toList(); |
| 2653 | 2822 |
| 2654 @override | 2823 @override |
| 2655 Map<String, Object> toMap() => { | 2824 Map<String, Object> toMap() => { |
| 2656 "libraryName": libraryName, | 2825 "libraryName": libraryName, |
| 2657 "libraryNameOffset": libraryNameOffset, | 2826 "libraryNameOffset": libraryNameOffset, |
| 2658 "libraryNameLength": libraryNameLength, | 2827 "libraryNameLength": libraryNameLength, |
| 2828 "libraryDocumentationComment": libraryDocumentationComment, |
| 2659 "publicNamespace": publicNamespace, | 2829 "publicNamespace": publicNamespace, |
| 2660 "references": references, | 2830 "references": references, |
| 2661 "classes": classes, | 2831 "classes": classes, |
| 2662 "enums": enums, | 2832 "enums": enums, |
| 2663 "executables": executables, | 2833 "executables": executables, |
| 2664 "exports": exports, | 2834 "exports": exports, |
| 2665 "imports": imports, | 2835 "imports": imports, |
| 2666 "parts": parts, | 2836 "parts": parts, |
| 2667 "typedefs": typedefs, | 2837 "typedefs": typedefs, |
| 2668 "variables": variables, | 2838 "variables": variables, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 2681 */ | 2851 */ |
| 2682 int get libraryNameOffset => _libraryNameOffset ?? 0; | 2852 int get libraryNameOffset => _libraryNameOffset ?? 0; |
| 2683 | 2853 |
| 2684 /** | 2854 /** |
| 2685 * Length of the library name as it appears in the source code (or 0 if the | 2855 * Length of the library name as it appears in the source code (or 0 if the |
| 2686 * library has no name). | 2856 * library has no name). |
| 2687 */ | 2857 */ |
| 2688 int get libraryNameLength => _libraryNameLength ?? 0; | 2858 int get libraryNameLength => _libraryNameLength ?? 0; |
| 2689 | 2859 |
| 2690 /** | 2860 /** |
| 2861 * Documentation comment for the library, or `null` if there is no |
| 2862 * documentation comment. |
| 2863 */ |
| 2864 UnlinkedDocumentationComment get libraryDocumentationComment => _libraryDocume
ntationComment; |
| 2865 |
| 2866 /** |
| 2691 * Unlinked public namespace of this compilation unit. | 2867 * Unlinked public namespace of this compilation unit. |
| 2692 */ | 2868 */ |
| 2693 UnlinkedPublicNamespace get publicNamespace => _publicNamespace; | 2869 UnlinkedPublicNamespace get publicNamespace => _publicNamespace; |
| 2694 | 2870 |
| 2695 /** | 2871 /** |
| 2696 * Top level and prefixed names referred to by this compilation unit. The | 2872 * Top level and prefixed names referred to by this compilation unit. The |
| 2697 * zeroth element of this array is always populated and always represents a | 2873 * zeroth element of this array is always populated and always represents a |
| 2698 * reference to the pseudo-type "dynamic". | 2874 * reference to the pseudo-type "dynamic". |
| 2699 */ | 2875 */ |
| 2700 List<UnlinkedReference> get references => _references ?? const <UnlinkedRefere
nce>[]; | 2876 List<UnlinkedReference> get references => _references ?? const <UnlinkedRefere
nce>[]; |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2777 */ | 2953 */ |
| 2778 void set libraryNameLength(int _value) { | 2954 void set libraryNameLength(int _value) { |
| 2779 assert(!_finished); | 2955 assert(!_finished); |
| 2780 assert(!_json.containsKey("libraryNameLength")); | 2956 assert(!_json.containsKey("libraryNameLength")); |
| 2781 if (_value != null) { | 2957 if (_value != null) { |
| 2782 _json["libraryNameLength"] = _value; | 2958 _json["libraryNameLength"] = _value; |
| 2783 } | 2959 } |
| 2784 } | 2960 } |
| 2785 | 2961 |
| 2786 /** | 2962 /** |
| 2963 * Documentation comment for the library, or `null` if there is no |
| 2964 * documentation comment. |
| 2965 */ |
| 2966 void set libraryDocumentationComment(UnlinkedDocumentationCommentBuilder _valu
e) { |
| 2967 assert(!_finished); |
| 2968 assert(!_json.containsKey("libraryDocumentationComment")); |
| 2969 if (_value != null) { |
| 2970 _json["libraryDocumentationComment"] = _value.finish(); |
| 2971 } |
| 2972 } |
| 2973 |
| 2974 /** |
| 2787 * Unlinked public namespace of this compilation unit. | 2975 * Unlinked public namespace of this compilation unit. |
| 2788 */ | 2976 */ |
| 2789 void set publicNamespace(UnlinkedPublicNamespaceBuilder _value) { | 2977 void set publicNamespace(UnlinkedPublicNamespaceBuilder _value) { |
| 2790 assert(!_finished); | 2978 assert(!_finished); |
| 2791 assert(!_json.containsKey("publicNamespace")); | 2979 assert(!_json.containsKey("publicNamespace")); |
| 2792 if (_value != null) { | 2980 if (_value != null) { |
| 2793 _json["publicNamespace"] = _value.finish(); | 2981 _json["publicNamespace"] = _value.finish(); |
| 2794 } | 2982 } |
| 2795 } | 2983 } |
| 2796 | 2984 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2898 | 3086 |
| 2899 List<int> toBuffer() => UTF8.encode(JSON.encode(finish())); | 3087 List<int> toBuffer() => UTF8.encode(JSON.encode(finish())); |
| 2900 | 3088 |
| 2901 Map finish() { | 3089 Map finish() { |
| 2902 assert(!_finished); | 3090 assert(!_finished); |
| 2903 _finished = true; | 3091 _finished = true; |
| 2904 return _json; | 3092 return _json; |
| 2905 } | 3093 } |
| 2906 } | 3094 } |
| 2907 | 3095 |
| 2908 UnlinkedUnitBuilder encodeUnlinkedUnit(base.BuilderContext builderContext, {Stri
ng libraryName, int libraryNameOffset, int libraryNameLength, UnlinkedPublicName
spaceBuilder publicNamespace, List<UnlinkedReferenceBuilder> references, List<Un
linkedClassBuilder> classes, List<UnlinkedEnumBuilder> enums, List<UnlinkedExecu
tableBuilder> executables, List<UnlinkedExportNonPublicBuilder> exports, List<Un
linkedImportBuilder> imports, List<UnlinkedPartBuilder> parts, List<UnlinkedType
defBuilder> typedefs, List<UnlinkedVariableBuilder> variables}) { | 3096 UnlinkedUnitBuilder encodeUnlinkedUnit(base.BuilderContext builderContext, {Stri
ng libraryName, int libraryNameOffset, int libraryNameLength, UnlinkedDocumentat
ionCommentBuilder libraryDocumentationComment, UnlinkedPublicNamespaceBuilder pu
blicNamespace, List<UnlinkedReferenceBuilder> references, List<UnlinkedClassBuil
der> classes, List<UnlinkedEnumBuilder> enums, List<UnlinkedExecutableBuilder> e
xecutables, List<UnlinkedExportNonPublicBuilder> exports, List<UnlinkedImportBui
lder> imports, List<UnlinkedPartBuilder> parts, List<UnlinkedTypedefBuilder> typ
edefs, List<UnlinkedVariableBuilder> variables}) { |
| 2909 UnlinkedUnitBuilder builder = new UnlinkedUnitBuilder(builderContext); | 3097 UnlinkedUnitBuilder builder = new UnlinkedUnitBuilder(builderContext); |
| 2910 builder.libraryName = libraryName; | 3098 builder.libraryName = libraryName; |
| 2911 builder.libraryNameOffset = libraryNameOffset; | 3099 builder.libraryNameOffset = libraryNameOffset; |
| 2912 builder.libraryNameLength = libraryNameLength; | 3100 builder.libraryNameLength = libraryNameLength; |
| 3101 builder.libraryDocumentationComment = libraryDocumentationComment; |
| 2913 builder.publicNamespace = publicNamespace; | 3102 builder.publicNamespace = publicNamespace; |
| 2914 builder.references = references; | 3103 builder.references = references; |
| 2915 builder.classes = classes; | 3104 builder.classes = classes; |
| 2916 builder.enums = enums; | 3105 builder.enums = enums; |
| 2917 builder.executables = executables; | 3106 builder.executables = executables; |
| 2918 builder.exports = exports; | 3107 builder.exports = exports; |
| 2919 builder.imports = imports; | 3108 builder.imports = imports; |
| 2920 builder.parts = parts; | 3109 builder.parts = parts; |
| 2921 builder.typedefs = typedefs; | 3110 builder.typedefs = typedefs; |
| 2922 builder.variables = variables; | 3111 builder.variables = variables; |
| 2923 return builder; | 3112 return builder; |
| 2924 } | 3113 } |
| 2925 | 3114 |
| 2926 /** | 3115 /** |
| 2927 * Unlinked summary information about a top level variable, local variable, or | 3116 * Unlinked summary information about a top level variable, local variable, or |
| 2928 * a field. | 3117 * a field. |
| 2929 */ | 3118 */ |
| 2930 class UnlinkedVariable extends base.SummaryClass { | 3119 class UnlinkedVariable extends base.SummaryClass { |
| 2931 String _name; | 3120 String _name; |
| 2932 int _nameOffset; | 3121 int _nameOffset; |
| 3122 UnlinkedDocumentationComment _documentationComment; |
| 2933 UnlinkedTypeRef _type; | 3123 UnlinkedTypeRef _type; |
| 2934 bool _isStatic; | 3124 bool _isStatic; |
| 2935 bool _isFinal; | 3125 bool _isFinal; |
| 2936 bool _isConst; | 3126 bool _isConst; |
| 2937 bool _hasImplicitType; | 3127 bool _hasImplicitType; |
| 2938 | 3128 |
| 2939 UnlinkedVariable.fromJson(Map json) | 3129 UnlinkedVariable.fromJson(Map json) |
| 2940 : _name = json["name"], | 3130 : _name = json["name"], |
| 2941 _nameOffset = json["nameOffset"], | 3131 _nameOffset = json["nameOffset"], |
| 3132 _documentationComment = json["documentationComment"] == null ? null : new
UnlinkedDocumentationComment.fromJson(json["documentationComment"]), |
| 2942 _type = json["type"] == null ? null : new UnlinkedTypeRef.fromJson(json["t
ype"]), | 3133 _type = json["type"] == null ? null : new UnlinkedTypeRef.fromJson(json["t
ype"]), |
| 2943 _isStatic = json["isStatic"], | 3134 _isStatic = json["isStatic"], |
| 2944 _isFinal = json["isFinal"], | 3135 _isFinal = json["isFinal"], |
| 2945 _isConst = json["isConst"], | 3136 _isConst = json["isConst"], |
| 2946 _hasImplicitType = json["hasImplicitType"]; | 3137 _hasImplicitType = json["hasImplicitType"]; |
| 2947 | 3138 |
| 2948 @override | 3139 @override |
| 2949 Map<String, Object> toMap() => { | 3140 Map<String, Object> toMap() => { |
| 2950 "name": name, | 3141 "name": name, |
| 2951 "nameOffset": nameOffset, | 3142 "nameOffset": nameOffset, |
| 3143 "documentationComment": documentationComment, |
| 2952 "type": type, | 3144 "type": type, |
| 2953 "isStatic": isStatic, | 3145 "isStatic": isStatic, |
| 2954 "isFinal": isFinal, | 3146 "isFinal": isFinal, |
| 2955 "isConst": isConst, | 3147 "isConst": isConst, |
| 2956 "hasImplicitType": hasImplicitType, | 3148 "hasImplicitType": hasImplicitType, |
| 2957 }; | 3149 }; |
| 2958 | 3150 |
| 2959 /** | 3151 /** |
| 2960 * Name of the variable. | 3152 * Name of the variable. |
| 2961 */ | 3153 */ |
| 2962 String get name => _name ?? ''; | 3154 String get name => _name ?? ''; |
| 2963 | 3155 |
| 2964 /** | 3156 /** |
| 2965 * Offset of the variable name relative to the beginning of the file. | 3157 * Offset of the variable name relative to the beginning of the file. |
| 2966 */ | 3158 */ |
| 2967 int get nameOffset => _nameOffset ?? 0; | 3159 int get nameOffset => _nameOffset ?? 0; |
| 2968 | 3160 |
| 2969 /** | 3161 /** |
| 3162 * Documentation comment for the variable, or `null` if there is no |
| 3163 * documentation comment. |
| 3164 */ |
| 3165 UnlinkedDocumentationComment get documentationComment => _documentationComment
; |
| 3166 |
| 3167 /** |
| 2970 * Declared type of the variable. Note that when strong mode is enabled, the | 3168 * Declared type of the variable. Note that when strong mode is enabled, the |
| 2971 * actual type of the variable may be different due to type inference. | 3169 * actual type of the variable may be different due to type inference. |
| 2972 */ | 3170 */ |
| 2973 UnlinkedTypeRef get type => _type; | 3171 UnlinkedTypeRef get type => _type; |
| 2974 | 3172 |
| 2975 /** | 3173 /** |
| 2976 * Indicates whether the variable is declared using the `static` keyword. | 3174 * Indicates whether the variable is declared using the `static` keyword. |
| 2977 * | 3175 * |
| 2978 * Note that for top level variables, this flag is false, since they are not | 3176 * Note that for top level variables, this flag is false, since they are not |
| 2979 * declared using the `static` keyword (even though they are considered | 3177 * declared using the `static` keyword (even though they are considered |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3020 */ | 3218 */ |
| 3021 void set nameOffset(int _value) { | 3219 void set nameOffset(int _value) { |
| 3022 assert(!_finished); | 3220 assert(!_finished); |
| 3023 assert(!_json.containsKey("nameOffset")); | 3221 assert(!_json.containsKey("nameOffset")); |
| 3024 if (_value != null) { | 3222 if (_value != null) { |
| 3025 _json["nameOffset"] = _value; | 3223 _json["nameOffset"] = _value; |
| 3026 } | 3224 } |
| 3027 } | 3225 } |
| 3028 | 3226 |
| 3029 /** | 3227 /** |
| 3228 * Documentation comment for the variable, or `null` if there is no |
| 3229 * documentation comment. |
| 3230 */ |
| 3231 void set documentationComment(UnlinkedDocumentationCommentBuilder _value) { |
| 3232 assert(!_finished); |
| 3233 assert(!_json.containsKey("documentationComment")); |
| 3234 if (_value != null) { |
| 3235 _json["documentationComment"] = _value.finish(); |
| 3236 } |
| 3237 } |
| 3238 |
| 3239 /** |
| 3030 * Declared type of the variable. Note that when strong mode is enabled, the | 3240 * Declared type of the variable. Note that when strong mode is enabled, the |
| 3031 * actual type of the variable may be different due to type inference. | 3241 * actual type of the variable may be different due to type inference. |
| 3032 */ | 3242 */ |
| 3033 void set type(UnlinkedTypeRefBuilder _value) { | 3243 void set type(UnlinkedTypeRefBuilder _value) { |
| 3034 assert(!_finished); | 3244 assert(!_finished); |
| 3035 assert(!_json.containsKey("type")); | 3245 assert(!_json.containsKey("type")); |
| 3036 if (_value != null) { | 3246 if (_value != null) { |
| 3037 _json["type"] = _value.finish(); | 3247 _json["type"] = _value.finish(); |
| 3038 } | 3248 } |
| 3039 } | 3249 } |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3086 } | 3296 } |
| 3087 } | 3297 } |
| 3088 | 3298 |
| 3089 Map finish() { | 3299 Map finish() { |
| 3090 assert(!_finished); | 3300 assert(!_finished); |
| 3091 _finished = true; | 3301 _finished = true; |
| 3092 return _json; | 3302 return _json; |
| 3093 } | 3303 } |
| 3094 } | 3304 } |
| 3095 | 3305 |
| 3096 UnlinkedVariableBuilder encodeUnlinkedVariable(base.BuilderContext builderContex
t, {String name, int nameOffset, UnlinkedTypeRefBuilder type, bool isStatic, boo
l isFinal, bool isConst, bool hasImplicitType}) { | 3306 UnlinkedVariableBuilder encodeUnlinkedVariable(base.BuilderContext builderContex
t, {String name, int nameOffset, UnlinkedDocumentationCommentBuilder documentati
onComment, UnlinkedTypeRefBuilder type, bool isStatic, bool isFinal, bool isCons
t, bool hasImplicitType}) { |
| 3097 UnlinkedVariableBuilder builder = new UnlinkedVariableBuilder(builderContext); | 3307 UnlinkedVariableBuilder builder = new UnlinkedVariableBuilder(builderContext); |
| 3098 builder.name = name; | 3308 builder.name = name; |
| 3099 builder.nameOffset = nameOffset; | 3309 builder.nameOffset = nameOffset; |
| 3310 builder.documentationComment = documentationComment; |
| 3100 builder.type = type; | 3311 builder.type = type; |
| 3101 builder.isStatic = isStatic; | 3312 builder.isStatic = isStatic; |
| 3102 builder.isFinal = isFinal; | 3313 builder.isFinal = isFinal; |
| 3103 builder.isConst = isConst; | 3314 builder.isConst = isConst; |
| 3104 builder.hasImplicitType = hasImplicitType; | 3315 builder.hasImplicitType = hasImplicitType; |
| 3105 return builder; | 3316 return builder; |
| 3106 } | 3317 } |
| 3107 | 3318 |
| OLD | NEW |