| 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 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 builder.unlinkedUnitUris = unlinkedUnitUris; | 503 builder.unlinkedUnitUris = unlinkedUnitUris; |
| 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 List<UnlinkedTypeParam> _typeParameters; | 514 List<UnlinkedTypeParam> _typeParameters; |
| 514 UnlinkedTypeRef _supertype; | 515 UnlinkedTypeRef _supertype; |
| 515 List<UnlinkedTypeRef> _mixins; | 516 List<UnlinkedTypeRef> _mixins; |
| 516 List<UnlinkedTypeRef> _interfaces; | 517 List<UnlinkedTypeRef> _interfaces; |
| 517 List<UnlinkedVariable> _fields; | 518 List<UnlinkedVariable> _fields; |
| 518 List<UnlinkedExecutable> _executables; | 519 List<UnlinkedExecutable> _executables; |
| 519 bool _isAbstract; | 520 bool _isAbstract; |
| 520 bool _isMixinApplication; | 521 bool _isMixinApplication; |
| 521 bool _hasNoSupertype; | 522 bool _hasNoSupertype; |
| 522 | 523 |
| 523 UnlinkedClass.fromJson(Map json) | 524 UnlinkedClass.fromJson(Map json) |
| 524 : _name = json["name"], | 525 : _name = json["name"], |
| 526 _nameOffset = json["nameOffset"], |
| 525 _typeParameters = json["typeParameters"]?.map((x) => new UnlinkedTypeParam
.fromJson(x))?.toList(), | 527 _typeParameters = json["typeParameters"]?.map((x) => new UnlinkedTypeParam
.fromJson(x))?.toList(), |
| 526 _supertype = json["supertype"] == null ? null : new UnlinkedTypeRef.fromJs
on(json["supertype"]), | 528 _supertype = json["supertype"] == null ? null : new UnlinkedTypeRef.fromJs
on(json["supertype"]), |
| 527 _mixins = json["mixins"]?.map((x) => new UnlinkedTypeRef.fromJson(x))?.toL
ist(), | 529 _mixins = json["mixins"]?.map((x) => new UnlinkedTypeRef.fromJson(x))?.toL
ist(), |
| 528 _interfaces = json["interfaces"]?.map((x) => new UnlinkedTypeRef.fromJson(
x))?.toList(), | 530 _interfaces = json["interfaces"]?.map((x) => new UnlinkedTypeRef.fromJson(
x))?.toList(), |
| 529 _fields = json["fields"]?.map((x) => new UnlinkedVariable.fromJson(x))?.to
List(), | 531 _fields = json["fields"]?.map((x) => new UnlinkedVariable.fromJson(x))?.to
List(), |
| 530 _executables = json["executables"]?.map((x) => new UnlinkedExecutable.from
Json(x))?.toList(), | 532 _executables = json["executables"]?.map((x) => new UnlinkedExecutable.from
Json(x))?.toList(), |
| 531 _isAbstract = json["isAbstract"], | 533 _isAbstract = json["isAbstract"], |
| 532 _isMixinApplication = json["isMixinApplication"], | 534 _isMixinApplication = json["isMixinApplication"], |
| 533 _hasNoSupertype = json["hasNoSupertype"]; | 535 _hasNoSupertype = json["hasNoSupertype"]; |
| 534 | 536 |
| 535 @override | 537 @override |
| 536 Map<String, Object> toMap() => { | 538 Map<String, Object> toMap() => { |
| 537 "name": name, | 539 "name": name, |
| 540 "nameOffset": nameOffset, |
| 538 "typeParameters": typeParameters, | 541 "typeParameters": typeParameters, |
| 539 "supertype": supertype, | 542 "supertype": supertype, |
| 540 "mixins": mixins, | 543 "mixins": mixins, |
| 541 "interfaces": interfaces, | 544 "interfaces": interfaces, |
| 542 "fields": fields, | 545 "fields": fields, |
| 543 "executables": executables, | 546 "executables": executables, |
| 544 "isAbstract": isAbstract, | 547 "isAbstract": isAbstract, |
| 545 "isMixinApplication": isMixinApplication, | 548 "isMixinApplication": isMixinApplication, |
| 546 "hasNoSupertype": hasNoSupertype, | 549 "hasNoSupertype": hasNoSupertype, |
| 547 }; | 550 }; |
| 548 | 551 |
| 549 /** | 552 /** |
| 550 * Name of the class. | 553 * Name of the class. |
| 551 */ | 554 */ |
| 552 String get name => _name ?? ''; | 555 String get name => _name ?? ''; |
| 553 | 556 |
| 554 /** | 557 /** |
| 558 * Offset of the class name relative to the beginning of the file. |
| 559 */ |
| 560 int get nameOffset => _nameOffset ?? 0; |
| 561 |
| 562 /** |
| 555 * Type parameters of the class, if any. | 563 * Type parameters of the class, if any. |
| 556 */ | 564 */ |
| 557 List<UnlinkedTypeParam> get typeParameters => _typeParameters ?? const <Unlink
edTypeParam>[]; | 565 List<UnlinkedTypeParam> get typeParameters => _typeParameters ?? const <Unlink
edTypeParam>[]; |
| 558 | 566 |
| 559 /** | 567 /** |
| 560 * Supertype of the class, or `null` if either (a) the class doesn't | 568 * Supertype of the class, or `null` if either (a) the class doesn't |
| 561 * explicitly declare a supertype (and hence has supertype `Object`), or (b) | 569 * explicitly declare a supertype (and hence has supertype `Object`), or (b) |
| 562 * the class *is* `Object` (and hence has no supertype). | 570 * the class *is* `Object` (and hence has no supertype). |
| 563 */ | 571 */ |
| 564 UnlinkedTypeRef get supertype => _supertype; | 572 UnlinkedTypeRef get supertype => _supertype; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 612 */ | 620 */ |
| 613 void set name(String _value) { | 621 void set name(String _value) { |
| 614 assert(!_finished); | 622 assert(!_finished); |
| 615 assert(!_json.containsKey("name")); | 623 assert(!_json.containsKey("name")); |
| 616 if (_value != null) { | 624 if (_value != null) { |
| 617 _json["name"] = _value; | 625 _json["name"] = _value; |
| 618 } | 626 } |
| 619 } | 627 } |
| 620 | 628 |
| 621 /** | 629 /** |
| 630 * Offset of the class name relative to the beginning of the file. |
| 631 */ |
| 632 void set nameOffset(int _value) { |
| 633 assert(!_finished); |
| 634 assert(!_json.containsKey("nameOffset")); |
| 635 if (_value != null) { |
| 636 _json["nameOffset"] = _value; |
| 637 } |
| 638 } |
| 639 |
| 640 /** |
| 622 * Type parameters of the class, if any. | 641 * Type parameters of the class, if any. |
| 623 */ | 642 */ |
| 624 void set typeParameters(List<UnlinkedTypeParamBuilder> _value) { | 643 void set typeParameters(List<UnlinkedTypeParamBuilder> _value) { |
| 625 assert(!_finished); | 644 assert(!_finished); |
| 626 assert(!_json.containsKey("typeParameters")); | 645 assert(!_json.containsKey("typeParameters")); |
| 627 if (!(_value == null || _value.isEmpty)) { | 646 if (!(_value == null || _value.isEmpty)) { |
| 628 _json["typeParameters"] = _value.map((b) => b.finish()).toList(); | 647 _json["typeParameters"] = _value.map((b) => b.finish()).toList(); |
| 629 } | 648 } |
| 630 } | 649 } |
| 631 | 650 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 720 } | 739 } |
| 721 } | 740 } |
| 722 | 741 |
| 723 Map finish() { | 742 Map finish() { |
| 724 assert(!_finished); | 743 assert(!_finished); |
| 725 _finished = true; | 744 _finished = true; |
| 726 return _json; | 745 return _json; |
| 727 } | 746 } |
| 728 } | 747 } |
| 729 | 748 |
| 730 UnlinkedClassBuilder encodeUnlinkedClass(base.BuilderContext builderContext, {St
ring name, List<UnlinkedTypeParamBuilder> typeParameters, UnlinkedTypeRefBuilder
supertype, List<UnlinkedTypeRefBuilder> mixins, List<UnlinkedTypeRefBuilder> in
terfaces, List<UnlinkedVariableBuilder> fields, List<UnlinkedExecutableBuilder>
executables, bool isAbstract, bool isMixinApplication, bool hasNoSupertype}) { | 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}) { |
| 731 UnlinkedClassBuilder builder = new UnlinkedClassBuilder(builderContext); | 750 UnlinkedClassBuilder builder = new UnlinkedClassBuilder(builderContext); |
| 732 builder.name = name; | 751 builder.name = name; |
| 752 builder.nameOffset = nameOffset; |
| 733 builder.typeParameters = typeParameters; | 753 builder.typeParameters = typeParameters; |
| 734 builder.supertype = supertype; | 754 builder.supertype = supertype; |
| 735 builder.mixins = mixins; | 755 builder.mixins = mixins; |
| 736 builder.interfaces = interfaces; | 756 builder.interfaces = interfaces; |
| 737 builder.fields = fields; | 757 builder.fields = fields; |
| 738 builder.executables = executables; | 758 builder.executables = executables; |
| 739 builder.isAbstract = isAbstract; | 759 builder.isAbstract = isAbstract; |
| 740 builder.isMixinApplication = isMixinApplication; | 760 builder.isMixinApplication = isMixinApplication; |
| 741 builder.hasNoSupertype = hasNoSupertype; | 761 builder.hasNoSupertype = hasNoSupertype; |
| 742 return builder; | 762 return builder; |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 812 builder.shows = shows; | 832 builder.shows = shows; |
| 813 builder.hides = hides; | 833 builder.hides = hides; |
| 814 return builder; | 834 return builder; |
| 815 } | 835 } |
| 816 | 836 |
| 817 /** | 837 /** |
| 818 * Unlinked summary information about an enum declaration. | 838 * Unlinked summary information about an enum declaration. |
| 819 */ | 839 */ |
| 820 class UnlinkedEnum extends base.SummaryClass { | 840 class UnlinkedEnum extends base.SummaryClass { |
| 821 String _name; | 841 String _name; |
| 842 int _nameOffset; |
| 822 List<UnlinkedEnumValue> _values; | 843 List<UnlinkedEnumValue> _values; |
| 823 | 844 |
| 824 UnlinkedEnum.fromJson(Map json) | 845 UnlinkedEnum.fromJson(Map json) |
| 825 : _name = json["name"], | 846 : _name = json["name"], |
| 847 _nameOffset = json["nameOffset"], |
| 826 _values = json["values"]?.map((x) => new UnlinkedEnumValue.fromJson(x))?.t
oList(); | 848 _values = json["values"]?.map((x) => new UnlinkedEnumValue.fromJson(x))?.t
oList(); |
| 827 | 849 |
| 828 @override | 850 @override |
| 829 Map<String, Object> toMap() => { | 851 Map<String, Object> toMap() => { |
| 830 "name": name, | 852 "name": name, |
| 853 "nameOffset": nameOffset, |
| 831 "values": values, | 854 "values": values, |
| 832 }; | 855 }; |
| 833 | 856 |
| 834 /** | 857 /** |
| 835 * Name of the enum type. | 858 * Name of the enum type. |
| 836 */ | 859 */ |
| 837 String get name => _name ?? ''; | 860 String get name => _name ?? ''; |
| 838 | 861 |
| 839 /** | 862 /** |
| 863 * Offset of the enum name relative to the beginning of the file. |
| 864 */ |
| 865 int get nameOffset => _nameOffset ?? 0; |
| 866 |
| 867 /** |
| 840 * Values listed in the enum declaration, in declaration order. | 868 * Values listed in the enum declaration, in declaration order. |
| 841 */ | 869 */ |
| 842 List<UnlinkedEnumValue> get values => _values ?? const <UnlinkedEnumValue>[]; | 870 List<UnlinkedEnumValue> get values => _values ?? const <UnlinkedEnumValue>[]; |
| 843 } | 871 } |
| 844 | 872 |
| 845 class UnlinkedEnumBuilder { | 873 class UnlinkedEnumBuilder { |
| 846 final Map _json = {}; | 874 final Map _json = {}; |
| 847 | 875 |
| 848 bool _finished = false; | 876 bool _finished = false; |
| 849 | 877 |
| 850 UnlinkedEnumBuilder(base.BuilderContext context); | 878 UnlinkedEnumBuilder(base.BuilderContext context); |
| 851 | 879 |
| 852 /** | 880 /** |
| 853 * Name of the enum type. | 881 * Name of the enum type. |
| 854 */ | 882 */ |
| 855 void set name(String _value) { | 883 void set name(String _value) { |
| 856 assert(!_finished); | 884 assert(!_finished); |
| 857 assert(!_json.containsKey("name")); | 885 assert(!_json.containsKey("name")); |
| 858 if (_value != null) { | 886 if (_value != null) { |
| 859 _json["name"] = _value; | 887 _json["name"] = _value; |
| 860 } | 888 } |
| 861 } | 889 } |
| 862 | 890 |
| 863 /** | 891 /** |
| 892 * Offset of the enum name relative to the beginning of the file. |
| 893 */ |
| 894 void set nameOffset(int _value) { |
| 895 assert(!_finished); |
| 896 assert(!_json.containsKey("nameOffset")); |
| 897 if (_value != null) { |
| 898 _json["nameOffset"] = _value; |
| 899 } |
| 900 } |
| 901 |
| 902 /** |
| 864 * Values listed in the enum declaration, in declaration order. | 903 * Values listed in the enum declaration, in declaration order. |
| 865 */ | 904 */ |
| 866 void set values(List<UnlinkedEnumValueBuilder> _value) { | 905 void set values(List<UnlinkedEnumValueBuilder> _value) { |
| 867 assert(!_finished); | 906 assert(!_finished); |
| 868 assert(!_json.containsKey("values")); | 907 assert(!_json.containsKey("values")); |
| 869 if (!(_value == null || _value.isEmpty)) { | 908 if (!(_value == null || _value.isEmpty)) { |
| 870 _json["values"] = _value.map((b) => b.finish()).toList(); | 909 _json["values"] = _value.map((b) => b.finish()).toList(); |
| 871 } | 910 } |
| 872 } | 911 } |
| 873 | 912 |
| 874 Map finish() { | 913 Map finish() { |
| 875 assert(!_finished); | 914 assert(!_finished); |
| 876 _finished = true; | 915 _finished = true; |
| 877 return _json; | 916 return _json; |
| 878 } | 917 } |
| 879 } | 918 } |
| 880 | 919 |
| 881 UnlinkedEnumBuilder encodeUnlinkedEnum(base.BuilderContext builderContext, {Stri
ng name, List<UnlinkedEnumValueBuilder> values}) { | 920 UnlinkedEnumBuilder encodeUnlinkedEnum(base.BuilderContext builderContext, {Stri
ng name, int nameOffset, List<UnlinkedEnumValueBuilder> values}) { |
| 882 UnlinkedEnumBuilder builder = new UnlinkedEnumBuilder(builderContext); | 921 UnlinkedEnumBuilder builder = new UnlinkedEnumBuilder(builderContext); |
| 883 builder.name = name; | 922 builder.name = name; |
| 923 builder.nameOffset = nameOffset; |
| 884 builder.values = values; | 924 builder.values = values; |
| 885 return builder; | 925 return builder; |
| 886 } | 926 } |
| 887 | 927 |
| 888 /** | 928 /** |
| 889 * Unlinked summary information about a single enumerated value in an enum | 929 * Unlinked summary information about a single enumerated value in an enum |
| 890 * declaration. | 930 * declaration. |
| 891 */ | 931 */ |
| 892 class UnlinkedEnumValue extends base.SummaryClass { | 932 class UnlinkedEnumValue extends base.SummaryClass { |
| 893 String _name; | 933 String _name; |
| 934 int _nameOffset; |
| 894 | 935 |
| 895 UnlinkedEnumValue.fromJson(Map json) | 936 UnlinkedEnumValue.fromJson(Map json) |
| 896 : _name = json["name"]; | 937 : _name = json["name"], |
| 938 _nameOffset = json["nameOffset"]; |
| 897 | 939 |
| 898 @override | 940 @override |
| 899 Map<String, Object> toMap() => { | 941 Map<String, Object> toMap() => { |
| 900 "name": name, | 942 "name": name, |
| 943 "nameOffset": nameOffset, |
| 901 }; | 944 }; |
| 902 | 945 |
| 903 /** | 946 /** |
| 904 * Name of the enumerated value. | 947 * Name of the enumerated value. |
| 905 */ | 948 */ |
| 906 String get name => _name ?? ''; | 949 String get name => _name ?? ''; |
| 950 |
| 951 /** |
| 952 * Offset of the enum value name relative to the beginning of the file. |
| 953 */ |
| 954 int get nameOffset => _nameOffset ?? 0; |
| 907 } | 955 } |
| 908 | 956 |
| 909 class UnlinkedEnumValueBuilder { | 957 class UnlinkedEnumValueBuilder { |
| 910 final Map _json = {}; | 958 final Map _json = {}; |
| 911 | 959 |
| 912 bool _finished = false; | 960 bool _finished = false; |
| 913 | 961 |
| 914 UnlinkedEnumValueBuilder(base.BuilderContext context); | 962 UnlinkedEnumValueBuilder(base.BuilderContext context); |
| 915 | 963 |
| 916 /** | 964 /** |
| 917 * Name of the enumerated value. | 965 * Name of the enumerated value. |
| 918 */ | 966 */ |
| 919 void set name(String _value) { | 967 void set name(String _value) { |
| 920 assert(!_finished); | 968 assert(!_finished); |
| 921 assert(!_json.containsKey("name")); | 969 assert(!_json.containsKey("name")); |
| 922 if (_value != null) { | 970 if (_value != null) { |
| 923 _json["name"] = _value; | 971 _json["name"] = _value; |
| 924 } | 972 } |
| 925 } | 973 } |
| 926 | 974 |
| 975 /** |
| 976 * Offset of the enum value name relative to the beginning of the file. |
| 977 */ |
| 978 void set nameOffset(int _value) { |
| 979 assert(!_finished); |
| 980 assert(!_json.containsKey("nameOffset")); |
| 981 if (_value != null) { |
| 982 _json["nameOffset"] = _value; |
| 983 } |
| 984 } |
| 985 |
| 927 Map finish() { | 986 Map finish() { |
| 928 assert(!_finished); | 987 assert(!_finished); |
| 929 _finished = true; | 988 _finished = true; |
| 930 return _json; | 989 return _json; |
| 931 } | 990 } |
| 932 } | 991 } |
| 933 | 992 |
| 934 UnlinkedEnumValueBuilder encodeUnlinkedEnumValue(base.BuilderContext builderCont
ext, {String name}) { | 993 UnlinkedEnumValueBuilder encodeUnlinkedEnumValue(base.BuilderContext builderCont
ext, {String name, int nameOffset}) { |
| 935 UnlinkedEnumValueBuilder builder = new UnlinkedEnumValueBuilder(builderContext
); | 994 UnlinkedEnumValueBuilder builder = new UnlinkedEnumValueBuilder(builderContext
); |
| 936 builder.name = name; | 995 builder.name = name; |
| 996 builder.nameOffset = nameOffset; |
| 937 return builder; | 997 return builder; |
| 938 } | 998 } |
| 939 | 999 |
| 940 /** | 1000 /** |
| 941 * Unlinked summary information about a function, method, getter, or setter | 1001 * Unlinked summary information about a function, method, getter, or setter |
| 942 * declaration. | 1002 * declaration. |
| 943 */ | 1003 */ |
| 944 class UnlinkedExecutable extends base.SummaryClass { | 1004 class UnlinkedExecutable extends base.SummaryClass { |
| 945 String _name; | 1005 String _name; |
| 1006 int _nameOffset; |
| 946 List<UnlinkedTypeParam> _typeParameters; | 1007 List<UnlinkedTypeParam> _typeParameters; |
| 947 UnlinkedTypeRef _returnType; | 1008 UnlinkedTypeRef _returnType; |
| 948 List<UnlinkedParam> _parameters; | 1009 List<UnlinkedParam> _parameters; |
| 949 UnlinkedExecutableKind _kind; | 1010 UnlinkedExecutableKind _kind; |
| 950 bool _isAbstract; | 1011 bool _isAbstract; |
| 951 bool _isStatic; | 1012 bool _isStatic; |
| 952 bool _isConst; | 1013 bool _isConst; |
| 953 bool _isFactory; | 1014 bool _isFactory; |
| 954 bool _hasImplicitReturnType; | 1015 bool _hasImplicitReturnType; |
| 955 bool _isExternal; | 1016 bool _isExternal; |
| 956 | 1017 |
| 957 UnlinkedExecutable.fromJson(Map json) | 1018 UnlinkedExecutable.fromJson(Map json) |
| 958 : _name = json["name"], | 1019 : _name = json["name"], |
| 1020 _nameOffset = json["nameOffset"], |
| 959 _typeParameters = json["typeParameters"]?.map((x) => new UnlinkedTypeParam
.fromJson(x))?.toList(), | 1021 _typeParameters = json["typeParameters"]?.map((x) => new UnlinkedTypeParam
.fromJson(x))?.toList(), |
| 960 _returnType = json["returnType"] == null ? null : new UnlinkedTypeRef.from
Json(json["returnType"]), | 1022 _returnType = json["returnType"] == null ? null : new UnlinkedTypeRef.from
Json(json["returnType"]), |
| 961 _parameters = json["parameters"]?.map((x) => new UnlinkedParam.fromJson(x)
)?.toList(), | 1023 _parameters = json["parameters"]?.map((x) => new UnlinkedParam.fromJson(x)
)?.toList(), |
| 962 _kind = json["kind"] == null ? null : UnlinkedExecutableKind.values[json["
kind"]], | 1024 _kind = json["kind"] == null ? null : UnlinkedExecutableKind.values[json["
kind"]], |
| 963 _isAbstract = json["isAbstract"], | 1025 _isAbstract = json["isAbstract"], |
| 964 _isStatic = json["isStatic"], | 1026 _isStatic = json["isStatic"], |
| 965 _isConst = json["isConst"], | 1027 _isConst = json["isConst"], |
| 966 _isFactory = json["isFactory"], | 1028 _isFactory = json["isFactory"], |
| 967 _hasImplicitReturnType = json["hasImplicitReturnType"], | 1029 _hasImplicitReturnType = json["hasImplicitReturnType"], |
| 968 _isExternal = json["isExternal"]; | 1030 _isExternal = json["isExternal"]; |
| 969 | 1031 |
| 970 @override | 1032 @override |
| 971 Map<String, Object> toMap() => { | 1033 Map<String, Object> toMap() => { |
| 972 "name": name, | 1034 "name": name, |
| 1035 "nameOffset": nameOffset, |
| 973 "typeParameters": typeParameters, | 1036 "typeParameters": typeParameters, |
| 974 "returnType": returnType, | 1037 "returnType": returnType, |
| 975 "parameters": parameters, | 1038 "parameters": parameters, |
| 976 "kind": kind, | 1039 "kind": kind, |
| 977 "isAbstract": isAbstract, | 1040 "isAbstract": isAbstract, |
| 978 "isStatic": isStatic, | 1041 "isStatic": isStatic, |
| 979 "isConst": isConst, | 1042 "isConst": isConst, |
| 980 "isFactory": isFactory, | 1043 "isFactory": isFactory, |
| 981 "hasImplicitReturnType": hasImplicitReturnType, | 1044 "hasImplicitReturnType": hasImplicitReturnType, |
| 982 "isExternal": isExternal, | 1045 "isExternal": isExternal, |
| 983 }; | 1046 }; |
| 984 | 1047 |
| 985 /** | 1048 /** |
| 986 * Name of the executable. For setters, this includes the trailing "=". For | 1049 * Name of the executable. For setters, this includes the trailing "=". For |
| 987 * named constructors, this excludes the class name and excludes the ".". | 1050 * named constructors, this excludes the class name and excludes the ".". |
| 988 * For unnamed constructors, this is the empty string. | 1051 * For unnamed constructors, this is the empty string. |
| 989 */ | 1052 */ |
| 990 String get name => _name ?? ''; | 1053 String get name => _name ?? ''; |
| 991 | 1054 |
| 992 /** | 1055 /** |
| 1056 * Offset of the executable name relative to the beginning of the file. For |
| 1057 * 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 |
| 1059 * offset of the second "C" in "class C { C(); }"). |
| 1060 */ |
| 1061 int get nameOffset => _nameOffset ?? 0; |
| 1062 |
| 1063 /** |
| 993 * Type parameters of the executable, if any. Empty if support for generic | 1064 * Type parameters of the executable, if any. Empty if support for generic |
| 994 * method syntax is disabled. | 1065 * method syntax is disabled. |
| 995 */ | 1066 */ |
| 996 List<UnlinkedTypeParam> get typeParameters => _typeParameters ?? const <Unlink
edTypeParam>[]; | 1067 List<UnlinkedTypeParam> get typeParameters => _typeParameters ?? const <Unlink
edTypeParam>[]; |
| 997 | 1068 |
| 998 /** | 1069 /** |
| 999 * Declared return type of the executable. Absent if the return type is | 1070 * Declared return type of the executable. Absent if the return type is |
| 1000 * `void` or the executable is a constructor. Note that when strong mode is | 1071 * `void` or the executable is a constructor. Note that when strong mode is |
| 1001 * enabled, the actual return type may be different due to type inference. | 1072 * enabled, the actual return type may be different due to type inference. |
| 1002 */ | 1073 */ |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1065 */ | 1136 */ |
| 1066 void set name(String _value) { | 1137 void set name(String _value) { |
| 1067 assert(!_finished); | 1138 assert(!_finished); |
| 1068 assert(!_json.containsKey("name")); | 1139 assert(!_json.containsKey("name")); |
| 1069 if (_value != null) { | 1140 if (_value != null) { |
| 1070 _json["name"] = _value; | 1141 _json["name"] = _value; |
| 1071 } | 1142 } |
| 1072 } | 1143 } |
| 1073 | 1144 |
| 1074 /** | 1145 /** |
| 1146 * Offset of the executable name relative to the beginning of the file. For |
| 1147 * named constructors, this excludes the class name and excludes the ".". |
| 1148 * For unnamed constructors, this is the offset of the class name (i.e. the |
| 1149 * offset of the second "C" in "class C { C(); }"). |
| 1150 */ |
| 1151 void set nameOffset(int _value) { |
| 1152 assert(!_finished); |
| 1153 assert(!_json.containsKey("nameOffset")); |
| 1154 if (_value != null) { |
| 1155 _json["nameOffset"] = _value; |
| 1156 } |
| 1157 } |
| 1158 |
| 1159 /** |
| 1075 * Type parameters of the executable, if any. Empty if support for generic | 1160 * Type parameters of the executable, if any. Empty if support for generic |
| 1076 * method syntax is disabled. | 1161 * method syntax is disabled. |
| 1077 */ | 1162 */ |
| 1078 void set typeParameters(List<UnlinkedTypeParamBuilder> _value) { | 1163 void set typeParameters(List<UnlinkedTypeParamBuilder> _value) { |
| 1079 assert(!_finished); | 1164 assert(!_finished); |
| 1080 assert(!_json.containsKey("typeParameters")); | 1165 assert(!_json.containsKey("typeParameters")); |
| 1081 if (!(_value == null || _value.isEmpty)) { | 1166 if (!(_value == null || _value.isEmpty)) { |
| 1082 _json["typeParameters"] = _value.map((b) => b.finish()).toList(); | 1167 _json["typeParameters"] = _value.map((b) => b.finish()).toList(); |
| 1083 } | 1168 } |
| 1084 } | 1169 } |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1192 } | 1277 } |
| 1193 } | 1278 } |
| 1194 | 1279 |
| 1195 Map finish() { | 1280 Map finish() { |
| 1196 assert(!_finished); | 1281 assert(!_finished); |
| 1197 _finished = true; | 1282 _finished = true; |
| 1198 return _json; | 1283 return _json; |
| 1199 } | 1284 } |
| 1200 } | 1285 } |
| 1201 | 1286 |
| 1202 UnlinkedExecutableBuilder encodeUnlinkedExecutable(base.BuilderContext builderCo
ntext, {String name, List<UnlinkedTypeParamBuilder> typeParameters, UnlinkedType
RefBuilder returnType, List<UnlinkedParamBuilder> parameters, UnlinkedExecutable
Kind kind, bool isAbstract, bool isStatic, bool isConst, bool isFactory, bool ha
sImplicitReturnType, bool isExternal}) { | 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}) { |
| 1203 UnlinkedExecutableBuilder builder = new UnlinkedExecutableBuilder(builderConte
xt); | 1288 UnlinkedExecutableBuilder builder = new UnlinkedExecutableBuilder(builderConte
xt); |
| 1204 builder.name = name; | 1289 builder.name = name; |
| 1290 builder.nameOffset = nameOffset; |
| 1205 builder.typeParameters = typeParameters; | 1291 builder.typeParameters = typeParameters; |
| 1206 builder.returnType = returnType; | 1292 builder.returnType = returnType; |
| 1207 builder.parameters = parameters; | 1293 builder.parameters = parameters; |
| 1208 builder.kind = kind; | 1294 builder.kind = kind; |
| 1209 builder.isAbstract = isAbstract; | 1295 builder.isAbstract = isAbstract; |
| 1210 builder.isStatic = isStatic; | 1296 builder.isStatic = isStatic; |
| 1211 builder.isConst = isConst; | 1297 builder.isConst = isConst; |
| 1212 builder.isFactory = isFactory; | 1298 builder.isFactory = isFactory; |
| 1213 builder.hasImplicitReturnType = hasImplicitReturnType; | 1299 builder.hasImplicitReturnType = hasImplicitReturnType; |
| 1214 builder.isExternal = isExternal; | 1300 builder.isExternal = isExternal; |
| 1215 return builder; | 1301 return builder; |
| 1216 } | 1302 } |
| 1217 | 1303 |
| 1218 /** | 1304 /** |
| 1219 * Unlinked summary information about an export declaration (stored outside | 1305 * Unlinked summary information about an export declaration (stored outside |
| 1220 * [UnlinkedPublicNamespace]). | 1306 * [UnlinkedPublicNamespace]). |
| 1221 */ | 1307 */ |
| 1222 class UnlinkedExportNonPublic extends base.SummaryClass { | 1308 class UnlinkedExportNonPublic extends base.SummaryClass { |
| 1309 int _offset; |
| 1223 int _uriOffset; | 1310 int _uriOffset; |
| 1224 int _uriEnd; | 1311 int _uriEnd; |
| 1225 | 1312 |
| 1226 UnlinkedExportNonPublic.fromJson(Map json) | 1313 UnlinkedExportNonPublic.fromJson(Map json) |
| 1227 : _uriOffset = json["uriOffset"], | 1314 : _offset = json["offset"], |
| 1315 _uriOffset = json["uriOffset"], |
| 1228 _uriEnd = json["uriEnd"]; | 1316 _uriEnd = json["uriEnd"]; |
| 1229 | 1317 |
| 1230 @override | 1318 @override |
| 1231 Map<String, Object> toMap() => { | 1319 Map<String, Object> toMap() => { |
| 1320 "offset": offset, |
| 1232 "uriOffset": uriOffset, | 1321 "uriOffset": uriOffset, |
| 1233 "uriEnd": uriEnd, | 1322 "uriEnd": uriEnd, |
| 1234 }; | 1323 }; |
| 1235 | 1324 |
| 1236 /** | 1325 /** |
| 1326 * Offset of the "export" keyword. |
| 1327 */ |
| 1328 int get offset => _offset ?? 0; |
| 1329 |
| 1330 /** |
| 1237 * Offset of the URI string (including quotes) relative to the beginning of | 1331 * Offset of the URI string (including quotes) relative to the beginning of |
| 1238 * the file. | 1332 * the file. |
| 1239 */ | 1333 */ |
| 1240 int get uriOffset => _uriOffset ?? 0; | 1334 int get uriOffset => _uriOffset ?? 0; |
| 1241 | 1335 |
| 1242 /** | 1336 /** |
| 1243 * End of the URI string (including quotes) relative to the beginning of the | 1337 * End of the URI string (including quotes) relative to the beginning of the |
| 1244 * file. | 1338 * file. |
| 1245 */ | 1339 */ |
| 1246 int get uriEnd => _uriEnd ?? 0; | 1340 int get uriEnd => _uriEnd ?? 0; |
| 1247 } | 1341 } |
| 1248 | 1342 |
| 1249 class UnlinkedExportNonPublicBuilder { | 1343 class UnlinkedExportNonPublicBuilder { |
| 1250 final Map _json = {}; | 1344 final Map _json = {}; |
| 1251 | 1345 |
| 1252 bool _finished = false; | 1346 bool _finished = false; |
| 1253 | 1347 |
| 1254 UnlinkedExportNonPublicBuilder(base.BuilderContext context); | 1348 UnlinkedExportNonPublicBuilder(base.BuilderContext context); |
| 1255 | 1349 |
| 1256 /** | 1350 /** |
| 1351 * Offset of the "export" keyword. |
| 1352 */ |
| 1353 void set offset(int _value) { |
| 1354 assert(!_finished); |
| 1355 assert(!_json.containsKey("offset")); |
| 1356 if (_value != null) { |
| 1357 _json["offset"] = _value; |
| 1358 } |
| 1359 } |
| 1360 |
| 1361 /** |
| 1257 * Offset of the URI string (including quotes) relative to the beginning of | 1362 * Offset of the URI string (including quotes) relative to the beginning of |
| 1258 * the file. | 1363 * the file. |
| 1259 */ | 1364 */ |
| 1260 void set uriOffset(int _value) { | 1365 void set uriOffset(int _value) { |
| 1261 assert(!_finished); | 1366 assert(!_finished); |
| 1262 assert(!_json.containsKey("uriOffset")); | 1367 assert(!_json.containsKey("uriOffset")); |
| 1263 if (_value != null) { | 1368 if (_value != null) { |
| 1264 _json["uriOffset"] = _value; | 1369 _json["uriOffset"] = _value; |
| 1265 } | 1370 } |
| 1266 } | 1371 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 1277 } | 1382 } |
| 1278 } | 1383 } |
| 1279 | 1384 |
| 1280 Map finish() { | 1385 Map finish() { |
| 1281 assert(!_finished); | 1386 assert(!_finished); |
| 1282 _finished = true; | 1387 _finished = true; |
| 1283 return _json; | 1388 return _json; |
| 1284 } | 1389 } |
| 1285 } | 1390 } |
| 1286 | 1391 |
| 1287 UnlinkedExportNonPublicBuilder encodeUnlinkedExportNonPublic(base.BuilderContext
builderContext, {int uriOffset, int uriEnd}) { | 1392 UnlinkedExportNonPublicBuilder encodeUnlinkedExportNonPublic(base.BuilderContext
builderContext, {int offset, int uriOffset, int uriEnd}) { |
| 1288 UnlinkedExportNonPublicBuilder builder = new UnlinkedExportNonPublicBuilder(bu
ilderContext); | 1393 UnlinkedExportNonPublicBuilder builder = new UnlinkedExportNonPublicBuilder(bu
ilderContext); |
| 1394 builder.offset = offset; |
| 1289 builder.uriOffset = uriOffset; | 1395 builder.uriOffset = uriOffset; |
| 1290 builder.uriEnd = uriEnd; | 1396 builder.uriEnd = uriEnd; |
| 1291 return builder; | 1397 return builder; |
| 1292 } | 1398 } |
| 1293 | 1399 |
| 1294 /** | 1400 /** |
| 1295 * Unlinked summary information about an export declaration (stored inside | 1401 * Unlinked summary information about an export declaration (stored inside |
| 1296 * [UnlinkedPublicNamespace]). | 1402 * [UnlinkedPublicNamespace]). |
| 1297 */ | 1403 */ |
| 1298 class UnlinkedExportPublic extends base.SummaryClass { | 1404 class UnlinkedExportPublic extends base.SummaryClass { |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1368 */ | 1474 */ |
| 1369 class UnlinkedImport extends base.SummaryClass { | 1475 class UnlinkedImport extends base.SummaryClass { |
| 1370 String _uri; | 1476 String _uri; |
| 1371 int _offset; | 1477 int _offset; |
| 1372 int _prefixReference; | 1478 int _prefixReference; |
| 1373 List<UnlinkedCombinator> _combinators; | 1479 List<UnlinkedCombinator> _combinators; |
| 1374 bool _isDeferred; | 1480 bool _isDeferred; |
| 1375 bool _isImplicit; | 1481 bool _isImplicit; |
| 1376 int _uriOffset; | 1482 int _uriOffset; |
| 1377 int _uriEnd; | 1483 int _uriEnd; |
| 1484 int _prefixOffset; |
| 1378 | 1485 |
| 1379 UnlinkedImport.fromJson(Map json) | 1486 UnlinkedImport.fromJson(Map json) |
| 1380 : _uri = json["uri"], | 1487 : _uri = json["uri"], |
| 1381 _offset = json["offset"], | 1488 _offset = json["offset"], |
| 1382 _prefixReference = json["prefixReference"], | 1489 _prefixReference = json["prefixReference"], |
| 1383 _combinators = json["combinators"]?.map((x) => new UnlinkedCombinator.from
Json(x))?.toList(), | 1490 _combinators = json["combinators"]?.map((x) => new UnlinkedCombinator.from
Json(x))?.toList(), |
| 1384 _isDeferred = json["isDeferred"], | 1491 _isDeferred = json["isDeferred"], |
| 1385 _isImplicit = json["isImplicit"], | 1492 _isImplicit = json["isImplicit"], |
| 1386 _uriOffset = json["uriOffset"], | 1493 _uriOffset = json["uriOffset"], |
| 1387 _uriEnd = json["uriEnd"]; | 1494 _uriEnd = json["uriEnd"], |
| 1495 _prefixOffset = json["prefixOffset"]; |
| 1388 | 1496 |
| 1389 @override | 1497 @override |
| 1390 Map<String, Object> toMap() => { | 1498 Map<String, Object> toMap() => { |
| 1391 "uri": uri, | 1499 "uri": uri, |
| 1392 "offset": offset, | 1500 "offset": offset, |
| 1393 "prefixReference": prefixReference, | 1501 "prefixReference": prefixReference, |
| 1394 "combinators": combinators, | 1502 "combinators": combinators, |
| 1395 "isDeferred": isDeferred, | 1503 "isDeferred": isDeferred, |
| 1396 "isImplicit": isImplicit, | 1504 "isImplicit": isImplicit, |
| 1397 "uriOffset": uriOffset, | 1505 "uriOffset": uriOffset, |
| 1398 "uriEnd": uriEnd, | 1506 "uriEnd": uriEnd, |
| 1507 "prefixOffset": prefixOffset, |
| 1399 }; | 1508 }; |
| 1400 | 1509 |
| 1401 /** | 1510 /** |
| 1402 * URI used in the source code to reference the imported library. | 1511 * URI used in the source code to reference the imported library. |
| 1403 */ | 1512 */ |
| 1404 String get uri => _uri ?? ''; | 1513 String get uri => _uri ?? ''; |
| 1405 | 1514 |
| 1406 /** | 1515 /** |
| 1407 * If [isImplicit] is false, offset of the "import" keyword. If [isImplicit] | 1516 * If [isImplicit] is false, offset of the "import" keyword. If [isImplicit] |
| 1408 * is true, zero. | 1517 * is true, zero. |
| (...skipping 27 matching lines...) Expand all Loading... |
| 1436 * Offset of the URI string (including quotes) relative to the beginning of | 1545 * Offset of the URI string (including quotes) relative to the beginning of |
| 1437 * the file. If [isImplicit] is true, zero. | 1546 * the file. If [isImplicit] is true, zero. |
| 1438 */ | 1547 */ |
| 1439 int get uriOffset => _uriOffset ?? 0; | 1548 int get uriOffset => _uriOffset ?? 0; |
| 1440 | 1549 |
| 1441 /** | 1550 /** |
| 1442 * End of the URI string (including quotes) relative to the beginning of the | 1551 * End of the URI string (including quotes) relative to the beginning of the |
| 1443 * file. If [isImplicit] is true, zero. | 1552 * file. If [isImplicit] is true, zero. |
| 1444 */ | 1553 */ |
| 1445 int get uriEnd => _uriEnd ?? 0; | 1554 int get uriEnd => _uriEnd ?? 0; |
| 1555 |
| 1556 /** |
| 1557 * Offset of the prefix name relative to the beginning of the file, or zero |
| 1558 * if there is no prefix. |
| 1559 */ |
| 1560 int get prefixOffset => _prefixOffset ?? 0; |
| 1446 } | 1561 } |
| 1447 | 1562 |
| 1448 class UnlinkedImportBuilder { | 1563 class UnlinkedImportBuilder { |
| 1449 final Map _json = {}; | 1564 final Map _json = {}; |
| 1450 | 1565 |
| 1451 bool _finished = false; | 1566 bool _finished = false; |
| 1452 | 1567 |
| 1453 UnlinkedImportBuilder(base.BuilderContext context); | 1568 UnlinkedImportBuilder(base.BuilderContext context); |
| 1454 | 1569 |
| 1455 /** | 1570 /** |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1539 * file. If [isImplicit] is true, zero. | 1654 * file. If [isImplicit] is true, zero. |
| 1540 */ | 1655 */ |
| 1541 void set uriEnd(int _value) { | 1656 void set uriEnd(int _value) { |
| 1542 assert(!_finished); | 1657 assert(!_finished); |
| 1543 assert(!_json.containsKey("uriEnd")); | 1658 assert(!_json.containsKey("uriEnd")); |
| 1544 if (_value != null) { | 1659 if (_value != null) { |
| 1545 _json["uriEnd"] = _value; | 1660 _json["uriEnd"] = _value; |
| 1546 } | 1661 } |
| 1547 } | 1662 } |
| 1548 | 1663 |
| 1664 /** |
| 1665 * Offset of the prefix name relative to the beginning of the file, or zero |
| 1666 * if there is no prefix. |
| 1667 */ |
| 1668 void set prefixOffset(int _value) { |
| 1669 assert(!_finished); |
| 1670 assert(!_json.containsKey("prefixOffset")); |
| 1671 if (_value != null) { |
| 1672 _json["prefixOffset"] = _value; |
| 1673 } |
| 1674 } |
| 1675 |
| 1549 Map finish() { | 1676 Map finish() { |
| 1550 assert(!_finished); | 1677 assert(!_finished); |
| 1551 _finished = true; | 1678 _finished = true; |
| 1552 return _json; | 1679 return _json; |
| 1553 } | 1680 } |
| 1554 } | 1681 } |
| 1555 | 1682 |
| 1556 UnlinkedImportBuilder encodeUnlinkedImport(base.BuilderContext builderContext, {
String uri, int offset, int prefixReference, List<UnlinkedCombinatorBuilder> com
binators, bool isDeferred, bool isImplicit, int uriOffset, int uriEnd}) { | 1683 UnlinkedImportBuilder encodeUnlinkedImport(base.BuilderContext builderContext, {
String uri, int offset, int prefixReference, List<UnlinkedCombinatorBuilder> com
binators, bool isDeferred, bool isImplicit, int uriOffset, int uriEnd, int prefi
xOffset}) { |
| 1557 UnlinkedImportBuilder builder = new UnlinkedImportBuilder(builderContext); | 1684 UnlinkedImportBuilder builder = new UnlinkedImportBuilder(builderContext); |
| 1558 builder.uri = uri; | 1685 builder.uri = uri; |
| 1559 builder.offset = offset; | 1686 builder.offset = offset; |
| 1560 builder.prefixReference = prefixReference; | 1687 builder.prefixReference = prefixReference; |
| 1561 builder.combinators = combinators; | 1688 builder.combinators = combinators; |
| 1562 builder.isDeferred = isDeferred; | 1689 builder.isDeferred = isDeferred; |
| 1563 builder.isImplicit = isImplicit; | 1690 builder.isImplicit = isImplicit; |
| 1564 builder.uriOffset = uriOffset; | 1691 builder.uriOffset = uriOffset; |
| 1565 builder.uriEnd = uriEnd; | 1692 builder.uriEnd = uriEnd; |
| 1693 builder.prefixOffset = prefixOffset; |
| 1566 return builder; | 1694 return builder; |
| 1567 } | 1695 } |
| 1568 | 1696 |
| 1569 /** | 1697 /** |
| 1570 * Unlinked summary information about a function parameter. | 1698 * Unlinked summary information about a function parameter. |
| 1571 */ | 1699 */ |
| 1572 class UnlinkedParam extends base.SummaryClass { | 1700 class UnlinkedParam extends base.SummaryClass { |
| 1573 String _name; | 1701 String _name; |
| 1702 int _nameOffset; |
| 1574 UnlinkedTypeRef _type; | 1703 UnlinkedTypeRef _type; |
| 1575 List<UnlinkedParam> _parameters; | 1704 List<UnlinkedParam> _parameters; |
| 1576 UnlinkedParamKind _kind; | 1705 UnlinkedParamKind _kind; |
| 1577 bool _isFunctionTyped; | 1706 bool _isFunctionTyped; |
| 1578 bool _isInitializingFormal; | 1707 bool _isInitializingFormal; |
| 1579 bool _hasImplicitType; | 1708 bool _hasImplicitType; |
| 1580 | 1709 |
| 1581 UnlinkedParam.fromJson(Map json) | 1710 UnlinkedParam.fromJson(Map json) |
| 1582 : _name = json["name"], | 1711 : _name = json["name"], |
| 1712 _nameOffset = json["nameOffset"], |
| 1583 _type = json["type"] == null ? null : new UnlinkedTypeRef.fromJson(json["t
ype"]), | 1713 _type = json["type"] == null ? null : new UnlinkedTypeRef.fromJson(json["t
ype"]), |
| 1584 _parameters = json["parameters"]?.map((x) => new UnlinkedParam.fromJson(x)
)?.toList(), | 1714 _parameters = json["parameters"]?.map((x) => new UnlinkedParam.fromJson(x)
)?.toList(), |
| 1585 _kind = json["kind"] == null ? null : UnlinkedParamKind.values[json["kind"
]], | 1715 _kind = json["kind"] == null ? null : UnlinkedParamKind.values[json["kind"
]], |
| 1586 _isFunctionTyped = json["isFunctionTyped"], | 1716 _isFunctionTyped = json["isFunctionTyped"], |
| 1587 _isInitializingFormal = json["isInitializingFormal"], | 1717 _isInitializingFormal = json["isInitializingFormal"], |
| 1588 _hasImplicitType = json["hasImplicitType"]; | 1718 _hasImplicitType = json["hasImplicitType"]; |
| 1589 | 1719 |
| 1590 @override | 1720 @override |
| 1591 Map<String, Object> toMap() => { | 1721 Map<String, Object> toMap() => { |
| 1592 "name": name, | 1722 "name": name, |
| 1723 "nameOffset": nameOffset, |
| 1593 "type": type, | 1724 "type": type, |
| 1594 "parameters": parameters, | 1725 "parameters": parameters, |
| 1595 "kind": kind, | 1726 "kind": kind, |
| 1596 "isFunctionTyped": isFunctionTyped, | 1727 "isFunctionTyped": isFunctionTyped, |
| 1597 "isInitializingFormal": isInitializingFormal, | 1728 "isInitializingFormal": isInitializingFormal, |
| 1598 "hasImplicitType": hasImplicitType, | 1729 "hasImplicitType": hasImplicitType, |
| 1599 }; | 1730 }; |
| 1600 | 1731 |
| 1601 /** | 1732 /** |
| 1602 * Name of the parameter. | 1733 * Name of the parameter. |
| 1603 */ | 1734 */ |
| 1604 String get name => _name ?? ''; | 1735 String get name => _name ?? ''; |
| 1605 | 1736 |
| 1606 /** | 1737 /** |
| 1738 * Offset of the parameter name relative to the beginning of the file. |
| 1739 */ |
| 1740 int get nameOffset => _nameOffset ?? 0; |
| 1741 |
| 1742 /** |
| 1607 * If [isFunctionTyped] is `true`, the declared return type. If | 1743 * If [isFunctionTyped] is `true`, the declared return type. If |
| 1608 * [isFunctionTyped] is `false`, the declared type. Absent if | 1744 * [isFunctionTyped] is `false`, the declared type. Absent if |
| 1609 * [isFunctionTyped] is `true` and the declared return type is `void`. Note | 1745 * [isFunctionTyped] is `true` and the declared return type is `void`. Note |
| 1610 * that when strong mode is enabled, the actual type may be different due to | 1746 * that when strong mode is enabled, the actual type may be different due to |
| 1611 * type inference. | 1747 * type inference. |
| 1612 */ | 1748 */ |
| 1613 UnlinkedTypeRef get type => _type; | 1749 UnlinkedTypeRef get type => _type; |
| 1614 | 1750 |
| 1615 /** | 1751 /** |
| 1616 * If [isFunctionTyped] is `true`, the parameters of the function type. | 1752 * If [isFunctionTyped] is `true`, the parameters of the function type. |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1652 */ | 1788 */ |
| 1653 void set name(String _value) { | 1789 void set name(String _value) { |
| 1654 assert(!_finished); | 1790 assert(!_finished); |
| 1655 assert(!_json.containsKey("name")); | 1791 assert(!_json.containsKey("name")); |
| 1656 if (_value != null) { | 1792 if (_value != null) { |
| 1657 _json["name"] = _value; | 1793 _json["name"] = _value; |
| 1658 } | 1794 } |
| 1659 } | 1795 } |
| 1660 | 1796 |
| 1661 /** | 1797 /** |
| 1798 * Offset of the parameter name relative to the beginning of the file. |
| 1799 */ |
| 1800 void set nameOffset(int _value) { |
| 1801 assert(!_finished); |
| 1802 assert(!_json.containsKey("nameOffset")); |
| 1803 if (_value != null) { |
| 1804 _json["nameOffset"] = _value; |
| 1805 } |
| 1806 } |
| 1807 |
| 1808 /** |
| 1662 * If [isFunctionTyped] is `true`, the declared return type. If | 1809 * If [isFunctionTyped] is `true`, the declared return type. If |
| 1663 * [isFunctionTyped] is `false`, the declared type. Absent if | 1810 * [isFunctionTyped] is `false`, the declared type. Absent if |
| 1664 * [isFunctionTyped] is `true` and the declared return type is `void`. Note | 1811 * [isFunctionTyped] is `true` and the declared return type is `void`. Note |
| 1665 * that when strong mode is enabled, the actual type may be different due to | 1812 * that when strong mode is enabled, the actual type may be different due to |
| 1666 * type inference. | 1813 * type inference. |
| 1667 */ | 1814 */ |
| 1668 void set type(UnlinkedTypeRefBuilder _value) { | 1815 void set type(UnlinkedTypeRefBuilder _value) { |
| 1669 assert(!_finished); | 1816 assert(!_finished); |
| 1670 assert(!_json.containsKey("type")); | 1817 assert(!_json.containsKey("type")); |
| 1671 if (_value != null) { | 1818 if (_value != null) { |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1730 } | 1877 } |
| 1731 } | 1878 } |
| 1732 | 1879 |
| 1733 Map finish() { | 1880 Map finish() { |
| 1734 assert(!_finished); | 1881 assert(!_finished); |
| 1735 _finished = true; | 1882 _finished = true; |
| 1736 return _json; | 1883 return _json; |
| 1737 } | 1884 } |
| 1738 } | 1885 } |
| 1739 | 1886 |
| 1740 UnlinkedParamBuilder encodeUnlinkedParam(base.BuilderContext builderContext, {St
ring name, UnlinkedTypeRefBuilder type, List<UnlinkedParamBuilder> parameters, U
nlinkedParamKind kind, bool isFunctionTyped, bool isInitializingFormal, bool has
ImplicitType}) { | 1887 UnlinkedParamBuilder encodeUnlinkedParam(base.BuilderContext builderContext, {St
ring name, int nameOffset, UnlinkedTypeRefBuilder type, List<UnlinkedParamBuilde
r> parameters, UnlinkedParamKind kind, bool isFunctionTyped, bool isInitializing
Formal, bool hasImplicitType}) { |
| 1741 UnlinkedParamBuilder builder = new UnlinkedParamBuilder(builderContext); | 1888 UnlinkedParamBuilder builder = new UnlinkedParamBuilder(builderContext); |
| 1742 builder.name = name; | 1889 builder.name = name; |
| 1890 builder.nameOffset = nameOffset; |
| 1743 builder.type = type; | 1891 builder.type = type; |
| 1744 builder.parameters = parameters; | 1892 builder.parameters = parameters; |
| 1745 builder.kind = kind; | 1893 builder.kind = kind; |
| 1746 builder.isFunctionTyped = isFunctionTyped; | 1894 builder.isFunctionTyped = isFunctionTyped; |
| 1747 builder.isInitializingFormal = isInitializingFormal; | 1895 builder.isInitializingFormal = isInitializingFormal; |
| 1748 builder.hasImplicitType = hasImplicitType; | 1896 builder.hasImplicitType = hasImplicitType; |
| 1749 return builder; | 1897 return builder; |
| 1750 } | 1898 } |
| 1751 | 1899 |
| 1752 /** | 1900 /** |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2105 builder.name = name; | 2253 builder.name = name; |
| 2106 builder.prefixReference = prefixReference; | 2254 builder.prefixReference = prefixReference; |
| 2107 return builder; | 2255 return builder; |
| 2108 } | 2256 } |
| 2109 | 2257 |
| 2110 /** | 2258 /** |
| 2111 * Unlinked summary information about a typedef declaration. | 2259 * Unlinked summary information about a typedef declaration. |
| 2112 */ | 2260 */ |
| 2113 class UnlinkedTypedef extends base.SummaryClass { | 2261 class UnlinkedTypedef extends base.SummaryClass { |
| 2114 String _name; | 2262 String _name; |
| 2263 int _nameOffset; |
| 2115 List<UnlinkedTypeParam> _typeParameters; | 2264 List<UnlinkedTypeParam> _typeParameters; |
| 2116 UnlinkedTypeRef _returnType; | 2265 UnlinkedTypeRef _returnType; |
| 2117 List<UnlinkedParam> _parameters; | 2266 List<UnlinkedParam> _parameters; |
| 2118 | 2267 |
| 2119 UnlinkedTypedef.fromJson(Map json) | 2268 UnlinkedTypedef.fromJson(Map json) |
| 2120 : _name = json["name"], | 2269 : _name = json["name"], |
| 2270 _nameOffset = json["nameOffset"], |
| 2121 _typeParameters = json["typeParameters"]?.map((x) => new UnlinkedTypeParam
.fromJson(x))?.toList(), | 2271 _typeParameters = json["typeParameters"]?.map((x) => new UnlinkedTypeParam
.fromJson(x))?.toList(), |
| 2122 _returnType = json["returnType"] == null ? null : new UnlinkedTypeRef.from
Json(json["returnType"]), | 2272 _returnType = json["returnType"] == null ? null : new UnlinkedTypeRef.from
Json(json["returnType"]), |
| 2123 _parameters = json["parameters"]?.map((x) => new UnlinkedParam.fromJson(x)
)?.toList(); | 2273 _parameters = json["parameters"]?.map((x) => new UnlinkedParam.fromJson(x)
)?.toList(); |
| 2124 | 2274 |
| 2125 @override | 2275 @override |
| 2126 Map<String, Object> toMap() => { | 2276 Map<String, Object> toMap() => { |
| 2127 "name": name, | 2277 "name": name, |
| 2278 "nameOffset": nameOffset, |
| 2128 "typeParameters": typeParameters, | 2279 "typeParameters": typeParameters, |
| 2129 "returnType": returnType, | 2280 "returnType": returnType, |
| 2130 "parameters": parameters, | 2281 "parameters": parameters, |
| 2131 }; | 2282 }; |
| 2132 | 2283 |
| 2133 /** | 2284 /** |
| 2134 * Name of the typedef. | 2285 * Name of the typedef. |
| 2135 */ | 2286 */ |
| 2136 String get name => _name ?? ''; | 2287 String get name => _name ?? ''; |
| 2137 | 2288 |
| 2138 /** | 2289 /** |
| 2290 * Offset of the typedef name relative to the beginning of the file. |
| 2291 */ |
| 2292 int get nameOffset => _nameOffset ?? 0; |
| 2293 |
| 2294 /** |
| 2139 * Type parameters of the typedef, if any. | 2295 * Type parameters of the typedef, if any. |
| 2140 */ | 2296 */ |
| 2141 List<UnlinkedTypeParam> get typeParameters => _typeParameters ?? const <Unlink
edTypeParam>[]; | 2297 List<UnlinkedTypeParam> get typeParameters => _typeParameters ?? const <Unlink
edTypeParam>[]; |
| 2142 | 2298 |
| 2143 /** | 2299 /** |
| 2144 * Return type of the typedef. Absent if the return type is `void`. | 2300 * Return type of the typedef. Absent if the return type is `void`. |
| 2145 */ | 2301 */ |
| 2146 UnlinkedTypeRef get returnType => _returnType; | 2302 UnlinkedTypeRef get returnType => _returnType; |
| 2147 | 2303 |
| 2148 /** | 2304 /** |
| (...skipping 14 matching lines...) Expand all Loading... |
| 2163 */ | 2319 */ |
| 2164 void set name(String _value) { | 2320 void set name(String _value) { |
| 2165 assert(!_finished); | 2321 assert(!_finished); |
| 2166 assert(!_json.containsKey("name")); | 2322 assert(!_json.containsKey("name")); |
| 2167 if (_value != null) { | 2323 if (_value != null) { |
| 2168 _json["name"] = _value; | 2324 _json["name"] = _value; |
| 2169 } | 2325 } |
| 2170 } | 2326 } |
| 2171 | 2327 |
| 2172 /** | 2328 /** |
| 2329 * Offset of the typedef name relative to the beginning of the file. |
| 2330 */ |
| 2331 void set nameOffset(int _value) { |
| 2332 assert(!_finished); |
| 2333 assert(!_json.containsKey("nameOffset")); |
| 2334 if (_value != null) { |
| 2335 _json["nameOffset"] = _value; |
| 2336 } |
| 2337 } |
| 2338 |
| 2339 /** |
| 2173 * Type parameters of the typedef, if any. | 2340 * Type parameters of the typedef, if any. |
| 2174 */ | 2341 */ |
| 2175 void set typeParameters(List<UnlinkedTypeParamBuilder> _value) { | 2342 void set typeParameters(List<UnlinkedTypeParamBuilder> _value) { |
| 2176 assert(!_finished); | 2343 assert(!_finished); |
| 2177 assert(!_json.containsKey("typeParameters")); | 2344 assert(!_json.containsKey("typeParameters")); |
| 2178 if (!(_value == null || _value.isEmpty)) { | 2345 if (!(_value == null || _value.isEmpty)) { |
| 2179 _json["typeParameters"] = _value.map((b) => b.finish()).toList(); | 2346 _json["typeParameters"] = _value.map((b) => b.finish()).toList(); |
| 2180 } | 2347 } |
| 2181 } | 2348 } |
| 2182 | 2349 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 2202 } | 2369 } |
| 2203 } | 2370 } |
| 2204 | 2371 |
| 2205 Map finish() { | 2372 Map finish() { |
| 2206 assert(!_finished); | 2373 assert(!_finished); |
| 2207 _finished = true; | 2374 _finished = true; |
| 2208 return _json; | 2375 return _json; |
| 2209 } | 2376 } |
| 2210 } | 2377 } |
| 2211 | 2378 |
| 2212 UnlinkedTypedefBuilder encodeUnlinkedTypedef(base.BuilderContext builderContext,
{String name, List<UnlinkedTypeParamBuilder> typeParameters, UnlinkedTypeRefBui
lder returnType, List<UnlinkedParamBuilder> parameters}) { | 2379 UnlinkedTypedefBuilder encodeUnlinkedTypedef(base.BuilderContext builderContext,
{String name, int nameOffset, List<UnlinkedTypeParamBuilder> typeParameters, Un
linkedTypeRefBuilder returnType, List<UnlinkedParamBuilder> parameters}) { |
| 2213 UnlinkedTypedefBuilder builder = new UnlinkedTypedefBuilder(builderContext); | 2380 UnlinkedTypedefBuilder builder = new UnlinkedTypedefBuilder(builderContext); |
| 2214 builder.name = name; | 2381 builder.name = name; |
| 2382 builder.nameOffset = nameOffset; |
| 2215 builder.typeParameters = typeParameters; | 2383 builder.typeParameters = typeParameters; |
| 2216 builder.returnType = returnType; | 2384 builder.returnType = returnType; |
| 2217 builder.parameters = parameters; | 2385 builder.parameters = parameters; |
| 2218 return builder; | 2386 return builder; |
| 2219 } | 2387 } |
| 2220 | 2388 |
| 2221 /** | 2389 /** |
| 2222 * Unlinked summary information about a type parameter declaration. | 2390 * Unlinked summary information about a type parameter declaration. |
| 2223 */ | 2391 */ |
| 2224 class UnlinkedTypeParam extends base.SummaryClass { | 2392 class UnlinkedTypeParam extends base.SummaryClass { |
| 2225 String _name; | 2393 String _name; |
| 2394 int _nameOffset; |
| 2226 UnlinkedTypeRef _bound; | 2395 UnlinkedTypeRef _bound; |
| 2227 | 2396 |
| 2228 UnlinkedTypeParam.fromJson(Map json) | 2397 UnlinkedTypeParam.fromJson(Map json) |
| 2229 : _name = json["name"], | 2398 : _name = json["name"], |
| 2399 _nameOffset = json["nameOffset"], |
| 2230 _bound = json["bound"] == null ? null : new UnlinkedTypeRef.fromJson(json[
"bound"]); | 2400 _bound = json["bound"] == null ? null : new UnlinkedTypeRef.fromJson(json[
"bound"]); |
| 2231 | 2401 |
| 2232 @override | 2402 @override |
| 2233 Map<String, Object> toMap() => { | 2403 Map<String, Object> toMap() => { |
| 2234 "name": name, | 2404 "name": name, |
| 2405 "nameOffset": nameOffset, |
| 2235 "bound": bound, | 2406 "bound": bound, |
| 2236 }; | 2407 }; |
| 2237 | 2408 |
| 2238 /** | 2409 /** |
| 2239 * Name of the type parameter. | 2410 * Name of the type parameter. |
| 2240 */ | 2411 */ |
| 2241 String get name => _name ?? ''; | 2412 String get name => _name ?? ''; |
| 2242 | 2413 |
| 2243 /** | 2414 /** |
| 2415 * Offset of the type parameter name relative to the beginning of the file. |
| 2416 */ |
| 2417 int get nameOffset => _nameOffset ?? 0; |
| 2418 |
| 2419 /** |
| 2244 * Bound of the type parameter, if a bound is explicitly declared. Otherwise | 2420 * Bound of the type parameter, if a bound is explicitly declared. Otherwise |
| 2245 * null. | 2421 * null. |
| 2246 */ | 2422 */ |
| 2247 UnlinkedTypeRef get bound => _bound; | 2423 UnlinkedTypeRef get bound => _bound; |
| 2248 } | 2424 } |
| 2249 | 2425 |
| 2250 class UnlinkedTypeParamBuilder { | 2426 class UnlinkedTypeParamBuilder { |
| 2251 final Map _json = {}; | 2427 final Map _json = {}; |
| 2252 | 2428 |
| 2253 bool _finished = false; | 2429 bool _finished = false; |
| 2254 | 2430 |
| 2255 UnlinkedTypeParamBuilder(base.BuilderContext context); | 2431 UnlinkedTypeParamBuilder(base.BuilderContext context); |
| 2256 | 2432 |
| 2257 /** | 2433 /** |
| 2258 * Name of the type parameter. | 2434 * Name of the type parameter. |
| 2259 */ | 2435 */ |
| 2260 void set name(String _value) { | 2436 void set name(String _value) { |
| 2261 assert(!_finished); | 2437 assert(!_finished); |
| 2262 assert(!_json.containsKey("name")); | 2438 assert(!_json.containsKey("name")); |
| 2263 if (_value != null) { | 2439 if (_value != null) { |
| 2264 _json["name"] = _value; | 2440 _json["name"] = _value; |
| 2265 } | 2441 } |
| 2266 } | 2442 } |
| 2267 | 2443 |
| 2268 /** | 2444 /** |
| 2445 * Offset of the type parameter name relative to the beginning of the file. |
| 2446 */ |
| 2447 void set nameOffset(int _value) { |
| 2448 assert(!_finished); |
| 2449 assert(!_json.containsKey("nameOffset")); |
| 2450 if (_value != null) { |
| 2451 _json["nameOffset"] = _value; |
| 2452 } |
| 2453 } |
| 2454 |
| 2455 /** |
| 2269 * Bound of the type parameter, if a bound is explicitly declared. Otherwise | 2456 * Bound of the type parameter, if a bound is explicitly declared. Otherwise |
| 2270 * null. | 2457 * null. |
| 2271 */ | 2458 */ |
| 2272 void set bound(UnlinkedTypeRefBuilder _value) { | 2459 void set bound(UnlinkedTypeRefBuilder _value) { |
| 2273 assert(!_finished); | 2460 assert(!_finished); |
| 2274 assert(!_json.containsKey("bound")); | 2461 assert(!_json.containsKey("bound")); |
| 2275 if (_value != null) { | 2462 if (_value != null) { |
| 2276 _json["bound"] = _value.finish(); | 2463 _json["bound"] = _value.finish(); |
| 2277 } | 2464 } |
| 2278 } | 2465 } |
| 2279 | 2466 |
| 2280 Map finish() { | 2467 Map finish() { |
| 2281 assert(!_finished); | 2468 assert(!_finished); |
| 2282 _finished = true; | 2469 _finished = true; |
| 2283 return _json; | 2470 return _json; |
| 2284 } | 2471 } |
| 2285 } | 2472 } |
| 2286 | 2473 |
| 2287 UnlinkedTypeParamBuilder encodeUnlinkedTypeParam(base.BuilderContext builderCont
ext, {String name, UnlinkedTypeRefBuilder bound}) { | 2474 UnlinkedTypeParamBuilder encodeUnlinkedTypeParam(base.BuilderContext builderCont
ext, {String name, int nameOffset, UnlinkedTypeRefBuilder bound}) { |
| 2288 UnlinkedTypeParamBuilder builder = new UnlinkedTypeParamBuilder(builderContext
); | 2475 UnlinkedTypeParamBuilder builder = new UnlinkedTypeParamBuilder(builderContext
); |
| 2289 builder.name = name; | 2476 builder.name = name; |
| 2477 builder.nameOffset = nameOffset; |
| 2290 builder.bound = bound; | 2478 builder.bound = bound; |
| 2291 return builder; | 2479 return builder; |
| 2292 } | 2480 } |
| 2293 | 2481 |
| 2294 /** | 2482 /** |
| 2295 * Unlinked summary information about a reference to a type. | 2483 * Unlinked summary information about a reference to a type. |
| 2296 */ | 2484 */ |
| 2297 class UnlinkedTypeRef extends base.SummaryClass { | 2485 class UnlinkedTypeRef extends base.SummaryClass { |
| 2298 int _reference; | 2486 int _reference; |
| 2299 int _paramReference; | 2487 int _paramReference; |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2428 builder.paramReference = paramReference; | 2616 builder.paramReference = paramReference; |
| 2429 builder.typeArguments = typeArguments; | 2617 builder.typeArguments = typeArguments; |
| 2430 return builder; | 2618 return builder; |
| 2431 } | 2619 } |
| 2432 | 2620 |
| 2433 /** | 2621 /** |
| 2434 * Unlinked summary information about a compilation unit ("part file"). | 2622 * Unlinked summary information about a compilation unit ("part file"). |
| 2435 */ | 2623 */ |
| 2436 class UnlinkedUnit extends base.SummaryClass { | 2624 class UnlinkedUnit extends base.SummaryClass { |
| 2437 String _libraryName; | 2625 String _libraryName; |
| 2626 int _libraryNameOffset; |
| 2627 int _libraryNameLength; |
| 2438 UnlinkedPublicNamespace _publicNamespace; | 2628 UnlinkedPublicNamespace _publicNamespace; |
| 2439 List<UnlinkedReference> _references; | 2629 List<UnlinkedReference> _references; |
| 2440 List<UnlinkedClass> _classes; | 2630 List<UnlinkedClass> _classes; |
| 2441 List<UnlinkedEnum> _enums; | 2631 List<UnlinkedEnum> _enums; |
| 2442 List<UnlinkedExecutable> _executables; | 2632 List<UnlinkedExecutable> _executables; |
| 2443 List<UnlinkedExportNonPublic> _exports; | 2633 List<UnlinkedExportNonPublic> _exports; |
| 2444 List<UnlinkedImport> _imports; | 2634 List<UnlinkedImport> _imports; |
| 2445 List<UnlinkedPart> _parts; | 2635 List<UnlinkedPart> _parts; |
| 2446 List<UnlinkedTypedef> _typedefs; | 2636 List<UnlinkedTypedef> _typedefs; |
| 2447 List<UnlinkedVariable> _variables; | 2637 List<UnlinkedVariable> _variables; |
| 2448 | 2638 |
| 2449 UnlinkedUnit.fromJson(Map json) | 2639 UnlinkedUnit.fromJson(Map json) |
| 2450 : _libraryName = json["libraryName"], | 2640 : _libraryName = json["libraryName"], |
| 2641 _libraryNameOffset = json["libraryNameOffset"], |
| 2642 _libraryNameLength = json["libraryNameLength"], |
| 2451 _publicNamespace = json["publicNamespace"] == null ? null : new UnlinkedPu
blicNamespace.fromJson(json["publicNamespace"]), | 2643 _publicNamespace = json["publicNamespace"] == null ? null : new UnlinkedPu
blicNamespace.fromJson(json["publicNamespace"]), |
| 2452 _references = json["references"]?.map((x) => new UnlinkedReference.fromJso
n(x))?.toList(), | 2644 _references = json["references"]?.map((x) => new UnlinkedReference.fromJso
n(x))?.toList(), |
| 2453 _classes = json["classes"]?.map((x) => new UnlinkedClass.fromJson(x))?.toL
ist(), | 2645 _classes = json["classes"]?.map((x) => new UnlinkedClass.fromJson(x))?.toL
ist(), |
| 2454 _enums = json["enums"]?.map((x) => new UnlinkedEnum.fromJson(x))?.toList()
, | 2646 _enums = json["enums"]?.map((x) => new UnlinkedEnum.fromJson(x))?.toList()
, |
| 2455 _executables = json["executables"]?.map((x) => new UnlinkedExecutable.from
Json(x))?.toList(), | 2647 _executables = json["executables"]?.map((x) => new UnlinkedExecutable.from
Json(x))?.toList(), |
| 2456 _exports = json["exports"]?.map((x) => new UnlinkedExportNonPublic.fromJso
n(x))?.toList(), | 2648 _exports = json["exports"]?.map((x) => new UnlinkedExportNonPublic.fromJso
n(x))?.toList(), |
| 2457 _imports = json["imports"]?.map((x) => new UnlinkedImport.fromJson(x))?.to
List(), | 2649 _imports = json["imports"]?.map((x) => new UnlinkedImport.fromJson(x))?.to
List(), |
| 2458 _parts = json["parts"]?.map((x) => new UnlinkedPart.fromJson(x))?.toList()
, | 2650 _parts = json["parts"]?.map((x) => new UnlinkedPart.fromJson(x))?.toList()
, |
| 2459 _typedefs = json["typedefs"]?.map((x) => new UnlinkedTypedef.fromJson(x))?
.toList(), | 2651 _typedefs = json["typedefs"]?.map((x) => new UnlinkedTypedef.fromJson(x))?
.toList(), |
| 2460 _variables = json["variables"]?.map((x) => new UnlinkedVariable.fromJson(x
))?.toList(); | 2652 _variables = json["variables"]?.map((x) => new UnlinkedVariable.fromJson(x
))?.toList(); |
| 2461 | 2653 |
| 2462 @override | 2654 @override |
| 2463 Map<String, Object> toMap() => { | 2655 Map<String, Object> toMap() => { |
| 2464 "libraryName": libraryName, | 2656 "libraryName": libraryName, |
| 2657 "libraryNameOffset": libraryNameOffset, |
| 2658 "libraryNameLength": libraryNameLength, |
| 2465 "publicNamespace": publicNamespace, | 2659 "publicNamespace": publicNamespace, |
| 2466 "references": references, | 2660 "references": references, |
| 2467 "classes": classes, | 2661 "classes": classes, |
| 2468 "enums": enums, | 2662 "enums": enums, |
| 2469 "executables": executables, | 2663 "executables": executables, |
| 2470 "exports": exports, | 2664 "exports": exports, |
| 2471 "imports": imports, | 2665 "imports": imports, |
| 2472 "parts": parts, | 2666 "parts": parts, |
| 2473 "typedefs": typedefs, | 2667 "typedefs": typedefs, |
| 2474 "variables": variables, | 2668 "variables": variables, |
| 2475 }; | 2669 }; |
| 2476 | 2670 |
| 2477 UnlinkedUnit.fromBuffer(List<int> buffer) : this.fromJson(JSON.decode(UTF8.dec
ode(buffer))); | 2671 UnlinkedUnit.fromBuffer(List<int> buffer) : this.fromJson(JSON.decode(UTF8.dec
ode(buffer))); |
| 2478 | 2672 |
| 2479 /** | 2673 /** |
| 2480 * Name of the library (from a "library" declaration, if present). | 2674 * Name of the library (from a "library" declaration, if present). |
| 2481 */ | 2675 */ |
| 2482 String get libraryName => _libraryName ?? ''; | 2676 String get libraryName => _libraryName ?? ''; |
| 2483 | 2677 |
| 2484 /** | 2678 /** |
| 2679 * Offset of the library name relative to the beginning of the file (or 0 if |
| 2680 * the library has no name). |
| 2681 */ |
| 2682 int get libraryNameOffset => _libraryNameOffset ?? 0; |
| 2683 |
| 2684 /** |
| 2685 * Length of the library name as it appears in the source code (or 0 if the |
| 2686 * library has no name). |
| 2687 */ |
| 2688 int get libraryNameLength => _libraryNameLength ?? 0; |
| 2689 |
| 2690 /** |
| 2485 * Unlinked public namespace of this compilation unit. | 2691 * Unlinked public namespace of this compilation unit. |
| 2486 */ | 2692 */ |
| 2487 UnlinkedPublicNamespace get publicNamespace => _publicNamespace; | 2693 UnlinkedPublicNamespace get publicNamespace => _publicNamespace; |
| 2488 | 2694 |
| 2489 /** | 2695 /** |
| 2490 * Top level and prefixed names referred to by this compilation unit. The | 2696 * Top level and prefixed names referred to by this compilation unit. The |
| 2491 * zeroth element of this array is always populated and always represents a | 2697 * zeroth element of this array is always populated and always represents a |
| 2492 * reference to the pseudo-type "dynamic". | 2698 * reference to the pseudo-type "dynamic". |
| 2493 */ | 2699 */ |
| 2494 List<UnlinkedReference> get references => _references ?? const <UnlinkedRefere
nce>[]; | 2700 List<UnlinkedReference> get references => _references ?? const <UnlinkedRefere
nce>[]; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2547 */ | 2753 */ |
| 2548 void set libraryName(String _value) { | 2754 void set libraryName(String _value) { |
| 2549 assert(!_finished); | 2755 assert(!_finished); |
| 2550 assert(!_json.containsKey("libraryName")); | 2756 assert(!_json.containsKey("libraryName")); |
| 2551 if (_value != null) { | 2757 if (_value != null) { |
| 2552 _json["libraryName"] = _value; | 2758 _json["libraryName"] = _value; |
| 2553 } | 2759 } |
| 2554 } | 2760 } |
| 2555 | 2761 |
| 2556 /** | 2762 /** |
| 2763 * Offset of the library name relative to the beginning of the file (or 0 if |
| 2764 * the library has no name). |
| 2765 */ |
| 2766 void set libraryNameOffset(int _value) { |
| 2767 assert(!_finished); |
| 2768 assert(!_json.containsKey("libraryNameOffset")); |
| 2769 if (_value != null) { |
| 2770 _json["libraryNameOffset"] = _value; |
| 2771 } |
| 2772 } |
| 2773 |
| 2774 /** |
| 2775 * Length of the library name as it appears in the source code (or 0 if the |
| 2776 * library has no name). |
| 2777 */ |
| 2778 void set libraryNameLength(int _value) { |
| 2779 assert(!_finished); |
| 2780 assert(!_json.containsKey("libraryNameLength")); |
| 2781 if (_value != null) { |
| 2782 _json["libraryNameLength"] = _value; |
| 2783 } |
| 2784 } |
| 2785 |
| 2786 /** |
| 2557 * Unlinked public namespace of this compilation unit. | 2787 * Unlinked public namespace of this compilation unit. |
| 2558 */ | 2788 */ |
| 2559 void set publicNamespace(UnlinkedPublicNamespaceBuilder _value) { | 2789 void set publicNamespace(UnlinkedPublicNamespaceBuilder _value) { |
| 2560 assert(!_finished); | 2790 assert(!_finished); |
| 2561 assert(!_json.containsKey("publicNamespace")); | 2791 assert(!_json.containsKey("publicNamespace")); |
| 2562 if (_value != null) { | 2792 if (_value != null) { |
| 2563 _json["publicNamespace"] = _value.finish(); | 2793 _json["publicNamespace"] = _value.finish(); |
| 2564 } | 2794 } |
| 2565 } | 2795 } |
| 2566 | 2796 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2668 | 2898 |
| 2669 List<int> toBuffer() => UTF8.encode(JSON.encode(finish())); | 2899 List<int> toBuffer() => UTF8.encode(JSON.encode(finish())); |
| 2670 | 2900 |
| 2671 Map finish() { | 2901 Map finish() { |
| 2672 assert(!_finished); | 2902 assert(!_finished); |
| 2673 _finished = true; | 2903 _finished = true; |
| 2674 return _json; | 2904 return _json; |
| 2675 } | 2905 } |
| 2676 } | 2906 } |
| 2677 | 2907 |
| 2678 UnlinkedUnitBuilder encodeUnlinkedUnit(base.BuilderContext builderContext, {Stri
ng libraryName, UnlinkedPublicNamespaceBuilder publicNamespace, List<UnlinkedRef
erenceBuilder> references, List<UnlinkedClassBuilder> classes, List<UnlinkedEnum
Builder> enums, List<UnlinkedExecutableBuilder> executables, List<UnlinkedExport
NonPublicBuilder> exports, List<UnlinkedImportBuilder> imports, List<UnlinkedPar
tBuilder> parts, List<UnlinkedTypedefBuilder> typedefs, List<UnlinkedVariableBui
lder> variables}) { | 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}) { |
| 2679 UnlinkedUnitBuilder builder = new UnlinkedUnitBuilder(builderContext); | 2909 UnlinkedUnitBuilder builder = new UnlinkedUnitBuilder(builderContext); |
| 2680 builder.libraryName = libraryName; | 2910 builder.libraryName = libraryName; |
| 2911 builder.libraryNameOffset = libraryNameOffset; |
| 2912 builder.libraryNameLength = libraryNameLength; |
| 2681 builder.publicNamespace = publicNamespace; | 2913 builder.publicNamespace = publicNamespace; |
| 2682 builder.references = references; | 2914 builder.references = references; |
| 2683 builder.classes = classes; | 2915 builder.classes = classes; |
| 2684 builder.enums = enums; | 2916 builder.enums = enums; |
| 2685 builder.executables = executables; | 2917 builder.executables = executables; |
| 2686 builder.exports = exports; | 2918 builder.exports = exports; |
| 2687 builder.imports = imports; | 2919 builder.imports = imports; |
| 2688 builder.parts = parts; | 2920 builder.parts = parts; |
| 2689 builder.typedefs = typedefs; | 2921 builder.typedefs = typedefs; |
| 2690 builder.variables = variables; | 2922 builder.variables = variables; |
| 2691 return builder; | 2923 return builder; |
| 2692 } | 2924 } |
| 2693 | 2925 |
| 2694 /** | 2926 /** |
| 2695 * Unlinked summary information about a top level variable, local variable, or | 2927 * Unlinked summary information about a top level variable, local variable, or |
| 2696 * a field. | 2928 * a field. |
| 2697 */ | 2929 */ |
| 2698 class UnlinkedVariable extends base.SummaryClass { | 2930 class UnlinkedVariable extends base.SummaryClass { |
| 2699 String _name; | 2931 String _name; |
| 2932 int _nameOffset; |
| 2700 UnlinkedTypeRef _type; | 2933 UnlinkedTypeRef _type; |
| 2701 bool _isStatic; | 2934 bool _isStatic; |
| 2702 bool _isFinal; | 2935 bool _isFinal; |
| 2703 bool _isConst; | 2936 bool _isConst; |
| 2704 bool _hasImplicitType; | 2937 bool _hasImplicitType; |
| 2705 | 2938 |
| 2706 UnlinkedVariable.fromJson(Map json) | 2939 UnlinkedVariable.fromJson(Map json) |
| 2707 : _name = json["name"], | 2940 : _name = json["name"], |
| 2941 _nameOffset = json["nameOffset"], |
| 2708 _type = json["type"] == null ? null : new UnlinkedTypeRef.fromJson(json["t
ype"]), | 2942 _type = json["type"] == null ? null : new UnlinkedTypeRef.fromJson(json["t
ype"]), |
| 2709 _isStatic = json["isStatic"], | 2943 _isStatic = json["isStatic"], |
| 2710 _isFinal = json["isFinal"], | 2944 _isFinal = json["isFinal"], |
| 2711 _isConst = json["isConst"], | 2945 _isConst = json["isConst"], |
| 2712 _hasImplicitType = json["hasImplicitType"]; | 2946 _hasImplicitType = json["hasImplicitType"]; |
| 2713 | 2947 |
| 2714 @override | 2948 @override |
| 2715 Map<String, Object> toMap() => { | 2949 Map<String, Object> toMap() => { |
| 2716 "name": name, | 2950 "name": name, |
| 2951 "nameOffset": nameOffset, |
| 2717 "type": type, | 2952 "type": type, |
| 2718 "isStatic": isStatic, | 2953 "isStatic": isStatic, |
| 2719 "isFinal": isFinal, | 2954 "isFinal": isFinal, |
| 2720 "isConst": isConst, | 2955 "isConst": isConst, |
| 2721 "hasImplicitType": hasImplicitType, | 2956 "hasImplicitType": hasImplicitType, |
| 2722 }; | 2957 }; |
| 2723 | 2958 |
| 2724 /** | 2959 /** |
| 2725 * Name of the variable. | 2960 * Name of the variable. |
| 2726 */ | 2961 */ |
| 2727 String get name => _name ?? ''; | 2962 String get name => _name ?? ''; |
| 2728 | 2963 |
| 2729 /** | 2964 /** |
| 2965 * Offset of the variable name relative to the beginning of the file. |
| 2966 */ |
| 2967 int get nameOffset => _nameOffset ?? 0; |
| 2968 |
| 2969 /** |
| 2730 * Declared type of the variable. Note that when strong mode is enabled, the | 2970 * Declared type of the variable. Note that when strong mode is enabled, the |
| 2731 * actual type of the variable may be different due to type inference. | 2971 * actual type of the variable may be different due to type inference. |
| 2732 */ | 2972 */ |
| 2733 UnlinkedTypeRef get type => _type; | 2973 UnlinkedTypeRef get type => _type; |
| 2734 | 2974 |
| 2735 /** | 2975 /** |
| 2736 * Indicates whether the variable is declared using the `static` keyword. | 2976 * Indicates whether the variable is declared using the `static` keyword. |
| 2737 * | 2977 * |
| 2738 * Note that for top level variables, this flag is false, since they are not | 2978 * Note that for top level variables, this flag is false, since they are not |
| 2739 * declared using the `static` keyword (even though they are considered | 2979 * declared using the `static` keyword (even though they are considered |
| (...skipping 29 matching lines...) Expand all Loading... |
| 2769 */ | 3009 */ |
| 2770 void set name(String _value) { | 3010 void set name(String _value) { |
| 2771 assert(!_finished); | 3011 assert(!_finished); |
| 2772 assert(!_json.containsKey("name")); | 3012 assert(!_json.containsKey("name")); |
| 2773 if (_value != null) { | 3013 if (_value != null) { |
| 2774 _json["name"] = _value; | 3014 _json["name"] = _value; |
| 2775 } | 3015 } |
| 2776 } | 3016 } |
| 2777 | 3017 |
| 2778 /** | 3018 /** |
| 3019 * Offset of the variable name relative to the beginning of the file. |
| 3020 */ |
| 3021 void set nameOffset(int _value) { |
| 3022 assert(!_finished); |
| 3023 assert(!_json.containsKey("nameOffset")); |
| 3024 if (_value != null) { |
| 3025 _json["nameOffset"] = _value; |
| 3026 } |
| 3027 } |
| 3028 |
| 3029 /** |
| 2779 * Declared type of the variable. Note that when strong mode is enabled, the | 3030 * Declared type of the variable. Note that when strong mode is enabled, the |
| 2780 * actual type of the variable may be different due to type inference. | 3031 * actual type of the variable may be different due to type inference. |
| 2781 */ | 3032 */ |
| 2782 void set type(UnlinkedTypeRefBuilder _value) { | 3033 void set type(UnlinkedTypeRefBuilder _value) { |
| 2783 assert(!_finished); | 3034 assert(!_finished); |
| 2784 assert(!_json.containsKey("type")); | 3035 assert(!_json.containsKey("type")); |
| 2785 if (_value != null) { | 3036 if (_value != null) { |
| 2786 _json["type"] = _value.finish(); | 3037 _json["type"] = _value.finish(); |
| 2787 } | 3038 } |
| 2788 } | 3039 } |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2835 } | 3086 } |
| 2836 } | 3087 } |
| 2837 | 3088 |
| 2838 Map finish() { | 3089 Map finish() { |
| 2839 assert(!_finished); | 3090 assert(!_finished); |
| 2840 _finished = true; | 3091 _finished = true; |
| 2841 return _json; | 3092 return _json; |
| 2842 } | 3093 } |
| 2843 } | 3094 } |
| 2844 | 3095 |
| 2845 UnlinkedVariableBuilder encodeUnlinkedVariable(base.BuilderContext builderContex
t, {String name, UnlinkedTypeRefBuilder type, bool isStatic, bool isFinal, bool
isConst, bool hasImplicitType}) { | 3096 UnlinkedVariableBuilder encodeUnlinkedVariable(base.BuilderContext builderContex
t, {String name, int nameOffset, UnlinkedTypeRefBuilder type, bool isStatic, boo
l isFinal, bool isConst, bool hasImplicitType}) { |
| 2846 UnlinkedVariableBuilder builder = new UnlinkedVariableBuilder(builderContext); | 3097 UnlinkedVariableBuilder builder = new UnlinkedVariableBuilder(builderContext); |
| 2847 builder.name = name; | 3098 builder.name = name; |
| 3099 builder.nameOffset = nameOffset; |
| 2848 builder.type = type; | 3100 builder.type = type; |
| 2849 builder.isStatic = isStatic; | 3101 builder.isStatic = isStatic; |
| 2850 builder.isFinal = isFinal; | 3102 builder.isFinal = isFinal; |
| 2851 builder.isConst = isConst; | 3103 builder.isConst = isConst; |
| 2852 builder.hasImplicitType = hasImplicitType; | 3104 builder.hasImplicitType = hasImplicitType; |
| 2853 return builder; | 3105 return builder; |
| 2854 } | 3106 } |
| 2855 | 3107 |
| OLD | NEW |