Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Compile regexes before matching.

  • Loading branch information...
commit f53049ca17586d03b1fb3249c9773a7c5fdc77ee 1 parent e9eba45
@bacek bacek authored
Showing with 5 additions and 3 deletions.
  1. +5 −3 Deprecations.pm
View
8 Deprecations.pm
@@ -23,7 +23,8 @@ method check_file($file, $yaml) {
for $api[0] {
if $_<detection> && $_<detection><regex>
&& $_<detection><regex><pir> {
- @regexes.push($_<detection><regex><pir>);
+ my $r := $_<detection><regex><pir>;
+ @regexes.push([Regex::P6Regex::Compiler.compile($r), $r]);
}
}
}
@@ -33,8 +34,9 @@ method check_file($file, $yaml) {
my $line := 1;
while $fh.readline -> $l {
for @regexes -> $regex {
- if $l ~~ / $regex / {
- @deprecations.push("$line: $regex");
+ my $r := $regex[0];
+ if $l ~~ / $r / {
+ @deprecations.push("$line: { $regex[1] }");
}
}
$line++;
Please sign in to comment.
Something went wrong with that request. Please try again.