It seemed we could have a shorter way to say to <end> (or thru <end>, they act the same).
>> parse "aabbcc" [some "a" to <end>]
== ""
In fact, what you want more often is probably elide to <end> (a.k.a. ^ to <end>)
>> parse "aabbbcc" [some "a" elide to <end>]
== "a"
A kind of obvious choice for meaning this would be ...
>> parse "aabbbcc" [some "a" ...]
== "a"
...though I've long been skeptical of using ... without some decoration (because I was thinking this might be reserved generically for "TBD"). So maybe it's <...> ? Or something like <-> or <--> ?
I'll keep it as ... for now, just to keep th econversation open.
But Why Should It Only Work At The End?
This seems useful:
>> parse "aabbbcc" [... some "b" ...]
== "b"
But isn't that just a synonym for THRU, with the exception that if there's nothing to go THRU it assumes you mean <end> ?
Well, a synonym for THRU isn't really what you want. You'd probably like this to work:
>> parse "aabbbcc" [... some "x" | some "b" ...]
== "b"
In essence, you want it to implicitly wrap anything to the right--up to the next <...>--in a BLOCK!, so act equivalently to:
>> parse "aabbbcc" [thru [some "x" | some "b"] elide to <end>]
== "b"
That's not possible for a normal combinator, you'd need a variadic one.
Today's approximation of variadic combinators is to just special-case the implementation directly in the BLOCK! combinator.
So...that's what I've done!
A more elegant way of writing the feature may come down the pipe someday. But this gives us a version we can use in the here and now.
It's experimental, so use with caution.
![]()