Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Where to find the source of this Parse::RecDescent oddness?

by hanenkamp (Pilgrim)
on Oct 17, 2003 at 02:22 UTC ( [id://299924]=note: print w/replies, xml ) Need Help??


in reply to Where to find the source of this Parse::RecDescent oddness?

UPDATE:

I've generated precompiled versions of both grammars from each environment. I'm assuming (have not checked yet) that Precompile and new generate identical grammar objects. (If someone more familiar with the internals knows whether this assumption holds, I'd be glad to know for certain before digging through the code myself.) The code being generated is identical in both cases--as I expected.

The place where the differences I can detect appear to come in when the magic $& variable is used to examine the last match. The first disparity in trace output happens in this section of code:

unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A( +?:[a-z_][a-z0-9_]*)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<<Didn't match terminal>>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace( q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__}=$&;

As far as I can tell by reading the code, the value in $& is being lost somewhere between the unless and the _trace.

Anyway, still searching...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://299924]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2024-04-25 22:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found