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

ts_node_string is not bridged #184

Open
Ilham-Habibullin opened this issue Aug 18, 2019 · 4 comments
Open

ts_node_string is not bridged #184

Ilham-Habibullin opened this issue Aug 18, 2019 · 4 comments

Comments

@Ilham-Habibullin
Copy link

Can't peek Tree from Ptr since Tree does not implement Storable typeclass. Is there some other proper way to do it?
I am pretty new in Haskell so it might be my fail. Sorry if it is.

@robrix
Copy link
Contributor

robrix commented Aug 19, 2019

If I recall correctly, all of the API which uses Trees actually takes Ptr Tree. Thus, there’s no real value in copying a Tree using Storable since the only thing you could do with it is write it back out to C memory using poke and then pass the resulting pointer around to existing API.

If you describe what you’re trying to accomplish with the Tree, we can probably advise you on the best way to use the API.

@Ilham-Habibullin
Copy link
Author

I wanted to print it, to see how the whole Tree is look like. Right now i have discovered that i suppose to do it with root node, but i can't find function called ts_node_string which is provided with original library.

@robrix
Copy link
Contributor

robrix commented Aug 22, 2019

@IlhamKhabibullin: Yes, we don’t currently bridge that function; I’ve no objection to doing so, however!

@robrix robrix changed the title Tree suppose to be Storable? ts_node_string is not bridged Aug 30, 2019
@robrix
Copy link
Contributor

robrix commented Aug 30, 2019

Edited the issue title to note that ts_node_string is not currently bridged.

@robrix robrix added the bug label Aug 30, 2019
@Gauteab Gauteab mentioned this issue Sep 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants