-
Notifications
You must be signed in to change notification settings - Fork 602
rfc 0015, part 1 - warn on use of ' as :: in identifiers #20593
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
Conversation
|
Hey, nice. I am not qualified to code review this, but am qualified to say "thanks!" |
|
Nice, I never saw a reply on how to submit my work in the RFC itself Perl/PPCs#18, but my changes related to this are here if you want to take a look blead...nicomen:perl5:nicomen/warn_on_old_package_separator. I've been struggling with how to get a proper warning (suggesting the correct syntax) for sub names as the token contains a space. |
Sorry, I didn't see that. I think the best way to get a code review is to make a PR, if you don't think it's ready to merge, make it draft. |
8482187 to
983c72e
Compare
|
Some updates:
A few bundled cpan modules also warn: I'll make PRs (or tickets) against upstreams once (if) this is merged. |
|
Please look at the RFC for some already reported upstream bugs/pull requests that may need a nudge. |
leonerd
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall seems good, give or take some minor formatting comments in the tests.
As this is labelled "Part 1" I imagine it's not complete for the RFC yet. What further parts are required?
| print $xyz eq 'bar:main:new:xyz:ABC' ? "ok 1\n" : "not ok 1 '$xyz'\n"; | ||
| } else { | ||
| print $xyz eq 'ABC:bar:main:new:xyz' ? "ok 1\n" : "not ok 1 '$xyz'\n"; | ||
| print $xyz eq 'ABC:BEGIN:bar:main:new:xyz' ? "ok 1\n" : "not ok 1 '$xyz'\n"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI: This behaviour of BEGIN blocks really annoys me. I have vague plans to fix it one day...
The RFC calls them "steps": https://github.com/Perl/RFCs/blob/main/rfcs/rfc0015.md#specification and they belong in separate releases. The first step is this, effectively deprecating ' in identifiers. The second step is turning them into a syntax error, though it's unclear whether that should be a "directly produce a syntax error where |
025457f to
41aaec5
Compare
41aaec5 to
4ed9265
Compare
|
Is there anything needed on this still? It looks good to me. |
If we're going to be removing this entirely, the behavior of existing code is going to change. Make sure everyone sees it.
First stage of RFC 0015. This also changes the warning for ' as package separator in quoted strings to also be a deprecation warning.
4ed9265 to
7cc9c41
Compare
leonerd
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Can we get this in in time for 5.37.9?
|
@tonycoz for the win. Thanks! |
This implements the first part of RFC 0015, which states we should warn on the use of ' instead of :: in identifiers.