kevinmehall/rust-peg

feat: in rule where clauses support

Closed this issue · 0 comments

use std::str::FromStr;

peg::parser! {
    grammar parser() for str {
        pub rule foo<T: FromStr>() -> T
        //where <T as FromStr>::Err: Debug // peg not support where
            = s:$(['0'..='9']+)
        {
            s.parse().unwrap()
        }
    }
}