Skip to content

Commit

Permalink
Perlito5 - parser - TODO cleanup: deref inside double quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
fglock committed Nov 14, 2012
1 parent efdbc04 commit 70581f0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
8 changes: 0 additions & 8 deletions TODO-perlito5
Expand Up @@ -61,14 +61,6 @@ TODO list for Perlito5
--- check signature in sort()
--- fix the prototype for 'stat(*)' (see t/test.pl in the perl test suite)

-- deref inside double quotes:
$ node perlito5.js -Bjs -e ' my $x = "123"; my $y = \$x; print "[$$y]\n" '
[$[object Object]]

$ node perlito5.js -MO=Deparse -e ' " $v->{x} $$v{x} " '
(' ' . $v . '->{x} $' . $v{'x'} . ' ');


-- add "print", "printf", "say" special parsing - note this is related to indirect object notation
-- indirect object notation
http://lwn.net/Articles/451486/
Expand Down
11 changes: 10 additions & 1 deletion t5/01-perlito/04-string.t
Expand Up @@ -2,7 +2,7 @@ use v5;
use strict;
use feature 'say';

say '1..18';
say '1..19';

my $x = "abcd";
if (substr($x,1,1) ne "b") {
Expand Down Expand Up @@ -99,4 +99,13 @@ print 'not ' if $r ne '-890-'; say "ok 18 - array deref interpolation - $r";
# print 'not ' if $r ne '-890-'; say 'ok 18 - array deref interpolation';
# }

$r = "-$$v[2]-";
print 'not ' if $r ne '-890-'; say "ok 18 - array deref interpolation - $r";

{
my $x = "123";
my $y = \$x;
$r = "[$$y]";
print 'not ' if $r ne '[123]'; say "ok 19 - scalar deref interpolation - $r";
}

0 comments on commit 70581f0

Please sign in to comment.