From c03a1288b6a48416fc5eeb0258b27e3d11a887ca Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Sun, 10 Aug 2014 05:31:29 +0000 Subject: [PATCH] CGrammar: Fix a|an substitution to an|a --- PBot/VERSION.pm | 2 +- modules/c2english/CGrammar.pm | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/PBot/VERSION.pm b/PBot/VERSION.pm index f658db29..55aa930c 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 => 771, + BUILD_REVISION => 772, BUILD_DATE => "2014-08-09", }; diff --git a/modules/c2english/CGrammar.pm b/modules/c2english/CGrammar.pm index 6d5151fb..ef1ff807 100644 --- a/modules/c2english/CGrammar.pm +++ b/modules/c2english/CGrammar.pm @@ -800,7 +800,7 @@ declaration: $item{declaration_specifiers} = ''; } - if (@identifiers == 1 and $first_qualifier !~ /^(a|an)\s+/) { + if (@identifiers == 1 and $first_qualifier !~ /^(an|a)\s+/) { $return .= $first_qualifier =~ m/^[aeiou]/ ? 'an ' : 'a '; } elsif (@identifiers > 1 and not $typedef) { $first_qualifier =~ s/pointer/pointers/; @@ -809,7 +809,7 @@ declaration: $return .= "$first_qualifier"; $return .= " $item{declaration_specifiers}" if $item{declaration_specifiers}; } else { - if (@identifiers == 1 and $item{declaration_specifiers} !~ /^(a|an)\s+/) { + if (@identifiers == 1 and $item{declaration_specifiers} !~ /^(an|a)\s+/) { $return .= $item{declaration_specifiers} =~ m/^[aeiou]/ ? 'an ' : 'a '; } $return .= $item{declaration_specifiers}; @@ -839,7 +839,7 @@ declaration: $first_qualifier =~ s/ returning$//; } - if (@identifiers == 1 and $first_qualifier !~ /^(a|an)\s+/) { + if (@identifiers == 1 and $first_qualifier !~ /^(an|a)\s+/) { $return .= $first_qualifier =~ m/^[aeiou]/ ? 'an ' : 'a '; } elsif (@identifiers > 1 and not $typedef) { $first_qualifier =~ s/pointer/pointers/; @@ -848,7 +848,7 @@ declaration: $return .= "$first_qualifier "; $return .= $item{declaration_specifiers}; } else { - if (@identifiers == 1 and $item{declaration_specifiers} !~ /^(a|an)\s+/) { + if (@identifiers == 1 and $item{declaration_specifiers} !~ /^(an|a)\s+/) { $return .= $item{declaration_specifiers} =~ m/^[aeiou]/ ? 'an ' : 'a '; } $return .= $item{declaration_specifiers}; @@ -1731,7 +1731,7 @@ struct_or_union_specifier: } | struct_or_union identifier { - $item{struct_or_union} =~ s/^(a|an)//; + $item{struct_or_union} =~ s/^(an|a)\s+//; $return = $item{identifier} =~ m/^`[aeiou]/ ? 'an' : 'a'; $return .= " $item{identifier} $item{struct_or_union}"; }