Advertisement
happy-barney

repair ref // 1

Nov 20th, 2024
63
0
13 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.53 KB | None | 0 0
  1. package PPIx::Augment::Augmentation::Repair::PPI::Defined_Or_Regex {
  2.     use parent q (PPIx::Augment::Augmentation);
  3.  
  4.     use PPIx::Augment::Utils;
  5.  
  6.     use namespace::clean;
  7.  
  8.     sub how_to_augment {
  9.         invoke {
  10.             elements_replace
  11.                 [ current ],
  12.                 [ build_token_regexp_match q (//) ]
  13.                 ;
  14.         }
  15.     }
  16.  
  17.     sub what_to_augment {
  18.         where {
  19.             it_is_operator_defined_or
  20.             and its_sprevious_sibling {
  21.                 it_is_token_word
  22.                 and it_is_not {
  23.                     its_sprevious_sibling { it_is_token_operator q (->) }
  24.                 }
  25.             }
  26.         }
  27.     }
  28.  
  29.     1;
  30. }
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement