Skip to content

ParserInfo trait #8

Description

@adamthedash

Currently the static info for parsers (name, spec) is tied to the Parser<Input> trait. This info never varies depending on the the input type, so when there are multiple Parser<Input> impls, we end up with duplicate impls and ambiguity requiring calls like this: Parser::<&str>::name(self) rather than self.name().

A better impl would be to split them out into a single ParserInfo trait:

trait ParserInfo {
fn name(&self) -> String;
fn spec(&self) -> ParserSpec;
}

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