[REBOL] Re: Bug in the parse functionality ???
From: rotenca:telvia:it at: 23-May-2003 14:48
> 2. It does not BREAK from the BLK-RULE on a closing ] or ).
> This causes deep PARSE rule recursion, which overflows something
> internally (not sure what, but I will find out!) Fix is:
I think that parse finds its recursion limits like in this example:
n: 0 parse "" x: [(n: n + 1) x] n; == 201
I think that parse should fire an error when this happen. Now the rule fails
and parse continue with the next command.
I think that recursion is not needed at all in clean-script. With or without a
correct recursion the same thing happens.
Here it is the rule without any reccursion. Is it wrong?
parse script [
newline (emit-line) |
#";" [thru newline | to end] new: (emit str new) |
[#"[" | #"("] (emit str 1 insert tail indent tab) |
[#"]" | #")"] (remove indent emit str 1) |
skip (set [value new] load/next str emit str new) :new