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@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@vgerd1 example]$


Something like:

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

gives no value back:

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



-- Gerd


_______________________________________________
http://lists.parrot.org/mailman/listinfo/parrot-dev

Reply via email to