# New Ticket Created by "Mark E. Shoulson"
# Please include the string: [perl #72070]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=72070 >
Here are two files; one works (shows a match), and one errors with
get_attr_str() not implemented in class 'Integer'
in Main (file src/gen_setting.pm, line 324)
==========================================
# This one works:
use v6;
grammar Simpl {
token xxx { 'x' }
token c { 'c' }
token end { '!' }
token xc { <xxx>*<c> }
token xend { <xxx>*<end> }
}
my $sample="cx!";
my $answer=($sample ~~ /<Simpl::xend>/);
say $answer.perl;
============================================
# This one does not:
use v6;
# grammar Simpl {
token xxx { 'x' }
token c { 'c' }
token end { '!' }
token xc { <xxx>*<c> }
token xend { <xxx>*<end> }
# }
my $sample="cx!";
my $answer=($sample ~~ /<xend>/);
say $answer.perl;
=============================================
Note that the only difference between them is whether or not I'm using
the grammar Simpl as a namespace for the regexps or leaving them at top
level. If my understanding of grammars is correct, using a grammar in
this way should be optional; I ought to be able to use the tokens
directly. Any ideas?
Details:
Rakudo git commit 3867ffd5b624437a565fa6a30d89f6fc18866797
Parrot revision 43076
Fedora 11 Linux, i386
~mark