Closed p5pRT closed 18 years ago
The pair of do's isn't correct:
perl -MO=Deparse -e 'if($a) {do {}}' if ($a) { do { do { () } }; } -e syntax OK
$ perl -MO=Deparse -e 'do { 42 } while 0'
do {
do {
'???'
}
};
-e syntax OK
I've no idea why it's happening.
Nicholas Clark
The pair of do's isn't correct:
perl -MO=Deparse -e 'if($a) {do {}}' if ($a) { do { do { () } }; } -e syntax OK
This can be reduced to:
$ perl -MO=Deparse -e 'do{}' do { do { () } }; -e syntax OK
The funny thing is that each literal do{} seems to be replaced by two by B::Deparse:
$ perl -MO=Deparse -e 'do{do{}}' do { do { do { do { () } } } }; -e syntax OK
But the following cases do not expose the same behaviour:
$ perl -MO=Deparse -e 'do()' do(()); -e syntax OK
$ perl -MO=Deparse -e 'do({})' do {}; -e syntax OK
$ perl -MO=Deparse -e 'do do {}' do do { () }; -e syntax OK
-- Sébastien Aperghis-Tramoni
Close the world\, txEn eht nepO.
The RT System itself - Status changed from 'new' to 'open'
On Thu\, Aug 03\, 2006 at 02:40:04PM +0200\, Sébastien Aperghis-Tramoni wrote:
This can be reduced to:
$ perl -MO=Deparse -e 'do{}' do { do { () } }; -e syntax OK
I changed the way the test generated the regex because it would cause failures when there were trailing spaces in the test code. It would transform something like:
"do { } " -> 'do\ \{\ \}\ \ ' -> 'do\s+\{\s+\}\s+\s+'
Now it goes more like
"do { } " -> 'do \{ \} ' -> 'do\s+\{\s+\}\s+'
which I think gives the intended result.
-- Rick Delaney rick@bort.ca
Rick Delaney wrote:
diff -pruN perl-current/ext/B/B/Deparse.pm perl-current-dev/ext/B/B/Deparse.pm --- perl-current/ext/B/B/Deparse.pm 2006-07-13 13:14:46.000000000 -0400 +++ perl-current-dev/ext/B/B/Deparse.pm 2006-08-03 16:07:42.000000000 -0400
Thanks\, applied as #28656.
@rgs - Status changed from 'open' to 'resolved'
Migrated from rt.perl.org#40055 (status was 'resolved')
Searchable as RT40055$