We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 72a8746 commit 3133d0eCopy full SHA for 3133d0e
SwiftConversion/objc_conversion_analyzer.rb
@@ -87,9 +87,15 @@ def extract_classes(content)
87
def extract_protocols(content)
88
protocols = []
89
90
- # Look for @protocol declarations
91
- content.scan(/@protocol\s+(\w+)/).each do |match|
92
- protocols << match[0]
+ # Look for @protocol declarations, but skip forward declarations ending with semicolon
+ content.scan(/@protocol\s+(\w+)(.*)/).each do |match|
+ protocol_name = match[0]
93
+ remaining_line = match[1]
94
+
95
+ # Skip forward declarations (those that end with semicolon immediately after the name)
96
+ next if remaining_line.strip == ";"
97
98
+ protocols << protocol_name
99
end
100
101
protocols.uniq
0 commit comments