On Tuesday 19 September 2006 17:59, Ovid wrote:
> ----- Original Message ----
> From: Shlomi Fish <[EMAIL PROTECTED]>
>
> > my $parser =
> > TAPx::Parser->new(
> > {
> > stream => TAPx::Parser::Iterator->new($test_output_orig),
> > }
> > );
>
> I'd recommend trying this:
>
> my $parser = TAPx::Parser->new( { source => $source } );
>
I converted the code to use this convention in the svn trunk. Seems to work
nicely. Thanks for the advice.
> I did that to simplify building parsers and it's new as of 0.30. $source
> can be one of:
>
> 1. An array reference of TAP lines.
> 2. A complete string of TAP output.
> 3. A filehandle.
> 4. The path to an existing file.
>
> The original interface is still available with a desire to not break
> people's code (plus, I use it internally).
>
> So far it seems to work well, with the only caveat being that filenames are
> not permitted to have newlines in them (I forgot to document that). Thus,
> if the iterator changes in the future, it hopefully won't break your code!
>
Hmmmm.... you may wish to differentiate between #2 and #3 by saying that a
filename is passed as a plain string, while a string is passed by taking a
reference to it. That's what Template Toolkit and other modules are doing.
> > BTW, the documentation for the interface that the "stream => " argument
> > expects on the TAPx::Parser pod may be misleading:
>
> Thanks. I need to clean that up, too!
>
No problem.
Regards,
Shlomi Fish
---------------------------------------------------------------------
Shlomi Fish [EMAIL PROTECTED]
Homepage: http://www.shlomifish.org/
Chuck Norris wrote a complete Perl 6 implementation in a day but then
destroyed all evidence with his bare hands, so no one will know his secrets.