ziman / lightyear

Parser combinators for Idris
Other
238 stars 43 forks source link

Refactor Lightyear.String to Lightyear.Char and add missing functionality #34

Closed bgaster closed 9 years ago

bgaster commented 9 years ago

This changes refactors some of the functions in Lightyear.Strings to a new module Lightyear.Char, to follow more closely the implementation of Daan Leijen's Parsec. Additionally it adds missing functionality from that library, found in Parsec.Text.Char.

I think there is a real benefit to be close to Daan's original library as it will make porting to and using Lightyear much easier.

All tests have been updated to account for these changes and run as expected.

This changelist is a set of breaking changes for earlier Lightyear users. The breaking changes are small and require adding an additional import:

  import Lightyear.Char

I think it is likely we would really want to factor out more from Lightyear.Strings, but I've left this to a future change.

bgaster commented 9 years ago

Sorry, I should have also mentioned that

space

has been renamed

spaces

and a function

space

introduced that passes a single whitespace, al la Parsec.

ziman commented 9 years ago

I see you also generalised the char parsers for any str, which is exactly what I went to check before merging.

Great, thanks! :)