Thank you for the bug fix. I think the problem is somewhere else, though.

Directly parsing on a FileStream should normally not happen, parsing
is supposed to happen on a PPStream. Actually PetitParser should
automatically convert the FileStream to a PPStream using the
#asPetitStream convertor prior to parsing. Doesn't that happen in your
case?

For example the following code works well in my image without your
patch and it consumes the complete contents of the file:

   #any asParser star flatten parse: (FileStream oldFileNamed: 'README')

In the method PPFlattenParser>>parseOn: I get an instance of PPStream.

Lukas

PS: Make sure to call the #parse: method to start the paring (with a
stream or string as argument), do not call directly #parseOn: (see the
method comment).

On 15 June 2010 02:47, Ross Boylan <[email protected]> wrote:
> The original parseOn: code failed for me with a FileStream in the Pharo
> 1.0 image.  The last line gets the collection of the stream, and this is
> nil (or something that didn't work in the invoked method).  I've
> attached a revision that works for me.
>
> Ross
>



-- 
Lukas Renggli
www.lukas-renggli.ch

_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to