NQP question to add a null value node

Gerd Pokorra gp at zimt.uni-siegen.de
Fri Mar 4 13:58:53 UTC 2011


Am Freitag, den 04.03.2011, 14:15 +0100 schrieb Patrick R. Michaud:
> On Fri, Mar 04, 2011 at 01:11:43PM +0100, Gerd Pokorra wrote:
> > How can I add a node with the value null with NQP?
> > method value:sym<null>($/) {
> >    #  ????
> > }
> 
> Perhaps...?
> 
>     method value:sym<null>($/) {
>         pir::null();
>     }
> 
> Pm

Executing the result craches:

 [gz016 at vgerd1 example]$ parrot json.pir 
error:imcc:syntax error, unexpected '\n'
        in file 'json.pir' line 1710
error:imcc:syntax error ... somewhere
        in file 'json.pir' line 1812
[gz016 at vgerd1 example]$


Something like:

method value:sym<null>($/) {
    make PAST::Op.new( :pirop('null'), '$S0' );
}

gives no value back:

[gz016 at vgerd1 example]$ parrot json.pir 
> null
> 



-- Gerd




More information about the parrot-dev mailing list