REBOL3 tracker
  0.9.12 beta
Ticket #0001401 User: anonymous


TypeBug Statuscomplete Date23-Dec-2009 02:57
Versionalpha 95 CategoryParse Submitted byCarl
PlatformAll Severitynot a bug Prioritynormal

Summary PARSE some remove problem
Description When PARSE is used to remove multiple occurrences of a string, it does not.
Example code
str: "ababab"
parse str [some [to "a" remove thru "b"]]

== "abab"

Assigned ton/a Fixed in- Last Update5-Feb-2010 21:04

23-Dec-2009 14:27

The source of the problem: input did not appear to advance. (Yes, in fact it did, but was removed, so it appears not to advance.) The SOME gets terminated for that reason.

SOME needs to be better documented: it is a requirement that the input advance - that "some" chars are matched.

A better way to write this loop is with WHILE. It does not require the input to advance.
23-Dec-2009 15:35

This has been documented on the PARSE summary page.
28-Dec-2009 12:59

I knew While was useful (otherwise I wouldn't request it), but I am glad this issue has shown yet another use for it.

Date User Field Action Change
5-Feb-2010 21:04 BrianH Category Modified Unspecified => Parse
5-Feb-2010 21:04 BrianH Severity Modified minor => not a bug
28-Dec-2009 12:59 Ladislav Comment : 0001887 Added -
23-Dec-2009 15:35 carl Comment : 0001880 Added -
23-Dec-2009 15:35 carl Status Modified reviewed => complete
23-Dec-2009 15:20 carl Comment : 0001879 Modified -
23-Dec-2009 14:27 carl Comment : 0001879 Added -
23-Dec-2009 13:09 carl Code Modified -
23-Dec-2009 13:09 carl Status Modified submitted => reviewed
23-Dec-2009 02:57 carl Ticket Added -