whitequark / parser

A Ruby parser.
Other
1.59k stars 199 forks source link

Fix using p_kwnorest in f_no_kwarg #848

Closed palkan closed 2 years ago

palkan commented 2 years ago

Also, enable testing for 3.2 (that's why we haven't caught this yet).

p_kwnorest is resolved into s(:match_nil_pattern), which we can not use in f_no_kwarg.

Ref https://github.com/whitequark/parser/commit/820cc04b8d176c6f46ccc9a010c55f6113f4b2a

iliabylich commented 2 years ago

And then we should re-open https://github.com/whitequark/parser/issues/845, right? I guess correct fix is to change p_kwnorest rule to be reduced into [val[0], val[1]] and move s(:match_nil_pattern) construction to the place that needs it. From what I understand low-level p_kwnorest derivation constructs a node that is too high-level.

But I think it's ok to merge this PR and re-open a tracking issue.

iliabylich commented 2 years ago

Also, enable testing for 3.2 (that's why we haven't caught this yet).

my bad 👀

palkan commented 2 years ago

And then we should re-open https://github.com/whitequark/parser/issues/845, right?

Yep.

I think it's ok to merge this PR and re-open a tracking issue.

Let's wait a bit; I will try to provide a proper fix (as you suggested).

palkan commented 2 years ago

@iliabylich Done!

iliabylich commented 2 years ago

@palkan Thank you