-
Notifications
You must be signed in to change notification settings - Fork 78
Perl: Handle 'method' the same as 'sub' for special cases #343
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
base: master
Are you sure you want to change the base?
Conversation
|
Wait, I made a blunder it seems, fixing a mistake, hold on |
|
OK, no, the code is fine but only works if -{11}lvalue{0} {11}method{0} {5}prototype{10}(..){0} {11}locked{0} {11}const{0}
+{11}lvalue{0} {5}method{0} {11}prototype{10}(..){0} {11}locked{0} {11}const{0}so maybe there's more to it than this, and I'm in over my head given I have no idea what this line above means (I mean, the Perl version |
|
It seems https://perldoc.perl.org/perlclass
|
|
OK I adjusted the special handling to allow for |
|
Seeing https://sourceforge.net/p/scintilla/feature-requests/1574/ adds |
|
The line Examples: sub foo : method ;
sub Y::x : lvalue { 1 }
sub foo($$) : prototype(@) {}
*INLINED = sub : const { $x };
# Only one thread is allowed into this function on a given object.
sub afunc : locked method { ... }For the |
|
Okay so if adding |
This will be useful for an upcoming test.
|
OK so I just added a commit before that updated the keywords, and the tests that got different results for this (e.g. some identifiers becoming keywords). Second commit now has better styles, but again the |
This will be useful for an upcoming test.
|
Contextual keywords are difficult. While it would be great to recognize contextual keywords exactly like the Perl interpreter, that would require much more work. It is still worth improving the set of cases that are recognized correctly, prioritizing cases that are likely more common like |
Fixes #342.
DISCLAIMER: I don't know Perl, but this seems to be consistent with the lexer, and seems to work. The docs seem to support the report this fix is for.