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

Allow non UTF-8 source code #157

Closed
edgarogh opened this issue Jun 22, 2023 · 3 comments
Closed

Allow non UTF-8 source code #157

edgarogh opened this issue Jun 22, 2023 · 3 comments

Comments

@edgarogh
Copy link

Currently, rowan requires string slices. However, not all programming languages require UTF-8, which makes it impossible to represent them using a rowan tree without adding arbitrary rules to the existing specification. It would be convenient if we could, for instance, use byte slices as our base source code representation. If a maintainer has an idea of how this would work (how to specify whether or not Unicode is enforced using &str), I would love to draft a PR.

@matklad
Copy link
Member

matklad commented Jun 22, 2023

This is explicitly out of scope - rowan supports only utf8 documents. The best way to support other encodings would be to fork the library.

@edgarogh
Copy link
Author

Ok, thanks for the information, I didn't know that.

@edgarogh
Copy link
Author

For anyone reading this, it looks like Rune's syntree library can be a good alternative. And it also provides a solution for #26.

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

No branches or pull requests

2 participants