[REBOL] Re: Dialecting......
From: gregg:pointillistic at: 28-May-2008 10:31
Hi Srini,
SI> I had a look at dialects and managed to get a simple one working using
SI> Blocks using Parse (not string parsing)...
Great!
SI> I was wondering if you or someone else could throw some light
SI> (with examples) on more complex parsing. Like recursive parsing
SI> for nested blocks
Look at the INTO keyword in parse.
>> b: ["hello" [world]]
== ["hello" [world]]
>> parse b [string! word!]
== false
>> parse b [string! block!]
== true
>> parse b [string! into [word!]]
== true
>> b: [hello [world]]
== [hello [world]]
>> rule=: [set w [into [word!] | word!] (print mold w)]
== [set w [into [word!] | word!] (print mold w)]
>> parse b [some rule=]
hello
[world]
== true
HTH!
-- Gregg