Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: in rule where clauses support #370

Closed
A4-Tacks opened this issue Apr 15, 2024 · 0 comments · Fixed by #371
Closed

feat: in rule where clauses support #370

A4-Tacks opened this issue Apr 15, 2024 · 0 comments · Fixed by #371

Comments

@A4-Tacks
Copy link
Contributor

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()
        }
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant