Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: parse, again...

From: lmecir:mbox:vol:cz at: 6-Nov-2001 10:03

Hi Halvard, Volker: << ...thread started like parse "this that something some others"[some[thru "something"|thru end]] ...thread-starter ... wondered why 'parse said "not successfully parsed"...
>>
Halvard: <<Actually, I wasn't using "thru end" _intuitively_, although it was among my different approaches. But once I thought about it, I _do_ find it logic to be able to do a parse "thru end", since 'end is indeed defined as a something (even though simply a marker) after the last character in a string. "To end" produces an infinite loop (guess this is a bug)... I'd like just as much that "to end" would simply work...
>>
The problem is, that [to end] must work as it does to work correctly. See this: parse "" [to end to end] ; == true I am sure, that this behaviour is correct regardless of the quantity of [to end] you put in there. That is why any attempt to write parse "" rule: [to end rule] or parse "" [any [to end]] Correctly ends up in an infinite cycle, because PARSE is unable to finish its work. It's up to the user to write a rule that really parses through INPUT and doesn't try to pretend it's doing anything useful when it actually isn't. Cheers Ladislav