tags:

views:

55

answers:

1

I really don't master Parse rule yet :)

How do I parse this ?

to-parse: [entity Person {
    String name
    String lastName
    Address home
    Address business
}]

This doesn't work:

entity-rule: ['entity word! #"{" to end]
>> parse to-parse entity-rule
== false
>>
+1  A: 

The third element in your to-parse block is not the char {. It's a string -- REBOL strings can be delineated "..." or {...}

type? to-parse/3
== string!
to-parse/3
{
   String name
   String lastName
   Address home
   Address business
}

To parse the block successfully, you need to be looking for a string:

entity-rule: ['entity word! string! to end]
parse to-parse entity-rule
== true
Sunanda