fix the structure which declared with some members at one line

This patch will fix the following structure:
	typedef struct {
	      double x, y, z, w;
	} CMQuaternion
This commit is contained in:
Watson
2012-11-07 16:36:14 +09:00
parent 1b3f388331
commit 30e285960f

View File

@@ -302,10 +302,22 @@ class DocsetGenerator
code << "# #{sanitize(abstract)}\n"
code << "class #{name} < Boxed\n"
members = members.inject([]) { |ary, item|
# split 'double x, y, z, w;' to each line
item.strip =~ /([^\s]+)\s+(.+)/
type = $1
member = $2
if type && member
member.split(",").each do |m|
ary << "#{type} #{m}"
end
end
ary
}
node_field_description = node_termdef.xpath("dd")
members.each_with_index do |item, index|
item = item.strip
item =~ /(.+)\s+(.+)/
item.strip =~ /(.+)\s+(.+)/
type = $1
member = $2
desc = node_field_description[index]