-
Notifications
You must be signed in to change notification settings - Fork 624
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Perl: skip string literals when collecting heredoc markers
Close #3588. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
- Loading branch information
Showing
4 changed files
with
146 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--sort=no | ||
--kinds-Perl=+{heredoc} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
f0tag input.pl /^sub f0tag() {}$/;" s | ||
f1tag input.pl /^sub f1tag() {}$/;" s | ||
f2tag input.pl /^sub f2tag() {}$/;" s | ||
f3tag input.pl /^sub f3tag() {}$/;" s | ||
hereodc0tag input.pl /^print 'cat <<<heredoct0notag' . <<hereodc0tag;$/;" h | ||
f4tag input.pl /^sub f4tag() {}$/;" s | ||
hereodc1tag input.pl /^print "cat <<<heredoct1notag" . <<hereodc1tag;$/;" h | ||
f5tag input.pl /^sub f5tag() {}$/;" s | ||
hereodc2tag input.pl /^print `cat <<<heredoct1notag` . <<hereodc2tag;$/;" h | ||
f6tag input.pl /^sub f6tag() {}$/;" s | ||
heredoc3tag input.pl /^print "abc" . <<heredoc3tag . 'efg' . << "heredoc4tag" . `ls` . '<<hereodc5notag';$/;" h | ||
heredoc4tag input.pl /^print "abc" . <<heredoc3tag . 'efg' . << "heredoc4tag" . `ls` . '<<hereodc5notag';$/;" h | ||
f7tag input.pl /^sub f7tag() {}$/;" s | ||
f8tag input.pl /^sub f8tag() {}$/;" s | ||
f9tag input.pl /^sub f9tag() {}$/;" s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Derrived from #3588 submitted by @petdance | ||
|
||
sub f0tag() {} | ||
|
||
my $x = '<<NOT_A_HEREDOC0'; | ||
|
||
sub f1tag() {} | ||
|
||
print "<<NOT_A_HEREDOC0\n"; | ||
|
||
sub f2tag() {} | ||
|
||
print `cat <<<BASH_HERE_STRING`; | ||
|
||
sub f3tag() {} | ||
|
||
print 'cat <<<heredoct0notag' . <<hereodc0tag; | ||
sub f0notag() {} | ||
hereodc0tag | ||
|
||
sub f4tag() {} | ||
|
||
print "cat <<<heredoct1notag" . <<hereodc1tag; | ||
sub f1notag() {} | ||
hereodc1tag | ||
|
||
sub f5tag() {} | ||
|
||
print `cat <<<heredoct1notag` . <<hereodc2tag; | ||
sub f2notag() {} | ||
hereodc2tag | ||
|
||
sub f6tag() {} | ||
|
||
print "abc" . <<heredoc3tag . 'efg' . << "heredoc4tag" . `ls` . '<<hereodc5notag'; | ||
sub f3notag() {} | ||
heredoc3tag | ||
sub f4notag() {} | ||
heredoc4tag | ||
sub f7tag() {} | ||
|
||
sub f8tag() {} | ||
|
||
my $i = 1; | ||
print "a" . 3 << $i; | ||
|
||
sub f9tag() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters