From 861f095829e5a38bd305f52b9b8ac20b783a8811 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Tue, 17 Jun 2014 23:51:55 +0000 Subject: [PATCH] CGrammar: Fix const pointers --- PBot/VERSION.pm | 2 +- modules/c2english/CGrammar.pm | 13 ++++--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/PBot/VERSION.pm b/PBot/VERSION.pm index bbc27ea3..afbfdd87 100644 --- a/PBot/VERSION.pm +++ b/PBot/VERSION.pm @@ -13,7 +13,7 @@ use warnings; # These are set automatically by the build/commit script use constant { BUILD_NAME => "PBot", - BUILD_REVISION => 650, + BUILD_REVISION => 651, BUILD_DATE => "2014-06-17", }; diff --git a/modules/c2english/CGrammar.pm b/modules/c2english/CGrammar.pm index f690a7ea..fa358838 100644 --- a/modules/c2english/CGrammar.pm +++ b/modules/c2english/CGrammar.pm @@ -1209,18 +1209,13 @@ identifier: pointer: '*' type_qualifier_list(s) pointer(?) { - $return = 'a pointer to a ' . join('', @{$item{'type_qualifier_list(s)'}}); + $return = join('', @{$item{'type_qualifier_list(s)'}}) . ' pointer to a '; $return .= ' ' . join('', @{$item{'pointer(?)'}}) if @{$item{'pointer(?)'}}; } - | ('*')(s) + | '*' pointer(?) { - my $size = $#{$item[1]} +1 ; - if ($size > 1) { - while($size-- > 1) { - $return .= 'pointer to '; - } - } - $return .= 'pointer to'; + $return .= 'pointer to a'; + $return .= ' ' . join('', @{$item{'pointer(?)'}}); } type_qualifier_list: