lib/docurium/cparser.rb in docurium-0.3.0 vs lib/docurium/cparser.rb in docurium-0.3.1
- old
+ new
@@ -212,19 +212,21 @@
# Process function prototype and comments
def parse_function(d)
d[:args] = []
- rval, argline = d[:decl].split(/\s*#{Regexp.quote(d[:name])}\s*/, 2)
+ rval, argline = d[:decl].split(/\s*#{Regexp.quote(d[:name])}\(\s*/, 2)
# clean up rval if it is like "extern static int" or "GIT_EXTERN(int)"
while rval =~ /[A-Za-z0-9_]+\(([^\)]+)\)$/i
rval = $1
end
rval.gsub!(/extern|static/, '')
rval.strip!
d[:return] = { :type => rval }
+ # we removed the opening parenthesis, which this is expecting
+ argline = '(' + argline
# clean up argline
argline = argline.slice(1..-2) while argline[0] == ?( && argline[-1] == ?)
d[:argline] = argline.strip
d[:args] = []
left = 0