I do not understand what you are saying or asking.
Normally #asPetitStream should convert any non-memory stream to an efficient in-memory representation. Maybe this does not work properly in the Pharo version you are using? Or maybe your file is too big to be loaded into memory?
While it is technically possible to use PetitParser on an external stream (such as a file or socket stream) it is not advisable. PetitParser requires highly efficient random access to the parsed data and anything else than an indexed in-memory collection slows down the parsing by magnitudes.
Lukas
On 13 February 2012 13:11, Usman Bhatti usman.bhatti@gmail.com wrote:
Hello all,
We are using petitParser with a Stream by the parse method on a PPParser. This parse method calls asPetitStream on our stream which is supposed to return a stream with a valid format for PPParser. The problem is that this stream do not represent our test file but a lot of white spaces. this code:
(StandardFileStream fileNamed: '/some/path/to/file/atextfile.txt' ) asPetitStream proves that.
Did someone else have a similar problem with petit parser?
thanx,
Usman & Guillaume
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev