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

Update the pythonic example to demonstrate how to create a flatten token stream from a token tree #166

Closed
wants to merge 1 commit into from

Conversation

tatsuya6502
Copy link

This PR adds a step to the pythonic example to convert a token tree from the lexer into a flat token stream using Stream::from_nested.

This would not be a long-term solution because it's quite verbose, but it will work fine for now.

Relates to #20.

@zesterer
Copy link
Owner

zesterer commented Jul 6, 2022

Thanks! I wonder whether the utility functions could be placed inline at their use site give that they're not particularly complex? I think it makes it easier to see what's going on (i.e: avoids confusion about them being functions from chumsky)

@tatsuya6502
Copy link
Author

Thank you for reviewing the code! I will update my code in this weekend.

@zesterer
Copy link
Owner

zesterer commented Aug 4, 2022

@tatsuya6502 Are you happy for me to take this branch and make the changes myself?

@zesterer
Copy link
Owner

zesterer commented Aug 4, 2022

I've used the work in this PR as a reference when improving the example in 91e5cc8. Thanks!

@tatsuya6502
Copy link
Author

@zesterer Thank you for updating the code and merging it! It is silly; I have been distrusted by other stuff recently. So I am very happy to see the code was merged. Thank you!

@tatsuya6502 tatsuya6502 closed this Aug 5, 2022
@zesterer
Copy link
Owner

zesterer commented Aug 5, 2022

Thanks so much for the initial work you did, it was very useful as a reference!

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

2 participants