Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: newlines

From: dockimbel:free at: 8-Nov-2001 16:39

Hi Ladislav, It seems that 'parse is sometimes just too lazy to finish the job. :) Here's the result of my own tests using your method3 rule :
>> method3: [any [thru ".." t: any #"." u: (remove/part t u) :t] to end] >> s: "x........x....." ; x, 8 dots, x, 5 dots
== "x.......x....."
>> parse/all s method3
== true
>> s
== "x..x.." ; it works !
>> s: "x.........x....." ; x, 9 dots, x, 5 dots >> parse/all s method3
== true
>> s
== "x..x....." ; it fails !?! If you run these two tests with 'trace set to 'on, you'll see in the second test, that 'parse seems to give up when it reachs the second 'x, without any logical reason. IMO, it's probably a bug in 'parse. I've found a workaround to this issue :
>> method3: [any [thru ".." t: opt [any #"." u: (remove/part t u)] :t] to end] >> s: "x.........x....." ; x, 9 dots, x, 5 dots >> parse/all s method3
== true
>> s
== "x..x.." ; it works now ! This modified rule also works well with Brett's test-string2. Cheers, -DocKimbel Ladislav Mecir wrote: