For struct-fields of an enum type store references to the enum instead of just their name
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5430 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
ba1df9e976
commit
3f0b1959f2
|
@ -62,8 +62,7 @@ sub postProcessField
|
|||
|
||||
if (/set/)
|
||||
{
|
||||
my $enumName = ${$field}{"enum"};
|
||||
my $enum = ${$enumMap}{$enumName};
|
||||
my $enum = ${$field}{"enum"};
|
||||
my $enumSize = @{${$enum}{"values"}};
|
||||
|
||||
$$output .= "\[${enumSize}]" if (/set/);
|
||||
|
|
|
@ -128,7 +128,9 @@ sub parseStruct
|
|||
# Parse set and enum field declarations
|
||||
elsif (/^\s*(set|enum)\s+(\w+)\s+(unique\s+)?(\w+)\s*;\s*$/)
|
||||
{
|
||||
my %field = (type=>$1, enum=>$2, name=>$4);
|
||||
die "error: Cannot use enum \"$2\" as it isn't declared yet" unless exists($enumMap{$2});
|
||||
|
||||
my %field = (type=>$1, enum=>$enumMap{$2}, name=>$4);
|
||||
|
||||
push @{$field{"qualifiers"}}, $3 if $3;
|
||||
|
||||
|
|
|
@ -33,8 +33,7 @@ sub printStructFields
|
|||
|
||||
if (${$field}{"type"} and ${$field}{"type"} =~ /set/)
|
||||
{
|
||||
my $enumName = ${$field}{"enum"};
|
||||
my $enum = ${$enumMap}{$enumName};
|
||||
my $enum = ${$field}{"enum"};
|
||||
my @values = @{${$enum}{"values"}};
|
||||
|
||||
while (@values)
|
||||
|
|
|
@ -59,8 +59,7 @@ sub printStructFields
|
|||
|
||||
if (${$field}{"type"} and ${$field}{"type"} =~ /set/)
|
||||
{
|
||||
my $enumName = ${$field}{"enum"};
|
||||
my $enum = ${$enumMap}{$enumName};
|
||||
my $enum = ${$field}{"enum"};
|
||||
my @values = @{${$enum}{"values"}};
|
||||
my $unique_string = "UNIQUE(";
|
||||
|
||||
|
|
Loading…
Reference in New Issue