Hi, Daniel,
you wrote:
> > It seems strange to me that
> >
> > digit: charset "0123456789"
> > parse "123" [to digit]
> >
> > and
> >
> > block: ["1" | "2"]
> > parse "123" [to block]
> >
> > fail (on my Mac). Any ideas how to write it better?
> > This works for blocks:
> >
> > block: [to "1" | to "2"]
> > parse "123" [block]
> >
> > but is not so elegant for large blocks.
> > Daniel
> >
>
> ---------------------------------------------------------------
> > Daniel Haertle
[EMAIL PROTECTED]
> > ETH Hoenggerberg HPF E18 phone +41 1 633
2338
> > Institute of Quantum Electronics fax +41 1 633
1056
> > Nonlinear Optics Laboratory - 8093 Zuerich -
Switzerland
>
> ---------------------------------------------------------------
> >
the problem is, that your solution above is wrong, cf.:
>> not-block: complement charset "12"
== make bitset! #{
FFFFFFFFFFFFF9FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
}
>> parse "a231" [any not-block #"2" to end]
== true
, whereas
>> parse "a231" [[to "1" | to "2"] #"2" to end]
== false
I admit, that this is only a simple case, but if you have anything
more complicated in mind, we can give it a try.
Regards
Ladislav