PistonDevelopers / meta

A DSL parsing library for human readable text documents
MIT License
90 stars 5 forks source link

Make `parse` and `syntax` take `Read` #260

Closed bvssvni closed 8 years ago

bvssvni commented 9 years ago

This will make it easier to use with binary data and files.

Binero commented 9 years ago

syntax has same issue

bvssvni commented 9 years ago

ParseError would need to handle utf8 and io errors.

Binero commented 9 years ago

Issue is that CharsError can be any Error, and Error doesn't implement PartialEq. Because of this, and the way the library is built to return a Result<_, (_, ParserError)>, we wouldn't be able to assert_eq on what the parser returns.

bvssvni commented 9 years ago

Can we implement PartialEq for ParseError?

Binero commented 9 years ago

Not when it contains a CharsError.

bvssvni commented 9 years ago

One problem is that because the rules can backtrack when they fail, it might require the whole source in memory when parsing.

bvssvni commented 8 years ago

Won't implement this because of backtracking. Closing.