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

[REBOL] Re: parse, again...

From: brett:codeconscious at: 6-Nov-2001 10:49

> > >> 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?
Robert, your email earlier had:
> > >> parse "hello" [skip to end] > I think this is very obvious, this tells parse to 'skip to end' that's
skip
> beyond the last consumable character.
As it reads, it looks as if you are saying that "skip to end" is a single atomic parse instruction, that Rebol understands the English meaning of the phrase 'skip to end' - I disagree with this. I was simply saying that you have two parse instructions here. "skip" is carried out first, then "to end" is carried out.
> IMO skip isn't optional it's mandatory, so the rule is only > satisfied if a skip is possible.
Perhaps your comment that skip is mandatory is relative to some particular situation (or the stopping condition discussion), if so I'm sorry I obviously missed your intention. I just want to ensure that someone learning parse was not confused about the meaning of the rule [skip to end], which is "match one and move to tail". Brett.