mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-19 10:29:30 +01:00
CGrammar: Concatenate adjacent string literals
This commit is contained in:
parent
69eca9a336
commit
b2114ca03f
@ -13,8 +13,8 @@ use warnings;
|
||||
# These are set automatically by the build/commit script
|
||||
use constant {
|
||||
BUILD_NAME => "PBot",
|
||||
BUILD_REVISION => 727,
|
||||
BUILD_DATE => "2014-07-10",
|
||||
BUILD_REVISION => 728,
|
||||
BUILD_DATE => "2014-07-11",
|
||||
};
|
||||
|
||||
1;
|
||||
|
@ -1847,7 +1847,20 @@ identifier_word:
|
||||
{ $return = "`$item[-1]`"; }
|
||||
|
||||
string:
|
||||
/(?:\"(?:\\\"|(?!\").)*\")/
|
||||
(/(?:\"(?:\\\"|(?!\").)*\")/)(s)
|
||||
{
|
||||
if (@{$item[-1]} == 1) {
|
||||
$return = @{$item[-1]}[0];
|
||||
} else {
|
||||
$return = '"';
|
||||
foreach my $string (@{$item[-1]}) {
|
||||
$string =~ s/^"//;
|
||||
$string =~ s/"$//;
|
||||
$return .= $string;
|
||||
}
|
||||
$return .= '"';
|
||||
}
|
||||
}
|
||||
|
||||
reserved:
|
||||
/(auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto
|
||||
|
Loading…
Reference in New Issue
Block a user