lib/yard/handlers/ruby/legacy/method_handler.rb in yard-0.8.5.2 vs lib/yard/handlers/ruby/legacy/method_handler.rb in yard-0.8.6
- old
+ new
@@ -8,10 +8,17 @@
if statement.tokens.to_s =~ /^def\s+(#{METHODMATCH})(?:(?:\s+|\s*\()(.*)(?:\)\s*$)?)?/m
meth, args = $1, $2
meth.gsub!(/\s+/,'')
args = tokval_list(YARD::Parser::Ruby::Legacy::TokenList.new(args), :all)
- args.map! {|a| k, v = *a.split('=', 2); [k.strip, (v ? v.strip : nil)] } if args
+ args.map! do |a|
+ k, v, r = *a.split(/(:)|=/, 2)
+ if r
+ k += v
+ v = r
+ end
+ [k.strip, (v ? v.strip : nil)]
+ end if args
else
raise YARD::Parser::UndocumentableError, "method: invalid name"
end
# Class method if prefixed by self(::|.) or Module(::|.)