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

Support nostd #3391

Open
cathaysia opened this issue May 28, 2024 · 5 comments · May be fixed by #3395
Open

Support nostd #3391

cathaysia opened this issue May 28, 2024 · 5 comments · May be fixed by #3395
Labels
enhancement Feature request

Comments

@cathaysia
Copy link

Problem

Have you considered adding support for nostd? Or will similar PRs be allowed to be merged?

Expected behavior

No response

@cathaysia cathaysia added the enhancement Feature request label May 28, 2024
@amaanq
Copy link
Member

amaanq commented May 29, 2024

no_std where? the lib? the cli? and why, what's the use case/benefit exactly?

@cathaysia
Copy link
Author

no_std for the tree-sitter rust lib. This makes no_std environment can using tree-sitter parse text.

I use tree-sitter to parse grammar in my recent project. But my project runs on bare metal, if tree-sitter (rust) supports no_std, then tree-sitter can run in a wider range of environments.
Currently in my private fork, I have successfully compiled the into the no_std environment after make query-related code as a feature. So I think this work should be relatively simple.

@cathaysia
Copy link
Author

In fact, the main blocker for no_std is the regex library referenced by the tree-sitter query.

@ObserverOfTime
Copy link
Member

PR welcome if you make nostd an optional feature instead of the other way around.
You likely just need to disable the #match? predicates, rather than the entire query code.

@cathaysia
Copy link
Author

I don't quite understand the difference between them. But I'll open a simple PR later to describe my thoughts. Please and welcome to comment it. :)

cathaysia added a commit to cathaysia/tree-sitter that referenced this issue May 30, 2024
close tree-sitter#3391

Signed-off-by: DragonBillow <DragonBillow@outlook.com>
@cathaysia cathaysia linked a pull request May 30, 2024 that will close this issue
cathaysia added a commit to cathaysia/tree-sitter that referenced this issue May 30, 2024
close tree-sitter#3391

Signed-off-by: DragonBillow <DragonBillow@outlook.com>
cathaysia added a commit to cathaysia/tree-sitter that referenced this issue May 31, 2024
close tree-sitter#3391

Signed-off-by: DragonBillow <DragonBillow@outlook.com>
cathaysia added a commit to cathaysia/tree-sitter that referenced this issue May 31, 2024
close tree-sitter#3391

Signed-off-by: DragonBillow <DragonBillow@outlook.com>

Update lib/Cargo.toml

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>

Update lib/Cargo.toml

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
cathaysia added a commit to cathaysia/tree-sitter that referenced this issue Jun 11, 2024
close tree-sitter#3391

Signed-off-by: DragonBillow <DragonBillow@outlook.com>

Update lib/Cargo.toml

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>

Update lib/Cargo.toml

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
cathaysia added a commit to cathaysia/tree-sitter that referenced this issue Jun 11, 2024
close tree-sitter#3391

Signed-off-by: DragonBillow <DragonBillow@outlook.com>

Update lib/Cargo.toml

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>

Update lib/Cargo.toml

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
cathaysia added a commit to cathaysia/tree-sitter that referenced this issue Jun 11, 2024
close tree-sitter#3391

Signed-off-by: DragonBillow <DragonBillow@outlook.com>

Update lib/Cargo.toml

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>

Update lib/Cargo.toml

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants