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

Parser trait should be renamed to Transformer trait #125

Open
notdanilo opened this issue Oct 23, 2023 · 0 comments
Open

Parser trait should be renamed to Transformer trait #125

notdanilo opened this issue Oct 23, 2023 · 0 comments
Labels
Milestone

Comments

@notdanilo
Copy link
Contributor

notdanilo commented Oct 23, 2023

Rename Parser to Transformer and implement Parser as a specialization of Transformer where the Input is a string.

trait Transformer<Input> {
  type Output;
  fn transform(&self, input: Input) -> Result<Self::Output>;
}

trait Parser<T>: Transformer<&str, Output = T> {
  fn parse(&self, &str) -> Result<Self::Output>;
}
@notdanilo notdanilo added this to the Ligen 1.0 milestone Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 🆕 New
Development

No branches or pull requests

1 participant