The 'find' and 'findall' macros fail on tokenized sequences
Using the new file test/quick.txt
, this is the desired output:
$ bin/rosie grep '"quick" ("brown" / "blue") "fox"' test/quick.txt
the quick brown fox
the quick brown fox jumped over the lazy (but adorable) dog
the quick blue fox
the quick blue fox jumped over the sleeping (and adorable) dog
$
But the actual output is empty (no matches). The problem is that the input expression is a tokenized sequence (of words), and it is being passed to the findall
macro as if it were a raw/untokenized sequence, as can be seen here in the last two lines of the grammar:
$ bin/rosie -o line expand 'find:("quick" ("brown" / "blue") "fox")'
Expression: find:("quick" ("brown" / "blue") "fox")
Parses as: find:("quick" ("brown" / "blue") "fox")
At top level: find:("quick" ("brown" / "blue") "fox")
Expands to:
grammar
alias find = {<search> <anonymous>}
alias <search> = {!{~ {"quick" {"brown" / "blue"} "fox"} ~} .}*
<anonymous> = {{~ {"quick" {"brown" / "blue"} "fox"} ~}}
end
$