remove the ')' in method declaration which has the handler argument

Because the following method is converted with strange syntax

  - (UIBackgroundTaskIdentifier)beginBackgroundTaskWithExpirationHandler:(void (^)(void))handler

after converting:

  def beginBackgroundTaskWithExpirationHandler()handler); end
This commit is contained in:
Watson
2012-11-01 13:14:58 +09:00
parent b2b50d52f6
commit 595820e2de

View File

@@ -109,7 +109,7 @@ class DocsetGenerator
is_class_method = decl.match(/^\s*\+/) != nil
decl.sub!(/^\s*[\+\-]/, '') # Remove method qualifier.
decl.sub!(/;\s*$/, '')
sel_parts = decl.gsub(/\([^)]+\)/, '').split.map { |x| x.split(':') }
sel_parts = decl.gsub(/\([^)]+\)+/, '').split.map { |x| x.split(':') }
head = sel_parts.shift
code << " def #{is_class_method ? 'self.' : ''}#{head[0]}("
code << "#{head[1]}" if head.size > 1