mirror of
https://github.com/pragma-/pbot.git
synced 2024-12-24 11:42:35 +01:00
Correct handling of concatenated prefixed string literals
This commit is contained in:
parent
6cf818419f
commit
06d6e0f0d4
@ -622,7 +622,6 @@ logical_OR_AND_expression:
|
|||||||
log_OR_AND_bit_or_and_eq
|
log_OR_AND_bit_or_and_eq
|
||||||
rel_add_mul_shift_expression[context => 'logical_OR_AND_expression']>
|
rel_add_mul_shift_expression[context => 'logical_OR_AND_expression']>
|
||||||
{
|
{
|
||||||
if (defined $arg{context} and $arg{context} eq 'for conditional') { print STDERR "hmm2\n"; }
|
|
||||||
my $expression = join('', @{$item[1]});
|
my $expression = join('', @{$item[1]});
|
||||||
if($arg{context} =~ /initializer expression$/
|
if($arg{context} =~ /initializer expression$/
|
||||||
and $expression =~ / /
|
and $expression =~ / /
|
||||||
@ -1924,12 +1923,13 @@ string:
|
|||||||
{
|
{
|
||||||
my $final_string = "";
|
my $final_string = "";
|
||||||
foreach my $string (@{$item[-1]}) {
|
foreach my $string (@{$item[-1]}) {
|
||||||
if (not length $final_string) {
|
|
||||||
my $modifier = "";
|
my $modifier = "";
|
||||||
$modifier = 'an UTF-8 string ' if $string =~ s/^u8//;
|
$modifier = 'an UTF-8 string ' if $string =~ s/^u8//;
|
||||||
$modifier = 'a wide character string ' if $string =~ s/^L//;
|
$modifier = 'a wide character string ' if $string =~ s/^L//;
|
||||||
$modifier = 'a 16-bit character string ' if $string =~ s/^u//;
|
$modifier = 'a 16-bit character string ' if $string =~ s/^u//;
|
||||||
$modifier = 'a 32-bit character string ' if $string =~ s/^U//;
|
$modifier = 'a 32-bit character string ' if $string =~ s/^U//;
|
||||||
|
|
||||||
|
if (not length $final_string) {
|
||||||
$final_string = $modifier;
|
$final_string = $modifier;
|
||||||
$final_string .= '"';
|
$final_string .= '"';
|
||||||
}
|
}
|
||||||
|
@ -74,8 +74,10 @@ foreach my $arg (@ARGV) {
|
|||||||
$output =~ s/the a /the /g;
|
$output =~ s/the a /the /g;
|
||||||
$output =~ s/Then if it has the value/If it has the value/g;
|
$output =~ s/Then if it has the value/If it has the value/g;
|
||||||
$output =~ s/result of the expression a generic-selection/result of a generic-selection/g;
|
$output =~ s/result of the expression a generic-selection/result of a generic-selection/g;
|
||||||
|
$output =~ s/the result of the expression (an?) (16-bit character|32-bit character|wide character|UTF-8) string/$1 $2 string/gi;
|
||||||
$output =~ s/the function a generic-selection/the function resulting from a generic-selection/g;
|
$output =~ s/the function a generic-selection/the function resulting from a generic-selection/g;
|
||||||
$output =~ s/\.\s+Then exit switch block/ and then exit switch block/g;
|
$output =~ s/\.\s+Then exit switch block/ and then exit switch block/g;
|
||||||
|
$output =~ s/,\././g;
|
||||||
|
|
||||||
foreach my $quote (@quotes) {
|
foreach my $quote (@quotes) {
|
||||||
next unless $quote;
|
next unless $quote;
|
||||||
|
Loading…
Reference in New Issue
Block a user