Generate multi-line SELECT statements instead of single-line ones

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5372 4a71c877-e1ca-e34f-864e-861f7616d084
master
Giel van Schijndel 2008-07-03 20:03:38 +00:00
parent 0cf5917686
commit 00ffe3f55d
1 changed files with 10 additions and 7 deletions

View File

@ -29,6 +29,8 @@ sub printStructFields
{ {
my $field = shift(@fields); my $field = shift(@fields);
printComments ${$field}{"comment"}, 1;
if (${$field}{"type"} and ${$field}{"type"} =~ /set/) if (${$field}{"type"} and ${$field}{"type"} =~ /set/)
{ {
my $enumName = ${$field}{"enum"}; my $enumName = ${$field}{"enum"};
@ -39,16 +41,16 @@ sub printStructFields
{ {
my $value = shift(@values); my $value = shift(@values);
print "`$structName`.`${$field}{\"name\"}_${$value}{\"name\"}`"; print "\t`$structName`.`${$field}{\"name\"}_${$value}{\"name\"}`";
print ", " if @values; print ",\n" if @values;
} }
} }
else else
{ {
print "`$structName`.`${$field}{\"name\"}`"; print "\t`$structName`.`${$field}{\"name\"}`";
} }
print ", " if @fields; print ",\n\n" if @fields;
} }
} }
@ -67,12 +69,13 @@ sub printStructContent
} }
elsif (/abstract/) elsif (/abstract/)
{ {
print "`${$struct}{\"name\"}`.`unique_inheritance_id`, "; print "`${$struct}{\"name\"}`.`unique_inheritance_id`,\n\n";
} }
} }
printStructFields($struct, $enumMap); printStructFields($struct, $enumMap);
print ", " unless $first; print ",\n" unless $first;
print "\n";
} }
sub printBaseStruct sub printBaseStruct