Skip to content

Provide a way to call Lexer methods from SpannedIter#231

Closed
simvux wants to merge 5 commits intomaciejhirsz:masterfrom
simvux:master
Closed

Provide a way to call Lexer methods from SpannedIter#231
simvux wants to merge 5 commits intomaciejhirsz:masterfrom
simvux:master

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.

3 participants