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

[REBOL] Re: parse, again...

From: robert:muench:robertmuench at: 5-Nov-2001 16:38

> -----Original Message----- > From: [rebol-bounce--rebol--com] [mailto:[rebol-bounce--rebol--com]]On Behalf Of > Brett Handley > Sent: Monday, November 05, 2001 1:39 PM > To: [rebol-list--rebol--com] > Subject: [REBOL] Re: parse, again... > >> parse "hello" [skip to end] > > No I don't think so. The above parse rule has two instructions: > 1) SKIP - skips a single character only in this case
Hi, in what case? IMO skip isn't optional it's mandatory, so the rule is only satisfied if a skip is possible.
>> parse "a" [skip to end]
== true
>> parse " " [skip to end]
== false
>> parse "" [skip to end]
== false
>> parse/all " " [skip to end]
== true
> 2) TO END - Moves the index to the tail of the input stream.
Yep, and the tail is beyond the last character.
>> test: "test"
== "test"
>> last test
== #"t"
>> tail test
== "" Robert