ocaml-community / sedlex

An OCaml lexer generator for Unicode
MIT License
235 stars 43 forks source link

Buffer channel input. #76

Closed toots closed 5 years ago

toots commented 5 years ago

This is in reference to issue #45. Per the comments, sedlex should avoid repeatedly calling the same low-level function and use buffered calls instead.

This still does not solve the original issue since the library still expects to fill up a whole chunk of 512 characters at a time, which eventually blocks the read from the channels.

However, since channel reads are buffered with these changes, I believe that it should be possible to change the refill API to only do it one char at a time.