diff --git a/pkgs/swiftgen/swift2objc/lib/src/ast/_core/interfaces/compund_declaration.dart b/pkgs/swiftgen/swift2objc/lib/src/ast/_core/interfaces/compound_declaration.dart similarity index 82% rename from pkgs/swiftgen/swift2objc/lib/src/ast/_core/interfaces/compund_declaration.dart rename to pkgs/swiftgen/swift2objc/lib/src/ast/_core/interfaces/compound_declaration.dart index 2a95fb784..3c6e1d0ab 100644 --- a/pkgs/swiftgen/swift2objc/lib/src/ast/_core/interfaces/compund_declaration.dart +++ b/pkgs/swiftgen/swift2objc/lib/src/ast/_core/interfaces/compound_declaration.dart @@ -2,16 +2,16 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'confomingable.dart'; +import 'protocol_conformable.dart'; import 'declaration.dart'; -import 'genericable.dart'; +import 'type_parameterizable.dart'; import '../shared/referred_type.dart'; -import 'paramable.dart'; +import 'parameterizable.dart'; /// An interface for the declaration of all compound Swift entities. See `ClassDeclaration`, /// `StructDeclaration` and `ProtocolDeclaration` for concrete implementations. abstract interface class CompoundDeclaration - implements Declaration, Genericable, Conformingable { + implements Declaration, TypeParameterizable, ProtocolConformable { abstract List properties; abstract List methods; } @@ -26,6 +26,6 @@ abstract interface class CompoundPropertyDeclaration implements Declaration { /// An interface for a compound method. See `ClassMethodDeclaration`, /// `StructMethodDeclaration` and `ProtocolMethodDeclaration` for concrete implementations. abstract interface class CompoundMethodDeclaration - implements Declaration, Genericable, Paramable { + implements Declaration, TypeParameterizable, Parameterizable { abstract ReferredType returnType; } diff --git a/pkgs/swiftgen/swift2objc/lib/src/ast/_core/interfaces/enum_declaration.dart b/pkgs/swiftgen/swift2objc/lib/src/ast/_core/interfaces/enum_declaration.dart index 9e486f300..eea5c9e0a 100644 --- a/pkgs/swiftgen/swift2objc/lib/src/ast/_core/interfaces/enum_declaration.dart +++ b/pkgs/swiftgen/swift2objc/lib/src/ast/_core/interfaces/enum_declaration.dart @@ -2,14 +2,14 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'confomingable.dart'; +import 'protocol_conformable.dart'; import 'declaration.dart'; -import 'genericable.dart'; +import 'type_parameterizable.dart'; /// An interface for describing the declaration of a Swift enum. See `NormalEnumDeclaration`, /// `AssociatedValueEnumDeclaration` and `RawValueEnumDeclaration` for concrete implementations. abstract interface class EnumDeclaration - implements Declaration, Genericable, Conformingable { + implements Declaration, TypeParameterizable, ProtocolConformable { abstract List cases; } diff --git a/pkgs/swiftgen/swift2objc/lib/src/ast/_core/interfaces/paramable.dart b/pkgs/swiftgen/swift2objc/lib/src/ast/_core/interfaces/parameterizable.dart similarity index 89% rename from pkgs/swiftgen/swift2objc/lib/src/ast/_core/interfaces/paramable.dart rename to pkgs/swiftgen/swift2objc/lib/src/ast/_core/interfaces/parameterizable.dart index b68a200a7..5719f7c2c 100644 --- a/pkgs/swiftgen/swift2objc/lib/src/ast/_core/interfaces/paramable.dart +++ b/pkgs/swiftgen/swift2objc/lib/src/ast/_core/interfaces/parameterizable.dart @@ -5,6 +5,6 @@ import '../shared/parameter.dart'; /// An interface to describe a Swift entity's ability to have parameters (e.g functions). -abstract interface class Paramable { +abstract interface class Parameterizable { abstract List params; } diff --git a/pkgs/swiftgen/swift2objc/lib/src/ast/_core/interfaces/confomingable.dart b/pkgs/swiftgen/swift2objc/lib/src/ast/_core/interfaces/protocol_conformable.dart similarity index 90% rename from pkgs/swiftgen/swift2objc/lib/src/ast/_core/interfaces/confomingable.dart rename to pkgs/swiftgen/swift2objc/lib/src/ast/_core/interfaces/protocol_conformable.dart index b6e05e99a..8de8249a2 100644 --- a/pkgs/swiftgen/swift2objc/lib/src/ast/_core/interfaces/confomingable.dart +++ b/pkgs/swiftgen/swift2objc/lib/src/ast/_core/interfaces/protocol_conformable.dart @@ -6,6 +6,6 @@ import '../../declarations/compounds/protocol_declaration.dart'; import '../shared/referred_type.dart'; /// An interface to describe a Swift entity's ability to confom to protocols. -abstract interface class Conformingable { +abstract interface class ProtocolConformable { abstract List> conformedProtocols; } diff --git a/pkgs/swiftgen/swift2objc/lib/src/ast/_core/interfaces/genericable.dart b/pkgs/swiftgen/swift2objc/lib/src/ast/_core/interfaces/type_parameterizable.dart similarity index 79% rename from pkgs/swiftgen/swift2objc/lib/src/ast/_core/interfaces/genericable.dart rename to pkgs/swiftgen/swift2objc/lib/src/ast/_core/interfaces/type_parameterizable.dart index b86c11b5e..6be55e545 100644 --- a/pkgs/swiftgen/swift2objc/lib/src/ast/_core/interfaces/genericable.dart +++ b/pkgs/swiftgen/swift2objc/lib/src/ast/_core/interfaces/type_parameterizable.dart @@ -5,6 +5,6 @@ import '../shared/referred_type.dart'; /// An interface to describe a Swift entity's ability to have generic parameters. -abstract interface class Genericable { - abstract List genericParams; +abstract interface class TypeParameterizable { + abstract List typeParams; } diff --git a/pkgs/swiftgen/swift2objc/lib/src/ast/_core/shared/referred_type.dart b/pkgs/swiftgen/swift2objc/lib/src/ast/_core/shared/referred_type.dart index 278932840..90d8604a2 100644 --- a/pkgs/swiftgen/swift2objc/lib/src/ast/_core/shared/referred_type.dart +++ b/pkgs/swiftgen/swift2objc/lib/src/ast/_core/shared/referred_type.dart @@ -4,7 +4,7 @@ import '../interfaces/declaration.dart'; -/// Describes a type regerence in declaration of Swift entities (e.g a method return type). +/// Describes a type reference in declaration of Swift entities (e.g a method return type). /// See `DeclaredType` and `GenericType` for concrete implementation. abstract class ReferredType { String id; @@ -12,17 +12,19 @@ abstract class ReferredType { ReferredType({required this.id}); } +/// Describes a reference of a user-defined type. class DeclaredType extends ReferredType { T declaration; - List genericParams; + List typeParams; DeclaredType({ required super.id, required this.declaration, - required this.genericParams, + required this.typeParams, }); } +/// Describes a reference of a generic type (e.g a method return type `T` within a generic class). class GenericType extends ReferredType { String name; diff --git a/pkgs/swiftgen/swift2objc/lib/src/ast/declarations/compounds/class_declaration.dart b/pkgs/swiftgen/swift2objc/lib/src/ast/declarations/compounds/class_declaration.dart index ebce6fc4b..8f257a235 100644 --- a/pkgs/swiftgen/swift2objc/lib/src/ast/declarations/compounds/class_declaration.dart +++ b/pkgs/swiftgen/swift2objc/lib/src/ast/declarations/compounds/class_declaration.dart @@ -2,7 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import '../../_core/interfaces/compund_declaration.dart'; +import '../../_core/interfaces/compound_declaration.dart'; import '../../_core/interfaces/objc_annotatable.dart'; import '../../_core/shared/parameter.dart'; import '../../_core/shared/referred_type.dart'; @@ -26,7 +26,7 @@ class ClassDeclaration implements CompoundDeclaration, ObjCAnnotatable { List> conformedProtocols; @override - List genericParams; + List typeParams; @override bool hasObjCAnnotation; @@ -39,7 +39,7 @@ class ClassDeclaration implements CompoundDeclaration, ObjCAnnotatable { required this.properties, required this.methods, required this.conformedProtocols, - required this.genericParams, + required this.typeParams, required this.hasObjCAnnotation, this.superClass, }); @@ -85,7 +85,7 @@ class ClassMethodDeclaration List params; @override - List genericParams; + List typeParams; @override ReferredType returnType; @@ -97,7 +97,7 @@ class ClassMethodDeclaration required this.id, required this.name, required this.params, - required this.genericParams, + required this.typeParams, required this.returnType, required this.hasObjCAnnotation, }); diff --git a/pkgs/swiftgen/swift2objc/lib/src/ast/declarations/compounds/protocol_declaration.dart b/pkgs/swiftgen/swift2objc/lib/src/ast/declarations/compounds/protocol_declaration.dart index dda1f8945..f99507cdf 100644 --- a/pkgs/swiftgen/swift2objc/lib/src/ast/declarations/compounds/protocol_declaration.dart +++ b/pkgs/swiftgen/swift2objc/lib/src/ast/declarations/compounds/protocol_declaration.dart @@ -2,7 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import '../../_core/interfaces/compund_declaration.dart'; +import '../../_core/interfaces/compound_declaration.dart'; import '../../_core/shared/parameter.dart'; import '../../_core/shared/referred_type.dart'; @@ -24,7 +24,7 @@ class ProtocolDeclaration implements CompoundDeclaration { List> conformedProtocols; @override - List genericParams; + List typeParams; ProtocolDeclaration({ required this.id, @@ -32,7 +32,7 @@ class ProtocolDeclaration implements CompoundDeclaration { required this.properties, required this.methods, required this.conformedProtocols, - required this.genericParams, + required this.typeParams, }); } @@ -70,7 +70,7 @@ class ProtocolMethodDeclaration implements CompoundMethodDeclaration { List params; @override - List genericParams; + List typeParams; @override ReferredType returnType; @@ -79,7 +79,7 @@ class ProtocolMethodDeclaration implements CompoundMethodDeclaration { required this.id, required this.name, required this.params, - required this.genericParams, + required this.typeParams, required this.returnType, }); } diff --git a/pkgs/swiftgen/swift2objc/lib/src/ast/declarations/compounds/struct_declaration.dart b/pkgs/swiftgen/swift2objc/lib/src/ast/declarations/compounds/struct_declaration.dart index 315b24d0c..d4238bd70 100644 --- a/pkgs/swiftgen/swift2objc/lib/src/ast/declarations/compounds/struct_declaration.dart +++ b/pkgs/swiftgen/swift2objc/lib/src/ast/declarations/compounds/struct_declaration.dart @@ -2,7 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import '../../_core/interfaces/compund_declaration.dart'; +import '../../_core/interfaces/compound_declaration.dart'; import '../../_core/shared/parameter.dart'; import '../../_core/shared/referred_type.dart'; import 'protocol_declaration.dart'; @@ -25,7 +25,7 @@ class StructDeclaration implements CompoundDeclaration { List> conformedProtocols; @override - List genericParams; + List typeParams; StructDeclaration({ required this.id, @@ -33,7 +33,7 @@ class StructDeclaration implements CompoundDeclaration { required this.properties, required this.methods, required this.conformedProtocols, - required this.genericParams, + required this.typeParams, }); } @@ -71,7 +71,7 @@ class StructMethodDeclaration implements CompoundMethodDeclaration { List params; @override - List genericParams; + List typeParams; @override ReferredType returnType; @@ -80,7 +80,7 @@ class StructMethodDeclaration implements CompoundMethodDeclaration { required this.id, required this.name, required this.params, - required this.genericParams, + required this.typeParams, required this.returnType, }); } diff --git a/pkgs/swiftgen/swift2objc/lib/src/ast/declarations/enums/associated_value_enum_declaration.dart b/pkgs/swiftgen/swift2objc/lib/src/ast/declarations/enums/associated_value_enum_declaration.dart index e8216330c..45c2d53e6 100644 --- a/pkgs/swiftgen/swift2objc/lib/src/ast/declarations/enums/associated_value_enum_declaration.dart +++ b/pkgs/swiftgen/swift2objc/lib/src/ast/declarations/enums/associated_value_enum_declaration.dart @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. import '../../_core/interfaces/enum_declaration.dart'; -import '../../_core/interfaces/paramable.dart'; +import '../../_core/interfaces/parameterizable.dart'; import '../../_core/shared/parameter.dart'; import '../../_core/shared/referred_type.dart'; import '../compounds/protocol_declaration.dart'; @@ -20,7 +20,7 @@ class AssociatedValueEnumDeclaration implements EnumDeclaration { covariant List cases; @override - List genericParams; + List typeParams; @override List> conformedProtocols; @@ -29,13 +29,13 @@ class AssociatedValueEnumDeclaration implements EnumDeclaration { required this.id, required this.name, required this.cases, - required this.genericParams, + required this.typeParams, required this.conformedProtocols, }); } /// Describes the declaration of a Swift enum case with associated values. -class AssociatedValueEnumCase implements EnumCase, Paramable { +class AssociatedValueEnumCase implements EnumCase, Parameterizable { @override String id; diff --git a/pkgs/swiftgen/swift2objc/lib/src/ast/declarations/enums/normal_enum_declaration.dart b/pkgs/swiftgen/swift2objc/lib/src/ast/declarations/enums/normal_enum_declaration.dart index f761f34b1..3aa357717 100644 --- a/pkgs/swiftgen/swift2objc/lib/src/ast/declarations/enums/normal_enum_declaration.dart +++ b/pkgs/swiftgen/swift2objc/lib/src/ast/declarations/enums/normal_enum_declaration.dart @@ -18,7 +18,7 @@ class NormalEnumDeclaration implements EnumDeclaration { covariant List cases; @override - List genericParams; + List typeParams; @override List> conformedProtocols; @@ -27,7 +27,7 @@ class NormalEnumDeclaration implements EnumDeclaration { required this.id, required this.name, required this.cases, - required this.genericParams, + required this.typeParams, required this.conformedProtocols, }); } diff --git a/pkgs/swiftgen/swift2objc/lib/src/ast/declarations/enums/raw_value_enum_declaration.dart b/pkgs/swiftgen/swift2objc/lib/src/ast/declarations/enums/raw_value_enum_declaration.dart index a2a65507e..75d8e158a 100644 --- a/pkgs/swiftgen/swift2objc/lib/src/ast/declarations/enums/raw_value_enum_declaration.dart +++ b/pkgs/swiftgen/swift2objc/lib/src/ast/declarations/enums/raw_value_enum_declaration.dart @@ -19,7 +19,7 @@ class RawValueEnumDeclaration implements EnumDeclaration, ObjCAnnotatable { covariant List> cases; @override - List genericParams; + List typeParams; @override List> conformedProtocols; @@ -33,7 +33,7 @@ class RawValueEnumDeclaration implements EnumDeclaration, ObjCAnnotatable { required this.id, required this.name, required this.cases, - required this.genericParams, + required this.typeParams, required this.conformedProtocols, required this.hasObjCAnnotation, required this.rawValueType, diff --git a/pkgs/swiftgen/swift2objc/lib/src/ast/declarations/globals/globals.dart b/pkgs/swiftgen/swift2objc/lib/src/ast/declarations/globals/globals.dart index 148a3f9f3..cb4d1d3d5 100644 --- a/pkgs/swiftgen/swift2objc/lib/src/ast/declarations/globals/globals.dart +++ b/pkgs/swiftgen/swift2objc/lib/src/ast/declarations/globals/globals.dart @@ -3,8 +3,8 @@ // BSD-style license that can be found in the LICENSE file. import '../../_core/interfaces/declaration.dart'; -import '../../_core/interfaces/genericable.dart'; -import '../../_core/interfaces/paramable.dart'; +import '../../_core/interfaces/type_parameterizable.dart'; +import '../../_core/interfaces/parameterizable.dart'; import '../../_core/shared/parameter.dart'; import '../../_core/shared/referred_type.dart'; @@ -20,7 +20,8 @@ class Globals { } /// Describes a globally defined function. -class GlobalFunction implements Declaration, Paramable, Genericable { +class GlobalFunction + implements Declaration, Parameterizable, TypeParameterizable { @override String id; @@ -31,7 +32,7 @@ class GlobalFunction implements Declaration, Paramable, Genericable { List params; @override - List genericParams; + List typeParams; ReferredType returnType; @@ -39,7 +40,7 @@ class GlobalFunction implements Declaration, Paramable, Genericable { required this.id, required this.name, required this.params, - required this.genericParams, + required this.typeParams, required this.returnType, }); }