commit | ffb1f4d0073b003c464f7c0bed9da8e7742064a2 | [log] [tgz] |
---|---|---|
author | David Tolnay <dtolnay@gmail.com> | Thu Dec 28 00:07:59 2017 -0500 |
committer | David Tolnay <dtolnay@gmail.com> | Thu Dec 28 00:07:59 2017 -0500 |
tree | f6fe08d824dcfca17bdad38c30d0979fecac932d | |
parent | 203557ac8a0461455d971350e4527114b063d89c [diff] [blame] |
Remove LexError from public API
diff --git a/src/lib.rs b/src/lib.rs index 2d2ad97..d138dd6 100644 --- a/src/lib.rs +++ b/src/lib.rs
@@ -256,7 +256,10 @@ /// ``` #[cfg(feature = "parsing")] pub fn parse_str<T: Synom>(s: &str) -> Result<T, ParseError> { - _parse(s.parse()?) + match s.parse() { + Ok(tts) => _parse(tts), + Err(_) => Err(ParseError::new("error while lexing input string")), + } } // FIXME the name parse_file makes it sound like you might pass in a path to a