-
Notifications
You must be signed in to change notification settings - Fork 6
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
Inspiration #5
Comments
Thank you for the information. Do you mean this project gitlab:thchha/tree-sitter-scheme? Thank you again for reaching out. |
Exactly this grammar. I need to be able to judge about the kind of syntax-node. I wasn't able to archive this via a patch on your grammar so had to restart. Note that I abstracted the BNF-grammars of said RnRS, so it should be fairly complete. For example, I need to be able to identify the following S-Exp as a call to define via tree-sitter queries (without relying on regex, searches for each and every node): (define (main . args)
(map pp args)
(exit 0)) We should talk again before implementing a custom-parser.c each on their own, I think. |
I considered this problem when I started to implement it. Note here I will use the term syntax for
Both them make the statically recognization of the syntax is impractical. For (list
.
(symbol) @keyword
.
(list
.
(symbol) @function
.
[((symbol) @dot
(symbol) @arguments)?
(symbol) @argument]*
(#eq? @keyword "define")
(#eq? @dot "."))) |
My current use is rather domain specific and I am able to work around this. I think the context of this conversation and your provided listing is a concise and valuable hint for new users to your grammar.
|
Okay. I remembered that the query are supported by the tree-sitter library I will link README to this issue, and your repo for the people who don't like |
Yes, tree-sitter offers such an API. And one has to grasp the way the query patterns are iterated on each step of a query. So there's that. Thank you for your input. If I need to implement a custom- |
Hey 6cdh,
just wanted to let you know that I have a working R5RS and most of R7RS tree-sitter grammar.
Maybe you want to join efforts.
Let me know.
Thomas
The text was updated successfully, but these errors were encountered: