From 0f5dbeda7a57cc8c03e189a5d3e2f254f7647330 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Thu, 12 Jun 2014 13:23:03 +0000 Subject: [PATCH] CGrammar: Improve chained assignment --- PBot/VERSION.pm | 2 +- modules/c2english/CGrammar.pm | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/PBot/VERSION.pm b/PBot/VERSION.pm index e3e2678c..a014a12e 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 => 634, + BUILD_REVISION => 635, BUILD_DATE => "2014-06-12", }; diff --git a/modules/c2english/CGrammar.pm b/modules/c2english/CGrammar.pm index aeffa761..3a0a887d 100644 --- a/modules/c2english/CGrammar.pm +++ b/modules/c2english/CGrammar.pm @@ -404,7 +404,7 @@ assignment_expression: $return .= "${$item{assignment_operator}}[1] " if $assignment_expression !~ /the result of/; $return .= $assignment_expression; } else { - $return = "$item{unary_expression}, $assignment_operator $assignment_expression"; + $return = "$item{unary_expression} $assignment_operator $assignment_expression"; } } | conditional_expression[context => $arg{context}] @@ -427,7 +427,7 @@ assignment_operator: } elsif ($arg{context} eq 'for loop') { $return = ['assigning to', 'the value' ]; } else { - $return = ', which is assigned to be '; + $return = 'which is assigned to be'; } } | '+=' @@ -437,7 +437,7 @@ assignment_operator: } elsif ($arg{context} eq 'for loop') { $return = ['incrementing','by']; } else { - $return = 'which is incremented by '; + $return = 'which is incremented by'; } } | '-=' @@ -447,7 +447,7 @@ assignment_operator: } elsif ($arg{context} eq 'for loop') { $return = ['decrementing' , 'by']; } else { - $return = 'which is decremented by '; + $return = 'which is decremented by'; } } | '*=' @@ -457,7 +457,7 @@ assignment_operator: } elsif ($arg{context} eq 'for loop') { $return = ['multiplying' , 'by']; } else { - $return = 'which is multiplied by '; + $return = 'which is multiplied by'; } } | '/=' @@ -467,7 +467,7 @@ assignment_operator: } elsif ($arg{context} eq 'for loop') { $return = ['dividing' , 'by' ]; } else { - $return = 'which is divided by '; + $return = 'which is divided by'; } } | '%=' @@ -477,7 +477,7 @@ assignment_operator: } elsif ($arg{context} eq 'for loop') { $return = ['reducing', 'to modulo '] ; } else { - $return = 'which is reduced to modulo '; + $return = 'which is reduced to modulo'; } } | '<<=' @@ -487,7 +487,7 @@ assignment_operator: } elsif ($arg{context} eq 'for loop') { $return = ['bit-shifting', 'left by']; } else { - $return = 'which is bit-shifted left by '; + $return = 'which is bit-shifted left by'; } } | '>>=' @@ -497,7 +497,7 @@ assignment_operator: } elsif ($arg{context} eq 'for loop') { $return = ['bit-shifting', 'right by']; } else { - $return = 'which is bit-shifted right by '; + $return = 'which is bit-shifted right by'; } } | '&=' @@ -507,7 +507,7 @@ assignment_operator: } elsif ($arg{context} eq 'for loop') { $return = ['bit-wise ANDing', 'by' ]; } else { - $return = 'which is bit-wise ANDed by '; + $return = 'which is bit-wise ANDed by'; } } | '^=' @@ -517,7 +517,7 @@ assignment_operator: } elsif ($arg{context} eq 'for loop') { $return = ['exclusive-ORing','by']; } else { - $return = 'which is exclusive-ORed by '; + $return = 'which is exclusive-ORed by'; } } | '|=' @@ -527,7 +527,7 @@ assignment_operator: } elsif ($arg{context} eq 'for loop') { $return = ['bit-wise ORing', 'by']; } else { - $return = 'which is bit-wise ORed by '; + $return = 'which is bit-wise ORed by'; } }