Skip Menu |
Report information
Id: 130069
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: joshuamy [at] gmail.com
Cc:
AdminCc:

Severity: (no value)
Tag: Bug
Platform: (no value)
Patch Status: (no value)
VM: (no value)



From: Joshua <joshuamy [...] gmail.com>
To: rakudobug [...] perl.org
Date: Fri, 11 Nov 2016 16:03:08 +1100
Subject: [BUG] Unknown QAST error when creating List of Pairs
Download (untitled) / with headers
text/plain 2.8k
Normally Rakudo is happy for you to omit comma when declaring pairs with the `:key(value)` syntax, however I found that it does not like this syntax is Rat's are used as the value, like this:

> (:this(3.5) :that(5.3))
Unknown QAST node type NQPMu

( Full error received in REPL reproduced below

It works fine if integers or strings are used as values, and also works fine with Rat's if you insert the comma: -

> (:this(3) :that(5))       
(this => 3 that => 5)
> (:this('3.5') :that('5.3'))
(this => 3.5 that => 5.3)
> (:this(3.5), :that(5.3))
(this => 3.5 that => 5.3)
> (:this(3.5) :that(5.3))
Unknown QAST node type NQPMu
  in any compile_node at gen/moar/stage2/QAST.nqp line 6555
  in any compile_node at gen/moar/stage2/QAST.nqp line 5201
  in any as_mast at gen/moar/stage2/QAST.nqp line 5089
  in any compile_node at gen/moar/stage2/QAST.nqp line 6460
  in any as_mast at gen/moar/stage2/QAST.nqp line 5089
  in any handle_arg at gen/moar/stage2/QAST.nqp line 2829
  in any  at gen/moar/stage2/QAST.nqp line 2997
  in any compile_op at gen/moar/stage2/QAST.nqp line 1596
  in any compile_node at gen/moar/stage2/QAST.nqp line 5871
  in any as_mast at gen/moar/stage2/QAST.nqp line 5089
  in any handle_arg at gen/moar/stage2/QAST.nqp line 2829
  in any  at gen/moar/stage2/QAST.nqp line 2919
  in any compile_op at gen/moar/stage2/QAST.nqp line 1596
  in any compile_node at gen/moar/stage2/QAST.nqp line 5871
  in any as_mast at gen/moar/stage2/QAST.nqp line 5089
  in any compile_all_the_stmts at gen/moar/stage2/QAST.nqp line 5829
  in any compile_with_stmt_temps at gen/moar/stage2/QAST.nqp line 5804
  in any compile_node at gen/moar/stage2/QAST.nqp line 5789
  in any as_mast at gen/moar/stage2/QAST.nqp line 5089
  in any compile_all_the_stmts at gen/moar/stage2/QAST.nqp line 5829
  in any compile_node at gen/moar/stage2/QAST.nqp line 5784
  in any as_mast at gen/moar/stage2/QAST.nqp line 5089
  in any compile_all_the_stmts at gen/moar/stage2/QAST.nqp line 5829
  in any  at gen/moar/stage2/QAST.nqp line 5449
  in any  at gen/moar/stage2/QAST.nqp line 5428
  in any compile_node at gen/moar/stage2/QAST.nqp line 5380
  in any as_mast at gen/moar/stage2/QAST.nqp line 5085
  in any  at gen/moar/stage2/QAST.nqp line 2895
  in any compile_op at gen/moar/stage2/QAST.nqp line 1596
  in any compile_node at gen/moar/stage2/QAST.nqp line 5871
  in any as_mast at gen/moar/stage2/QAST.nqp line 5089
  in any compile_all_the_stmts at gen/moar/stage2/QAST.nqp line 5829
  in any  at gen/moar/stage2/QAST.nqp line 5449
  in any  at gen/moar/stage2/QAST.nqp line 5428
  in any compile_node at gen/moar/stage2/QAST.nqp line 5380
  in any as_mast at gen/moar/stage2/QAST.nqp line 5089
  in any compile_node at gen/moar/stage2/QAST.nqp line 5223
  in any as_mast at gen/moar/stage2/QAST.nqp line 5089
  in any to_mast at gen/moar/stage2/QAST.nqp line 4826
  in any to_mast at gen/moar/stage2/QAST.nqp line 6607
  in any interactive at src/Perl6/Compiler.nqp line 62

RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 1.1k
On Thu, 10 Nov 2016 21:03:43 -0800, joshuamy@gmail.com wrote: Show quoted text
> Normally Rakudo is happy for you to omit comma when declaring pairs with > the `:key(value)` syntax, however I found that it does not like this syntax > is Rat's are used as the value, like this: >
> > (:this(3.5) :that(5.3))
> Unknown QAST node type NQPMu >
I took a stab at this one, but giving up for now. Things discovered: - It's the second `:that(5.3)` that is the thing causing the issue - To repro the issue, instead of a Rat you can use a constant, e.g. `:that(pi)` - ASTs: - Working version has: QAST::WVal(Rat) <wanted> :statement_id<?> 5.3 - Broken version has: QAST::Want <wanted> (looks like it's missing stuff inside of it, which is what gives the error) - --target=parse: - Working version has EXPR => - 0: colonpair: (first) - 1: colonpair: (second) - Broken version has EXPR => - 0: colonpair: (first) - fake_infix: - OPER: - colonpair: (second) So looks like the Actions for `statement` token needs to rake through `fake_infix` capture and generate proper colonpair instead of empty QAST::Want. I gave up at that point, but hopefully my digging will be helpful to someone :)


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org