REBOL 3.0

PARSE: allow paths?

Carl Sassenrath, CTO
REBOL Technologies
21-Sep-2009 3:33 GMT

Article #0246
Main page || Index || Prior Article [0245] || Next Article [0247] || 8 Comments || Send feedback

Currently:

>> ob: object [str:]
>> parse "test" [ob/str: "test"]
** Script error: invalid argument: ob/str:
>> parse "test" [:ob/str "test"]
** Script error: invalid argument: :ob/str

But, shouldn't it be allowed?

Update: Added in A83

Test cases so far are:

[
    obj: object [p: "abc" n: 3 s: none b: ["abc"]]
    parse "abc" [obj/p]
]
[
    parse "abc" [obj/b]
]
[
    parse "aaabc" [obj/n "a" "bc"]
]
[
    parse "abc" [obj/s: "abc"]
    obj/s = "abc"
]
[
    parse "abc" [obj/s: "a" (obj/s: head obj/s) :obj/s "abc"]
]
[
    parse "abc" [obj/s: "a" (obj/s: tail obj/s) :obj/s end]
]

[
    obj: object [p: ['a 'b 'c] n: 3 s: none b: [obj/p]]
    parse [a b c] [obj/p]
]
[
    parse [a b c] [obj/b]
]
[
    parse [a a a b c] [obj/n 'a ['b 'c]]
]
[
    parse [a b c] [obj/s: 3 skip]
    obj/s = [a b c]
]
[
    parse [a b c] [obj/s: (obj/s: next obj/s) :obj/s ['b 'c]]
]
[
    parse [a b c] [obj/s: (obj/s: tail obj/s) :obj/s end]
]

and not to forget that this is TRUE:

parse [a/b/c] ['a/b/c]

All above tests pass, but I'm sure you can find many other cases worth verifying.

Parse Summary updated.

8 Comments

REBOL 3.0
Updated 24-May-2017 - Edit - Copyright REBOL Technologies - REBOL.net