kursjan / petitparser2

A high-performance top-down parser
MIT License
41 stars 17 forks source link

How to use it consuming input from a stream? #73

Open hernanmd opened 11 months ago

hernanmd commented 11 months ago

This is possibly related with https://github.com/kursjan/petitparser2/issues/55

I want to parse a big CSV file line by line, and I hoped it was something like:

aCSVStream := 'myFile.csv' asFileReference readStream.
ZnBufferedReadStream 
    on: aCSVStream 
    do: [ :stream | (PP2CommaSeparatedParser parse: stream) row ]

But it didn't worked and isn't entirely clear to me what could be a way to parse input from a stream. Is this possible right now?

hernanmd commented 9 months ago

Any suggestion to this? Maybe @kursjan ?