-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
add tree-sitter-regex #1362
add tree-sitter-regex #1362
Conversation
df5267f
to
4376d91
Compare
827d110
to
4d1009b
Compare
Maybe you can upstream the queries :P |
bc6e246
to
978f5fb
Compare
978f5fb
to
9d1bf65
Compare
tree-sitter-regex is looking a bit in need of maintenance in general, I'll see if I can fixup some of the open issues and clean up queries and testing before opening up this PR for review 👍 |
ok I dusted off the repo and upstreamed the queries it's starting to look pretty good now: I didn't look around too much for other languages to inject regex into. Seems like rust would be a good idea but I don't think there's a syntactic construct that is always a regex like |
Are you looking into doing this in rust? (call_expression
function: (scoped_identifier
path: (identifier) @_regex (#eq? @_regex "Regex")
name: (identifier) @_new (#eq? @_new "new"))
arguments: (arguments
(raw_string_literal) @regex))
(call_expression
function: (scoped_identifier
path: (scoped_identifier (identifier) @_regex (#eq? @_regex "Regex").)
name: (identifier) @_new (#eq? @_new "new"))
arguments: (arguments
(raw_string_literal) @regex)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, looks good to me. \o/
Example injected into elixir
it's a pretty subtle improvement; I'm not too impressed yet. Let me dig into the grammar and see if we can write some more interesting queries beyond brackets and quantifiers.