Some more compelling synom examples
diff --git a/src/attr.rs b/src/attr.rs
index 8eac137..afa611e 100644
--- a/src/attr.rs
+++ b/src/attr.rs
@@ -159,7 +159,7 @@
|
do_parse!(
punct!("///") >>
- not!(peek!(tag!("/"))) >>
+ not!(tag!("/")) >>
content: take_until!("\n") >>
(Attribute {
style: AttrStyle::Outer,
diff --git a/src/expr.rs b/src/expr.rs
index 9eae723..80045c2 100644
--- a/src/expr.rs
+++ b/src/expr.rs
@@ -970,8 +970,8 @@
|
keyword!("self") => { Into::into }
) >>
- not!(peek!(punct!("<"))) >>
- not!(peek!(punct!("::"))) >>
+ not!(punct!("<")) >>
+ not!(punct!("::")) >>
subpat: option!(preceded!(punct!("@"), pat)) >>
(Pat::Ident(
if mode.is_some() {
diff --git a/src/item.rs b/src/item.rs
index dc4157e..ea530b7 100644
--- a/src/item.rs
+++ b/src/item.rs
@@ -484,14 +484,14 @@
lt: option!(lifetime) >>
mutability: mutability >>
keyword!("self") >>
- not!(peek!(punct!(":"))) >>
+ not!(punct!(":")) >>
(FnArg::SelfRef(lt, mutability))
)
|
do_parse!(
mutability: mutability >>
keyword!("self") >>
- not!(peek!(punct!(":"))) >>
+ not!(punct!(":")) >>
(FnArg::SelfValue(mutability))
)
|
diff --git a/src/krate.rs b/src/krate.rs
index 7ed16b5..077a36d 100644
--- a/src/krate.rs
+++ b/src/krate.rs
@@ -29,7 +29,7 @@
named!(shebang -> String, do_parse!(
tag!("#!") >>
- not!(peek!(tag!("["))) >>
+ not!(tag!("[")) >>
content: take_until!("\n") >>
(format!("#!{}", content))
));
diff --git a/src/lib.rs b/src/lib.rs
index 204688e..85d7685 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -56,6 +56,8 @@
mod lit;
pub use lit::{FloatTy, IntTy, Lit, StrStyle};
+#[cfg(feature = "parsing")]
+pub use lit::{ByteStrLit, FloatLit, IntLit, StrLit};
mod mac;
pub use mac::{BinOpToken, DelimToken, Delimited, Mac, Token, TokenTree};
@@ -206,4 +208,6 @@
pub use mac::parsing::token_tree as tt;
pub use ident::parsing::ident;
+
+ pub use generics::parsing::lifetime;
}
diff --git a/src/mac.rs b/src/mac.rs
index 9a648d4..26b3c61 100644
--- a/src/mac.rs
+++ b/src/mac.rs
@@ -283,7 +283,7 @@
|
do_parse!(
punct!("///") >>
- not!(peek!(tag!("/"))) >>
+ not!(tag!("/")) >>
content: take_until!("\n") >>
(format!("///{}", content))
)
diff --git a/src/ty.rs b/src/ty.rs
index 4031fc3..f0cc88c 100644
--- a/src/ty.rs
+++ b/src/ty.rs
@@ -487,7 +487,7 @@
cond!(!lifetimes.is_empty(), punct!(",")),
separated_nonempty_list!(
punct!(","),
- terminated!(ty, not!(peek!(punct!("="))))
+ terminated!(ty, not!(punct!("=")))
)
)) >>
bindings: opt_vec!(preceded!(
@@ -552,7 +552,7 @@
name: option!(do_parse!(
name: ident >>
punct!(":") >>
- not!(peek!(tag!(":"))) >> // not ::
+ not!(tag!(":")) >> // not ::
(name)
)) >>
ty: ty >>