Dec. 18, 2014
6:54 a.m.
With x, x it will only go to 2 level deep. With the plus you allow to go as far as the x rule succeed and your x rule always succeed because notA always succeed due to the star without consuming anything so you fall into infinite loop. 2014-12-18 6:47 GMT+01:00 James Foster <Smalltalk@jgfoster.net>:
There is something about plus that I donât understand. In the following code if I parse for (x , x) then I get what I expect. If I parse for (x plus) then the image hangs. What am I doing wrong?
James
| a notA x y | a := $a asParser. notA := $a asParser negate star flatten. x := a / notA. y := x , x. âworks fineâ y := x plus. ânever finishesâ ^y end parse: 'abâ.
-- *Guillaume Larcheveque*