Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown QAST error when creating List of Pairs #5792

Open
p6rt opened this issue Nov 11, 2016 · 4 comments
Open

Unknown QAST error when creating List of Pairs #5792

p6rt opened this issue Nov 11, 2016 · 4 comments
Labels
Bug

Comments

@p6rt
Copy link

@p6rt p6rt commented Nov 11, 2016

Migrated from rt.perl.org#130069 (status was 'open')

Searchable as RT130069$

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Nov 11, 2016

From joshuamy@gmail.com

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

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented May 5, 2017

From @zoffixznet

On Thu, 10 Nov 2016 21​:03​:43 -0800, joshuamy@​gmail.com wrote​:

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 :)

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented May 5, 2017

The RT System itself - Status changed from 'new' to 'open'

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented May 12, 2019

From @dogbert17

On Thu, 04 May 2017 17​:36​:32 -0700, cpan@​zoffix.com wrote​:

On Thu, 10 Nov 2016 21​:03​:43 -0800, joshuamy@​gmail.com wrote​:

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 :)

Fixed with commit rakudo/rakudo@9135914

testneeded

@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.