matching indices
sebfisch opened this issue · comments
Sebastian Fischer commented
Instead of only indicating whether a given expression matches by returning a Bool
, return a [(Index,Index)]
where each pair of indices identifies a matching substring.
This can be implemented by changing the Status
type. Instead of using a Bool
to indicate whether an expression is final, use a [Index]
to indicate where the words started that are now completely matched. In order to pass the starting index, the next
function can pass it to activateFirst
after the input string is zip
ped with [0..]
.
Sebastian Fischer commented