[REBOL] Re: Parse: Restaring rule evaluation
From: lmecir:mbox:vol:cz at: 16-Nov-2001 15:28
Hi Robert,
Robert: <<
rules: [
rule1
| rule2
| rule3
| rul4 call rule5
]
rule5: [
rule51 rule5
| rule52 rule5
| rule53 rul5
]
Now: If parse starts with rules and rule2 can be satisifed it doesn't
continue
with rule3 but restarts with rule1. Why? How does the pattern look like if a
sub-rule in rule5 can't be satisfied? Return to where the rule5 block was
called?
>>
let's suppose:
rule1: [(print "rule1, unsatisfied") end skip]
rule2: [(print "rule2, satisfied")]
Then parse used like:
parse "a" rules
yields:
rule1, unsatisfied
rule2, satisfied
== false
So, no restart happened (exactly as I expected). At the same time, there is
no reason why RULE3 or any other rule should be used, when RULE2 was
satisfied.
Cheers
Ladislav