[REBOL] Re: Strange parsing behavior
From: g:santilli:tiscalinet:it at: 4-Aug-2002 19:43
Hi Robert,
On Sunday, August 4, 2002, 4:50:56 PM, you wrote:
RMM> Well, you use the new 'break function, that's easy and gives a virtual
RMM> cookie price :-)). Try it without the use of 'break ;-)) Robert
I admit is a bit trickier, but it only requires a few changes.
>> Text: "this-is-a test of some parsing^/this-is-a - test of some parsing"
== {this-is-a test of some parsing
this-is-a - test of some parsing}
>> result: []
== []
>> rule: [some [copy string sentence (append result string) separator]]
== [some [copy string sentence (append result string) separator]]
>> sentence: [any [some sentence-chars (break-rule: none) [tmp: separator :tmp (break-rule:
[end skip]) | some #" " | end] tmp: break-rule] :tmp]
== [any [some sentence-chars (break-rule: none) [tmp: separator :tmp (break-rule: [end
skip]) | some #" " | end] tmp: break-rule] :...
>> separator: [" - " | #"^/"]
== [" - " | #"^/"]
>> sentence-chars: complement charset " ^/"
== make bitset! #{
FFFBFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
}
>> parse/all text rule
== false
>> result
== ["this-is-a test of some parsing" "this-is-a" "test of some parsing"]
Regards,
Gabriele.
--
Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer
Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r