Actually,  I just committed a fix to this.  RubyRegex.search2 should 
store the match result as a backref.  Thanks for digging into this and
creating a report on it.

-Tom

On Fri, 06 Jan 2006, Zane Rockenbaugh defenestrated me:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hmm... I tried something similar, though I was doing the setting in 
> RubyRegexp rather than
> RubyMatchData. RubyMatchData would be the better place to put the code, but 
> functionally, I believe
> I did what you suggest. It didn't seem to work, though. Runnig the following 
> script:
> 
> puts "ALBUM: Foo Bar".match(/ALBUM: [^\s]*\s(.+)/)
> $stdout.puts $1
> 
> I got the following output (from debug code):
> 
> I AM FOUND! $stdout
> NTH REF: 1
> LOOKING AT: 0... set to ALBUM: Foo Bar
> LOOKING AT: 1... set to Bar
> ALBUM: Foo Bar
> nil
> 
> 
> What made me think it was the parser was that $stdout get's found (printed 
> from the
> ~.ast.GlobalVarNode constructor), but the $1 does not seem to get found as a 
> global variable, but is
> found as an "NTH_REF". Rather than a parser change (if I undrestand the debug 
> correctly), could
> ~.ast.NthRefNode be made to extend ~.ast.GlobalVarNode? That alone is not 
> sufficient to make the
> script work properly, but I'm stuck for a complete solution at the moment and 
> have to get to bed.
> 
> Regards,
> Zane
> 
> Thomas E Enebo wrote:
> >   I will commit a readme and the supplementary stuff to build the parser
> > soon (probably this weekend).
> > 
> >   A cursory glance makes me think that RubyMatchData on construction
> > just needs to set the global vars to make $1..$9 work.  I do not think any 
> > parser changes need to happen.
> > 
> > -Tom
> > 
> > On Sun, 01 Jan 2006, Zane Rockenbaugh defenestrated me:
> > 
> > Back July, there was some talk about getting the parser to build from the 
> > source (.y) file and/or at
> > least putting instructions on how to rebuild the parser. I don't see 
> > anything (in 0.8.2 or mainline
> > at least). Does anyone have a script or something they could shoot out?
> > 
> > (If you care why...)
> > 
> > I've been trying to get $X references working ($1, $2, etc.) as in:
> > 
> > puts "ALBUM: Foo Bar".match(/ALBUM: [^\s]*\s(.+)/)
> > puts $1
> > 
> > (bug: 
> > http://sourceforge.net/tracker/index.php?func=detail&aid=1389715&group_id=35413&atid=413912)
> > 
> > It seems do-able enough except that I've never worked with jay, and the 
> > parser/lexer needs to be
> > changed to either recognize $1 (etc.) as a global var (or something... 
> > Setting $1, etc. as
> > appropriate seems straightforward enough.)
> > 
> > Regards,
> > Zane
> 
> - -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
> _______________________________________________
> Jruby-devel mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jruby-devel
> 
> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.0 (GNU/Linux)
> Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
> 
> iD8DBQFDvgeMlckj3vs+R00RAlD+AJ4u/QAToZBuA16sdtLd0Wf8bVS9kwCfTXLt
> S2tgs8mJ1GhKMBVscyk1XT0=
> =mwAh
> -----END PGP SIGNATURE-----
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
> _______________________________________________
> Jruby-devel mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jruby-devel

-- 
+ http://www.tc.umn.edu/~enebo +---- mailto:[EMAIL PROTECTED] ----+
| Thomas E Enebo, Protagonist  | "Luck favors the prepared    |
|                              |  mind." -Louis Pasteur       |


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Jruby-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jruby-devel

Reply via email to