commit | a8228364b4007d2a0d70f148480f919e00807e99 | [log] [tgz] |
---|---|---|
author | David Tolnay <dtolnay@gmail.com> | Thu Dec 22 15:21:54 2016 -0500 |
committer | David Tolnay <dtolnay@gmail.com> | Thu Dec 22 15:21:54 2016 -0500 |
tree | ba9db4c80b578b75df32832805960c17bd865d36 | |
parent | 62f4fb6dc50abdfc946a9efa532b8e1707dab06a [diff] |
Funtion to parse a single ident
diff --git a/src/lib.rs b/src/lib.rs index 824c7b6..6f5fd21 100644 --- a/src/lib.rs +++ b/src/lib.rs
@@ -144,6 +144,10 @@ unwrap("token trees", mac::parsing::token_trees, input) } + pub fn parse_ident(input: &str) -> Result<Ident, String> { + unwrap("identifier", ident::parsing::ident, input) + } + fn unwrap<T>(name: &'static str, f: fn(&str) -> IResult<&str, T>, input: &str)