[REBOL] Re: Using 'to in parse dialect
From: lmecir::mbox::vol::cz at: 5-May-2005 7:28
Hallvard Ystad napsal(a):
>Hello folks
>
>I have a parse problem again. Hope someone here can help (Brett?).
>
>Heres an example from codeconscious.com:
>
>ws: charset {^A^B^C^D^E^F^G^H^-^/^K^L^M^N^O^P^Q^R^S^T^U^V^W^X^Y^Z^[^\^]^!^_ ^~ }
>input-string: "fox dog"
>parse/all input-string [ [any ws "fox"] [any ws "dog"] ]
>
>The last parse statement returns 'true. But now, what if we use the 'to:
>
>input-string: "let's make a new speciaes: a fox dog"
>parse/all input-string [ to [any ws "fox"] [any ws "fox"] [any ws "dog"] ]
>** Script Error: Invalid argument: any ws fox
>** Near: parse/all input-string [to [any ws "fox"] [any ws "fox"] [any ws "dog"]]
>
>What did I do wrong?
>
>It seems that 'to in the parse dialect is very restrictive as to what may follow. The
same applies to 'thru.
>
>Please help me someone!
>
>HY
>(Going on holyday tomorrow, reading possible responses after the weekend.)
>
>Prętera censeo Carthaginem esse delendam
>
yes, Hallward, you are right, 'to and 'thru are restricted, while it
would be useful to have them more universal. You may have a look at mine
or Gabriele's results published at REP. E.g. mine is:
http://www.compkarori.com/vanilla/display/TO%2C+THRU+And+NOT+PARSE+Rules
-L