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

Is there a reason LitStr does not implement Peek? #559

Open
ModProg opened this issue Jun 11, 2023 · 1 comment
Open

Is there a reason LitStr does not implement Peek? #559

ModProg opened this issue Jun 11, 2023 · 1 comment
Labels

Comments

@ModProg
Copy link
Contributor

ModProg commented Jun 11, 2023

No description provided.

@udoprog
Copy link
Collaborator

udoprog commented Jun 11, 2023

No, probably because it's very easy to peek for it using a token 😆

fn peek(p: &mut Peeker<'_>) -> bool {
  matches!(p.nth(0), K![str])
}

Feel free to implement peeking for all literals if you have the time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants