mirror of
https://github.com/pragma-/pbot.git
synced 2024-12-24 11:42:35 +01:00
CGrammar: Wrap struct/union member declaration list with commas to disambiguate nested structs/unions
This commit is contained in:
parent
8b72c03d34
commit
8b626cc81e
@ -13,7 +13,7 @@ use warnings;
|
|||||||
# These are set automatically by the build/commit script
|
# These are set automatically by the build/commit script
|
||||||
use constant {
|
use constant {
|
||||||
BUILD_NAME => "PBot",
|
BUILD_NAME => "PBot",
|
||||||
BUILD_REVISION => 699,
|
BUILD_REVISION => 700,
|
||||||
BUILD_DATE => "2014-07-03",
|
BUILD_DATE => "2014-07-03",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -788,6 +788,7 @@ declaration:
|
|||||||
$return .= " $initializers[0]->[1]";
|
$return .= " $initializers[0]->[1]";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$return =~ s/,$//;
|
||||||
$return .= ".\n" unless $arg{context} eq 'for init';
|
$return .= ".\n" unless $arg{context} eq 'for init';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1552,7 +1553,7 @@ struct_or_union_specifier:
|
|||||||
$return = join('',@{$item{'comment(?)'}}) . $item{struct_or_union};
|
$return = join('',@{$item{'comment(?)'}}) . $item{struct_or_union};
|
||||||
if ($identifier) { $return .= " tagged $identifier"; }
|
if ($identifier) { $return .= " tagged $identifier"; }
|
||||||
my $plural = $item{struct_declaration_list} =~ / and / ? 's' : '';
|
my $plural = $item{struct_declaration_list} =~ / and / ? 's' : '';
|
||||||
$return .= " with member$plural $item{struct_declaration_list}";
|
$return .= ", with member$plural $item{struct_declaration_list},";
|
||||||
}
|
}
|
||||||
| struct_or_union identifier
|
| struct_or_union identifier
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user