Skip to content

impl Lex and Parse for references #5

Description

@drmason13

Should Lex and Parse have the following blanket impl?:

impl<T, O> Parse for &T
where
    T: Parse<Output = O>,
{
    type Output = O;

    fn parse<'i>(&self, input: &'i str) -> ParseResult<'i, Self::Output> {
        (*self).parse(input)
    }
}

Should we have combinators that take references to parsers/lexers?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions