rebol:如何创建解析大括号的规则?
我真的还没有掌握解析规则:)
我该如何解析这个?
to-parse: [entity Person {
String name
String lastName
Address home
Address business
}]
这不起作用:
entity-rule: ['entity word! #"{" to end]
>> parse to-parse entity-rule
== false
>>
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
>>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
to-parse 块中的第三个元素不是字符 {。它是一个字符串——REBOL字符串可以被描述为“...”或{...}
要成功解析块,您需要寻找一个字符串:
The third element in your to-parse block is not the char {. It's a string -- REBOL strings can be delineated "..." or {...}
To parse the block successfully, you need to be looking for a string:
会将名称收集到块名称中,并将地址收集到块地址中。
不过这个答案在 Rebol3 中不起作用。不知道为什么不。
will collect the names into the block names, and addresses into the block addresses.
This answer doesn't work in Rebol3 though. Not sure why not.