Skip to content
Snippets Groups Projects
Commit f33a77e2 authored by Per's avatar Per
Browse files

parens works

parent a1cadd00
Branches
No related tags found
No related merge requests found
...@@ -15,6 +15,9 @@ fn main() { ...@@ -15,6 +15,9 @@ fn main() {
let v = mylitp!((99)); let v = mylitp!((99));
println!("v {}", v); println!("v {}", v);
// let v = mylitp!(9o9); let v = mylitp!(99);
// println!("v {}", v); println!("v {}", v);
let v = mylitp!((9o9));
println!("v {}", v);
} }
...@@ -47,8 +47,11 @@ struct MyLitP { ...@@ -47,8 +47,11 @@ struct MyLitP {
} }
impl Synom for MyLitP { impl Synom for MyLitP {
// named!(parse -> Self, do_parse!(
// val: call!(LitInt::parse) >> (MyLitP { val })
// ));
named!(parse -> Self, do_parse!( named!(parse -> Self, do_parse!(
val: call!(LitInt::parse) >> (MyLitP { val }) val: parens!(call!(LitInt::parse)) >> (MyLitP { val: val.1 })
)); ));
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment