Skip to content

Commit

Permalink
fix regex warnings from linter
Browse files Browse the repository at this point in the history
  • Loading branch information
htrgouvea committed Jan 3, 2024
1 parent 8faacfb commit d48e32b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Zarn/AST.pm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package Zarn::AST {
use PPI::Document;

our $VERSION = '0.01';

sub new {
my ($self, $parameters) = @_;
my ($file, $rules, @results);
Expand All @@ -29,11 +29,11 @@ package Zarn::AST {
my $category = $rule -> {category};
my $title = $rule -> {name};

if (grep {my $content = $_; scalar(grep {$content =~ m/$_/x} @sample)} $token -> content()) {
if (grep {my $content = $_; scalar(grep {$content =~ m/$_/xms} @sample)} $token -> content()) {
my $next_element = $token -> snext_sibling;

# this is a draft source-to-sink function
if (defined $next_element && ref $next_element && $next_element -> content() =~ /[\$\@\%](\w+)/x) {
if (defined $next_element && ref $next_element && $next_element -> content() =~ /[\$\@\%](\w+)/xms) {
# perform taint analyis
my $var_token = $document -> find_first (
sub { $_[1] -> isa("PPI::Token::Symbol") and $_[1] -> content eq "\$$1" }
Expand Down

0 comments on commit d48e32b

Please sign in to comment.