diff --git a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_compound_declaration.dart b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_compound_declaration.dart index cf3e9a27a..0940833db 100644 --- a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_compound_declaration.dart +++ b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_compound_declaration.dart @@ -8,6 +8,7 @@ import '../../../ast/declarations/compounds/class_declaration.dart'; import '../../../ast/declarations/compounds/members/initializer_declaration.dart'; import '../../../ast/declarations/compounds/members/method_declaration.dart'; import '../../../ast/declarations/compounds/members/property_declaration.dart'; +import '../../../ast/declarations/compounds/protocol_declaration.dart'; import '../../../ast/declarations/compounds/struct_declaration.dart'; import '../../_core/parsed_symbolgraph.dart'; import '../../_core/utils.dart'; @@ -107,3 +108,12 @@ StructDeclaration parseStructDeclaration( symbolgraph, ); } + +// This won't work as there's more for a protocol declaration +// Placing this here as placeholder declaration +ProtocolDeclaration parseProtocolDeclaration( + ParsedSymbol protocolSymbol, + ParsedSymbolgraph symbolgraph +) { + return _parseCompoundDeclaration(protocolSymbol, ProtocolDeclaration.new, symbolgraph); +} \ No newline at end of file diff --git a/pkgs/swift2objc/lib/src/parser/parsers/parse_declarations.dart b/pkgs/swift2objc/lib/src/parser/parsers/parse_declarations.dart index 36b74c4f4..ff2bf50eb 100644 --- a/pkgs/swift2objc/lib/src/parser/parsers/parse_declarations.dart +++ b/pkgs/swift2objc/lib/src/parser/parsers/parse_declarations.dart @@ -56,6 +56,7 @@ Declaration parseDeclaration( 'swift.init' => parseInitializerDeclaration(symbolJson, symbolgraph), 'swift.func' => parseGlobalFunctionDeclaration(symbolJson, symbolgraph), 'swift.var' => parseGlobalVariableDeclaration(symbolJson, symbolgraph), + 'swift.protocol' => parseProtocolDeclaration(parsedSymbol, symbolgraph), _ => throw Exception( 'Symbol of type $symbolType is not implemented yet.', ),