Skip to content

Support Verify attribute on Vec<T> #43

Open
@anthok

Description

@anthok

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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions