Skip to content

Commit

Permalink
Ensure that blocks embedded in strings are embedded with the return v…
Browse files Browse the repository at this point in the history
…alue, not the name of the block.
  • Loading branch information
treed committed Jul 23, 2009
1 parent db1ff47 commit f154a71
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 5 additions & 3 deletions src/parser/actions.pm
Expand Up @@ -832,10 +832,12 @@ method quote_term($/, $key) {
$past := $<variable>.ast();
}
elsif ($key eq 'do_block') {
$past := $<do_block>.ast();
if $past.WHAT() eq 'Block' {
$past.blocktype('immediate');
my $block := $<do_block>.ast();
if $block.WHAT() eq 'Block' {
$block.blocktype('immediate');
}
$past := PAST::Op.new(:pasttype('call'));
$past.push($block);
}
make $past;
}
Expand Down
3 changes: 1 addition & 2 deletions t/00-sanity.t
Expand Up @@ -11,8 +11,7 @@ puts "ok 2" ; puts "ok 3"

print "ok "; print 1 + 3; print "\n"

puts "not ok 5 # SKIP - Block interpretation is broken in strings." # skip
#print "ok #{ 2 * 2 + 1 }\n"
print "ok #{ 2 * 2 + 1 }\n"



0 comments on commit f154a71

Please sign in to comment.