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

Regex fix for compilation errors with DATA #80

Merged
merged 1 commit into from
Jan 20, 2022

Conversation

bscan
Copy link
Contributor

@bscan bscan commented Jan 20, 2022

This is a fix to the regular expression used for parsing compilation errors from perl -c. When a compilation error occurs after a imported module that has used the DATA section, the context of DATA is included. For example, when compile checking the following short file:

use strict;
use PDL;
$foo=1;

gives the following error

Global symbol "$foo" requires explicit package name (did you forget to declare "my $foo"?) at /tmp/testing.pl line 3, <DATA> line 197.
PLS will run the regex on this, and then discard the error because the result of the 2nd capture group: /tmp/testing.pl line 3, <DATA> does not match the originally requested filename.

Looks like Perl::LanguageServer includes this capture group modifier as well: https://github.com/richterger/Perl-LanguageServer/blob/f4bd1f39630cb2c490c2f82d0e5e9bc8b410e8da/lib/Perl/LanguageServer/SyntaxChecker.pm#L263

@FractalBoy FractalBoy merged commit f21efbf into FractalBoy:master Jan 20, 2022
@FractalBoy
Copy link
Owner

@bscan Thank you!

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.

2 participants