diff --git a/PBot/VERSION.pm b/PBot/VERSION.pm index 1bfb2411..69f3ea10 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 => 678, + BUILD_REVISION => 679, BUILD_DATE => "2014-06-25", }; diff --git a/modules/c2english/CGrammar.pm b/modules/c2english/CGrammar.pm index 5b237d70..2bb75985 100644 --- a/modules/c2english/CGrammar.pm +++ b/modules/c2english/CGrammar.pm @@ -668,8 +668,9 @@ declaration: if(@identifiers == 1 and $first_qualifier !~ /^(a|an)\s+/) { $return .= $first_qualifier =~ m/^[aeiouy]/ ? 'an ' : 'a '; - } elsif(@identifiers > 1) { + } elsif(@identifiers > 1 and not $typedef) { $first_qualifier =~ s/pointer/pointers/; + $first_qualifier =~ s/an array/arrays/; } $return .= "$first_qualifier $item{declaration_specifiers} "; } else { @@ -701,18 +702,20 @@ declaration: } } - $return .= ' be '; - if($typedef) { - $return .= 'another name for '; + $return .= ' each' if @identifiers > 1; + $return .= ' be another name for '; push @typedefs, @identifiers; + } else { + $return .= ' be '; } if($first_qualifier) { if(@identifiers == 1 and $first_qualifier !~ /^(a|an)\s+/) { $return .= $first_qualifier =~ m/^[aeiouy]/ ? 'an ' : 'a '; - } elsif(@identifiers > 1) { + } elsif(@identifiers > 1 and not $typedef) { $first_qualifier =~ s/pointer/pointers/; + $first_qualifier =~ s/an array/arrays/; } $return .= "$first_qualifier "; $return .= "$remaining_args " if $remaining_args;