From f1372944291324d6b26589f641975a8f8ba2cd66 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Sat, 21 Jun 2014 01:36:24 +0000 Subject: [PATCH] CGrammar: Change parameter declarations from "int `i`" to "`i` as int" --- PBot/VERSION.pm | 2 +- modules/c2english/CGrammar.pm | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/PBot/VERSION.pm b/PBot/VERSION.pm index b5efc12b..c92d1fdc 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 => 661, + BUILD_REVISION => 662, BUILD_DATE => "2014-06-20", }; diff --git a/modules/c2english/CGrammar.pm b/modules/c2english/CGrammar.pm index df0fff3a..a9b171dc 100644 --- a/modules/c2english/CGrammar.pm +++ b/modules/c2english/CGrammar.pm @@ -1118,10 +1118,14 @@ parameter_list: } elsif (@list == 1) { $return .= $list[0]; } else { + my $identifier; if(grep { /function.*returning/ } @list) { push @list, shift @list; - push @list, shift @list; + $identifier = shift @list; + } else { + $identifier = pop @list; } + $return .= "$identifier as "; $return .= join(' ', @list); } } else {