Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix for print with one argument
  • Loading branch information
FROGGS committed May 10, 2013
1 parent 1c5460a commit 084ddd2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions lib/Perl5/Actions.nqp
Expand Up @@ -3959,11 +3959,10 @@ class Perl5::Actions is HLL::Actions does STDActions {

method term:sym<print>($/) {
$V5DEBUG && say("term:sym<print>($/)");
my @args := $<args> ?? $<args>.ast.list !! [ QAST::Var.new( :name('$_'), :scope('lexical') ) ];
my @args := $<arglist> ?? $<arglist>.ast.list !! [ QAST::Var.new( :name('$_'), :scope('lexical') ) ];
my $past := QAST::Op.new( :op('call'), :name('&print'),
|@args
);
$past.unshift( QAST::Var.new( :named('fh'), :name(~$<fh>), :scope('lexical') ) ) if $<fh>;
|@args );
$past.push( QAST::Var.new( :named('fh'), :name(~$<fh>), :scope('lexical') ) ) if $<fh>;
make $past
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Perl5/Grammar.nqp
Expand Up @@ -3382,7 +3382,7 @@ grammar Perl5::Grammar is HLL::Grammar does STD5 {
# { <sym> » <?before \s*> <.ws> <EXPR('q=')>? }

token term:sym<print>
{ <sym> » <?before \s*> <.ws> [ <fh=.EXPR('z=')> <?before \s+> <.ws> <args=.EXPR('g=')> | <args=.EXPR('g=')> ]? }
{ <sym> » <?before \s*> <.ws> [ <fh=.EXPR('z=')> <?before \s+> <.ws> <arglist> | <arglist> ]? }

# token term:sym<prototype>
# { <sym> » <?before \s*> <.ws> <EXPR('q=')>? }
Expand Down

0 comments on commit 084ddd2

Please sign in to comment.