diff --git a/examples/ex1.rs b/examples/ex1.rs index cb65f1f22c1d82f9152ec56210f1484d21937ee1..77e285ff585ac8cca5d91dea549408d18797ed79 100644 --- a/examples/ex1.rs +++ b/examples/ex1.rs @@ -15,6 +15,9 @@ fn main() { let v = mylitp!((99)); println!("v {}", v); - // let v = mylitp!(9o9); - // println!("v {}", v); + let v = mylitp!(99); + println!("v {}", v); + + let v = mylitp!((9o9)); + println!("v {}", v); } diff --git a/src/lib.rs b/src/lib.rs index 0594a343410903eae8bbe6d74f98dfc73a116763..b858620df26d28851b1be98c03c83efdf1b35aa9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -47,8 +47,11 @@ struct MyLitP { } impl Synom for MyLitP { + // named!(parse -> Self, do_parse!( + // val: call!(LitInt::parse) >> (MyLitP { val }) + // )); named!(parse -> Self, do_parse!( - val: call!(LitInt::parse) >> (MyLitP { val }) + val: parens!(call!(LitInt::parse)) >> (MyLitP { val: val.1 }) )); }