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

Allow postfix operator called as method after unary postfix hyper operator #339

Merged
merged 2 commits into from Dec 23, 2014

Conversation

usev6
Copy link
Contributor

@usev6 usev6 commented Dec 19, 2014

currently something like '(my @A = 1)>>.++' fails, since METAOP_HYPER_CALL is called
instead of METAOP_HYPER_POSTFIX. Fixes RT #122342.

…rator

currently something like '(my @A = 1)>>.++' fails, since METAOP_HYPER_CALL is called
instead of METAOP_HYPER_POSTFIX. Fixes RT #122342.
@usev6
Copy link
Contributor Author

usev6 commented Dec 19, 2014

This patch gives me clean spectests on all backends and fixes RT #122342. On the other hand I'm not sure it's the right patch.

Currently if (my @a = 1)>>.++ is executed the if $<dotty> in method postfixish($/) from Action.nqp (line 5670) succeeds and 'METAOP_HYPER_CALL' is called. Looks like since happens since commit 89ca806e75

Also I'm not sure whether it's better to lump the two lines with <OPER=postfix> together with:

| [ '.' <![i]>]? <OPER=postfix>

@moritz
Copy link
Member

moritz commented Dec 21, 2014

FTR, on #perl6 we discussed that excluding word-character-based postfix operators might be a way forward, so something like <!bfore \w> or <!alpha> instead of <![i]>.

…tor, but only for non-wordy operators

The previous version which special cased postfix:<i> only seemed too fragile.
Now the dotted form is allowed only for non-wordy operators.
@usev6
Copy link
Contributor Author

usev6 commented Dec 21, 2014

I changed <![i]> to <?before \W>.

Also I assembled some tests: https://gist.github.com/usev6/1b805c3f0dad510b8f32 With my patch all those tests pass (as does a spectest). Do you think the tested behaviour is reasonable?

moritz added a commit that referenced this pull request Dec 23, 2014
Allow postfix operator called as method after unary postfix hyper operator
@moritz moritz merged commit 8154bd3 into rakudo:nom Dec 23, 2014
@moritz
Copy link
Member

moritz commented Dec 23, 2014

Thanks for the patches and your patience, @usev6. It would be awesome if you could turn your gist into spectests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants