Aha, this was already reported as
  [perl #60358] Rakudo doesn't recognize grammars with :: in the name
I added my thoughts to that ticket.
Chris

On Nov 5, 2008, at 12:36 AM, Chris Dolan wrote:

Replying to myself: I think the flaw is in my use of "PDF::Grammar::literal_string" as a method pointer. This worked fine when it was "PDF__Grammar::literal_string", but now the following PIR:

  get_hll_global $P108, ["PDF";"Grammar"], "literal_string"

is returning undef. The answer appears to be that the PIR for PDF/ Grammmar.pm includes this:

  .namespace ["PDF::Grammar"]
        .sub "literal_string" :method

instead of

  .namespace ["PDF";"Grammar"]
        .sub "literal_string" :method

So, does that mean teaching PGE/Exp.pir about double-colon separators? Or does namespace separator need to be some sort of compreg flag?

Chris

On Nov 4, 2008, at 9:10 PM, Chris Dolan wrote:

Thanks to Jonathan for working on the :: bug. I'm still having problems, however. The code below worked before I switched all of my "__" class separators to "::". I'm not sure how to tell whether it's failing to find my .pm (I moved the .pm from lib/ PDF__Grammar__Actions.pm to lib/PDF/Grammar/Actions.pm at the same time) or if there's a lingering flaw in the namespace code.

What SVN revision did that change go in? In r32354 on Mac 10.4 ppc I'm getting:

  invoke() not implemented in class 'Undef'

The Perl6 code that triggers that looks like this:

   method is_string(Str $src, Str $expected, Str $msg) {
      my $method = PDF::Grammar::literal_string;
      my $m = $src.$method(:action(PDF::Grammar::Actions.new));
is($m, $expected, $msg) || diag("got: $m, expected: $expected");
   }

and the corresponding PIR is:

    find_lex $P111, "$src"
    unless_null $P111, vivify_19
    new $P111, "Perl6Scalar"
  vivify_19:
    get_hll_global $P112, ["PDF";"Grammar"], "Actions"
    unless_null $P112, vivify_20
    new $P112, "Failure"
  vivify_20:
    $P113 = $P112."new"()
$P114 = $P111.$P110($P113 :named("action")) # <-- this line fails

Thanks,
Chris



Reply via email to