[REBOL] parse crash & proposed new parse behaviour
From: anton::lexicon::net at: 13-Sep-2002 1:22
Hello, run the first parse below for a nice crash. :P
Crashes on these windows versions:
- a clean REBOL/View 1.2.8.3.1 3-Aug-2002 (beta)
- a clean REBOL/View 1.2.1.3.1 21-Jun-2001
- Rebol/Link 1.0.2.3.1 25-Mar-2002/14:58:06-8:00
("clean" meaning no user defined functions in user.r etc.)
> parse/all "/" [start: skip opt (remove start) to "*"]
>
> It is interesting, that the following code doesn't cause the crash:
>
> parse/all "/" [start: skip opt (remove start) to #"*"]
>
> Cheers
> -L
I agree with Ladislav's proposed behaviour for parse.
Ladislav's proposed behaviour for parse:
-----------Original Message ---------
From: Ladislav Mecir
this is an old parse "glitch". The difference between your rules is, that
the second one didn't cause the internal pointer to "get past the end" of
the input and therefore it didn't fail.
Current parse behaviour:
1) If a rule causes the internal pointer to "get past the end" of the input,
PARSE considers it a failure. This means, that even a PAREN! rule can fail,
if it removes a part of input.
2) to yield TRUE PARSE must
2a) "get successfully" through the whole rule
2b) get to the end position of the input
My favourite behaviour looks different:
1) "past end" position doesn't mean a failure
2) to yield TRUE PARSE has to "get successfully" through the whole rule
------------------------------------
Anton.