tags:

views:

75

answers:

2

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.

+3  A: 

I'm sorry; your error message contains two clues ('line 54', '::D::test') 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 .

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.

Carl Mäsak
Thanks for pointing out the syntax error with the example. I have updated the code. Going back to (#25 "Minneapolis") from snapshot from February fixed the error. The above code now runs:rakudo-2010-01/parrot_install/bin/perl6 simple.p6abcThanks for your hard work on perl6 and I am looking forward to using it.
tengu
+1  A: 

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

tengu