Looks like this breaks the parser
Opened this issue ยท 16 comments
@willt , this is a known issue.. the parser doesn't behave properly for all the quote like operators
in perl with deliimiters other than, {, /, [, '
I'm currently fixing it since users are requesting. Expect it to be fixed by this week. Or you could use the delimiters I have mentioned above in the meantime.
Any news on this? Is it fixed?
Similar issue when my code contains something like:
print("${key}");
print("$key")
looks ok.
@DavidEGx , in recent commits, I have fixed it for qw
as mentioned in the above example. And there were other quote based operators which were facing the issue, so fixed them too. But there is still s//
and tr//
syntax left. Should push them, and make a version upgrade. Very soon!
@marcelarie , I'm still working on the s/// and tr// syntaxes with other identifiers. Currently it should work with s///
.
And let me checkout why that subname is highlighted differently and get back
I have publish version 0.3.0 . This should parse all these syntax properly. Let me know otherwise. :)
Amazing, thanks @ganezdragon!! I will test it at work tomorrow.
Thanks for the work.
This one seems to break it currently:
my $x;
if ($x =~ m/^asf$/) {
}
Also this one:
my $x;
if ($x =~ //) {
}
As far as I know I'm using the last version (run :TSUpdateSync
).
okay, I see the $
in the regex is causing the problem. It starts to expect a scalar variable. Let me fix that.
But the latter with just //
works fine for me.
Another one:
use strict;
use warnings;
=head1 METHODS
=head2 test1
Test
=cut
sub test1 : Path('/') {
}
=head2 test2
Looks good. But now...
=cut
sub test2 : Path('/') Args(0) {
}
=head3 test3
Hmmm, this is looks odd now
=cut
sub test3 {
}
See:
BTW, shall I create separate separate github issues for any separate new problem I find?
yea we could create separate issues, as a fallout of 0.3.0 version maybe, to better keep on track.
@DavidEGx , I'm not sure if your last snippet is syntactically correct. When I compile the code I get the following,
Invalid CODE attribute: Path('/') at examples/test.pl line 13.
BEGIN failed--compilation aborted at examples/test.pl line 13.
@ganezdragon forgot to inherit from Catalyst::Controller in the example.
Fixed version:
use strict;
use warnings;
use base qw/Catalyst::Controller/;
=head1 METHODS
=head2 test1
Test
=cut
sub test1 : Path('/') {
}
=head2 test2
Looks good. But now...
=cut
sub test2 : Path('/') Args(0) {
}
=head3 test3
Hmmm, this is looks odd now
=cut
sub test3 {
}
1;
Same syntax highlighting issue.