CGrammar: Improve chained assignment

This commit is contained in:
Pragmatic Software 2014-06-12 13:23:03 +00:00
parent c6e893a4fa
commit 0f5dbeda7a
2 changed files with 13 additions and 13 deletions

View File

@ -13,7 +13,7 @@ use warnings;
# These are set automatically by the build/commit script # These are set automatically by the build/commit script
use constant { use constant {
BUILD_NAME => "PBot", BUILD_NAME => "PBot",
BUILD_REVISION => 634, BUILD_REVISION => 635,
BUILD_DATE => "2014-06-12", BUILD_DATE => "2014-06-12",
}; };

View File

@ -404,7 +404,7 @@ assignment_expression:
$return .= "${$item{assignment_operator}}[1] " if $assignment_expression !~ /the result of/; $return .= "${$item{assignment_operator}}[1] " if $assignment_expression !~ /the result of/;
$return .= $assignment_expression; $return .= $assignment_expression;
} else { } else {
$return = "$item{unary_expression}, $assignment_operator $assignment_expression"; $return = "$item{unary_expression} $assignment_operator $assignment_expression";
} }
} }
| conditional_expression[context => $arg{context}] | conditional_expression[context => $arg{context}]
@ -427,7 +427,7 @@ assignment_operator:
} elsif ($arg{context} eq 'for loop') { } elsif ($arg{context} eq 'for loop') {
$return = ['assigning to', 'the value' ]; $return = ['assigning to', 'the value' ];
} else { } 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') { } elsif ($arg{context} eq 'for loop') {
$return = ['incrementing','by']; $return = ['incrementing','by'];
} else { } else {
$return = 'which is incremented by '; $return = 'which is incremented by';
} }
} }
| '-=' | '-='
@ -447,7 +447,7 @@ assignment_operator:
} elsif ($arg{context} eq 'for loop') { } elsif ($arg{context} eq 'for loop') {
$return = ['decrementing' , 'by']; $return = ['decrementing' , 'by'];
} else { } else {
$return = 'which is decremented by '; $return = 'which is decremented by';
} }
} }
| '*=' | '*='
@ -457,7 +457,7 @@ assignment_operator:
} elsif ($arg{context} eq 'for loop') { } elsif ($arg{context} eq 'for loop') {
$return = ['multiplying' , 'by']; $return = ['multiplying' , 'by'];
} else { } else {
$return = 'which is multiplied by '; $return = 'which is multiplied by';
} }
} }
| '/=' | '/='
@ -467,7 +467,7 @@ assignment_operator:
} elsif ($arg{context} eq 'for loop') { } elsif ($arg{context} eq 'for loop') {
$return = ['dividing' , 'by' ]; $return = ['dividing' , 'by' ];
} else { } else {
$return = 'which is divided by '; $return = 'which is divided by';
} }
} }
| '%=' | '%='
@ -477,7 +477,7 @@ assignment_operator:
} elsif ($arg{context} eq 'for loop') { } elsif ($arg{context} eq 'for loop') {
$return = ['reducing', 'to modulo '] ; $return = ['reducing', 'to modulo '] ;
} else { } 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') { } elsif ($arg{context} eq 'for loop') {
$return = ['bit-shifting', 'left by']; $return = ['bit-shifting', 'left by'];
} else { } 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') { } elsif ($arg{context} eq 'for loop') {
$return = ['bit-shifting', 'right by']; $return = ['bit-shifting', 'right by'];
} else { } 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') { } elsif ($arg{context} eq 'for loop') {
$return = ['bit-wise ANDing', 'by' ]; $return = ['bit-wise ANDing', 'by' ];
} else { } 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') { } elsif ($arg{context} eq 'for loop') {
$return = ['exclusive-ORing','by']; $return = ['exclusive-ORing','by'];
} else { } 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') { } elsif ($arg{context} eq 'for loop') {
$return = ['bit-wise ORing', 'by']; $return = ['bit-wise ORing', 'by'];
} else { } else {
$return = 'which is bit-wise ORed by '; $return = 'which is bit-wise ORed by';
} }
} }