3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-26 22:09:26 +01:00

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 # These are set automatically by the build/commit script
use constant { use constant {
BUILD_NAME => "PBot", BUILD_NAME => "PBot",
BUILD_REVISION => 635, BUILD_REVISION => 636,
BUILD_DATE => "2014-06-12", BUILD_DATE => "2014-06-12",
}; };

View File

@ -614,7 +614,8 @@ declaration_list:
{ $return = join('', @{$item{'preproc(?)'}}) . join('', @{$item{'declaration(s)'}}); } { $return = join('', @{$item{'preproc(?)'}}) . join('', @{$item{'declaration(s)'}}); }
declaration: 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. # 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]} : (''); my @init_list = defined $item{'init_declarator_list(?)'}->[0] ? @{$item{'init_declarator_list(?)'}->[0]} : ('');