[perl #41765] [TODO] examples embedded in pod should all be parseable

Will Coleda via RT parrotbug-followup at parrotcode.org
Fri Mar 20 01:34:26 UTC 2009


On Thu Mar 19 13:37:35 2009, coke wrote:
> On Fri Mar 09 11:26:17 2007, particle wrote:
> > we should have a test which makes sure that all pir/pasm embedded in
> > pod files parses as valid. whether we use a syntax like
> > 
> > =for PIR
> > 
> >   .sub main
> >   # ...
> >   .yield(result)
> >   # ...
> >   .end
> > 
> > =cut
> > 
> > or some other means needs thought, design, and implementation.
> > comments and patches welcome.
> > ~jerry
> 
> First pass committed in 37599, using:
> 
> =begin PIR
>  # some valid PIR
> =end PIR
> 
> perl t/examples/pod.t
> 
> or 
> 
> make examples_tests
> 
> to run it. (With this commit, I added two of these blocks to 
> docs/compiler_faq.pod).

Ok. Added the begin PIR/end PIR syntax to several files in docs (but not all).  A nice cage task 
is to go through and add more to self contained PIR snippets that are expected to work.

The check now just tries to compile the code, not run it, which lets us validate syntax even 
on things that would, e.g., block for user input (as one sample in chapter 03 of the book 
did.)

Whiteknight++ for fixing some of the book errors already.

Closing this ticket as resolved; if this test file needs more features, please open a trac ticket.

-- 
Will "Coke" Coleda


More information about the parrot-dev mailing list