CGrammar: Function prototypes can appear in delcaration section

This commit is contained in:
Pragmatic Software 2014-06-12 14:19:39 +00:00
parent 0f5dbeda7a
commit 9597833b32
2 changed files with 3 additions and 2 deletions

View File

@ -13,7 +13,7 @@ use warnings;
# These are set automatically by the build/commit script
use constant {
BUILD_NAME => "PBot",
BUILD_REVISION => 635,
BUILD_REVISION => 636,
BUILD_DATE => "2014-06-12",
};

View File

@ -614,7 +614,8 @@ declaration_list:
{ $return = join('', @{$item{'preproc(?)'}}) . join('', @{$item{'declaration(s)'}}); }
declaration:
declaration_specifiers init_declarator_list(?) ';'
function_prototype
| declaration_specifiers init_declarator_list(?) ';'
{
# This whole thing needs to be re-written to parse declarations inside-out.
my @init_list = defined $item{'init_declarator_list(?)'}->[0] ? @{$item{'init_declarator_list(?)'}->[0]} : ('');