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

Support Verify attribute on Vec<T> #43

Open
anthok opened this issue Sep 28, 2022 · 0 comments
Open

Support Verify attribute on Vec<T> #43

anthok opened this issue Sep 28, 2022 · 0 comments

Comments

@anthok
Copy link

anthok commented Sep 28, 2022

Tried the following code below and wasn't able to use Verify on a Vec<>, it looks related to the change made for
a926c09.

#[nom(Verify="*test.len() > 0")]
 pub test: Vec<Test>

Error

consider giving this closure parameter an explicit type, where the type for type parameter `O2` is specified: `: &O2`

However, if writing the nom code manually and defining the closure type it will work.

#[nom(Parse = "{
        let parse_test = |i| {
            Test::parse(i)
        };
        verify(many0(complete(parse_test)), |test: &Vec<Test>| test.len() > 0)
    }")]
    pub test: Vec<Test>
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

No branches or pull requests

1 participant