Skip to content

Commit

Permalink
Make sure --find works with --type=words
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Oct 5, 2022
1 parent 05cab5c commit ba1f9d3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/App/Rak.rakumod
Expand Up @@ -415,7 +415,7 @@ my sub codify(Str:D $code) {

$code eq '*.defined'
?? &defined
!! $code.starts-with('/') && $code.ends-with('/')
!! $code.starts-with('/') && $code.ends-with('/') && $code ne '/'
?? regexify($code)
!! $code.starts-with('{') && $code.ends-with('}')
?? (prelude() ~ 'my $ := -> $_ ' ~ $code).EVAL
Expand Down Expand Up @@ -469,11 +469,11 @@ my sub needleify($pattern) {
elsif $type eq 'words' {
$ignorecase
?? $ignoremark
?? *.&has-word($pattern, :i, :m)
!! *.&has-word($pattern, :i)
?? *.Str.&has-word($pattern, :i, :m)
!! *.Str.&has-word($pattern, :i)
!! $ignoremark
?? *.&has-word($pattern, :m)
!! *.&has-word($pattern)
?? *.Str.&has-word($pattern, :m)
!! *.Str.&has-word($pattern)
}
elsif $type eq 'starts-with' {
$ignorecase
Expand Down

0 comments on commit ba1f9d3

Please sign in to comment.