Apparently the 'some is matching the leading/trailing white space:

>> parse " LIB1 " [lib-type]
== false
>> parse " LIB1 " [some lib-type]
== true

Curiously though, try this:

>> parse "asergd asergd" [some symbol some symbol]
== false
>> parse "asergd asergd" [some symbol]
== true

Thus, [some symbol] (using 'charset) is matching the entire string,
regardless of "breaking" white space. To support this, try:

>> parse "LIB1 asergd" [lib-type some symbol]
== true

- Michael Jelinek

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 05, 2000 10:42 AM
To: [EMAIL PROTECTED]
Subject: [REBOL] parse / space



parse is very powerfull but still kills me with spacer:

>> parse "asergd" lib-name  
== true
>> parse "LIB1"  lib-type
== true

so the 2 elements matches the 2 single rules.
but pout together they don't :

>> parse "asergd LIB1" [lib-name lib-type]
== false
>> probe parse "asergd LIB1" [lib-name lib-type]
false
== false
>> parse/all "asergd LIB1" [lib-name lib-type]
== false

but the white space means trouble:

>> parse/all "asergd LIB1" [lib-name " " lib-type]
== true

why one matches with extra white space and not the other ?
>> parse "LIB1 "  lib-type                        
== false
>> parse "asergd " lib-name                          
== true
>> parse " asergd " lib-name  
== true

lib-name: [name]
name: [ some symbol ]
lib-type: [ "LIB1" | "LIB2" ]
symbol: charset [#"0" - #"9" #"A" - #"Z" #"a" -
#"z" #"." #"-" #"_" #"$" #"+" ]


Reply via email to