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

Provide a way to call Lexer methods from SpannedIter #231

Closed
wants to merge 5 commits into from

Conversation

simvux
Copy link

@simvux simvux commented Dec 30, 2021

Do you think this is appropriate or would it be better to just manually re-create some of the useful methods/impls such as Clone source() slice()?

@marcospb19
Copy link
Contributor

would it be better to just manually re-create some of the useful methods

I prefer this approach because someone might add some method to Lexer, and forget to add it to SpannedIter.

I'd love this to be merged, ping @maciejhirsz.

@simvux
Copy link
Author

simvux commented Feb 25, 2023

I've accidentally done some other stuff on the same branch since I forgot about this PR. But if the project wakes up again then I'll just make a new PR.

@maciejhirsz
Copy link
Owner

Hey! Instead of as_lexer and as_lexer_mut could we implement std::ops::Deref and std::ops::DerefMut instead? That should make it possible to access all the Lexer methods (sans the ones that take Lexer by value) and fields more ergonomically.

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

Successfully merging this pull request may close these issues.

None yet

3 participants