在 rakudo perl6 中使用语法时遇到问题
最简单的语法用法给我带来了编译错误。
use v6;
grammar Foo {
token bar { \w+ }
}
say 'abc' ~~ /<Foo::bar>/;
像 src/rakudo/perl6 simple.p6 一样调用,它失败了,
regex assertion not terminated by angle bracket at line 7, near "::bar>/;\n"
...
我尝试了一些具有类似结果的已知工作示例,所以我怀疑我的 perl6 设置不正确。
如果您在 perl6 中使用语法,请告诉我您的设置。提前致谢。
The simplest grammar usage gives me complation error.
use v6;
grammar Foo {
token bar { \w+ }
}
say 'abc' ~~ /<Foo::bar>/;
Invoked like src/rakudo/perl6 simple.p6
, it fails with
regex assertion not terminated by angle bracket at line 7, near "::bar>/;\n"
...
I tried a number of known-to-work examples with similar results, so I suspect that my perl6 setup is incorrect.
If you use grammar with perl6, please show me your setup. Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对不起;您的错误消息包含两条线索(
第 7 行
、::bar
),表明您粘贴的代码不足以诊断您的问题。没有足够的信息来理解您的问题。除此之外,您发布的代码的最后一行中有一个不匹配的右括号,并且您尚未声明
。我不认为你的 Perl 6 设置是不正确的,就其价值而言。你所写的内容中没有任何内容表明这一点。
I'm sorry; your error message contains two clues (
line 7
,::bar
) that the code you've pasted is not enough to diagnose your problem. There's just not enough information to understand your problem.Apart from that, you have a mismatched closing parenthesis in the last line of the code you did post, and you haven't declared the
<Foo::bar>
.I don't think your Perl 6 setup is incorrect, for what it's worth. There's nothing in what you've written to indicate that.
Rakudo 2010.02 版本(#26“阿姆斯特丹”) 存在一个会破坏模块导入的回归。
请改用 Rakudo 2010-01 版本(#25“明尼阿波利斯”)。
下载页面在这里:http://github.com/rakudo/rakudo/downloads
Rakudo 2010.02 release (#26 "Amsterdam") has a regression that breaks module import.
Use Rakudo 2010-01 release (#25 "Minneapolis") instead.
download page is here: http://github.com/rakudo/rakudo/downloads