Skip to content

Commit

Permalink
Initial commit for branch
Browse files Browse the repository at this point in the history
  • Loading branch information
nikeokoronkwo committed Dec 18, 2024
1 parent 8c16b6c commit b0c806f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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);
}
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
),
Expand Down

0 comments on commit b0c806f

Please sign in to comment.