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

Feat(query): include group + individual token #208

Closed
ilan-schemoul opened this issue May 19, 2024 · 1 comment
Closed

Feat(query): include group + individual token #208

ilan-schemoul opened this issue May 19, 2024 · 1 comment

Comments

@ilan-schemoul
Copy link

Problem

I want to select
"struct abc {
int a;
};"
struct_specifier in c does not include semicolon
I do not know if it's a bug or I don't know how to use the app or a feature lacks but :
((struct_specifier ()) ";") @c
@c is not the struct with ";" but is the struct without semicolon
(struct_specifier (
) ";") @c gives error impossible pattern

Expected behavior

((struct_specifier (_)) ";") @c to select struct with semicolo or something similar

@amaanq
Copy link
Member

amaanq commented May 24, 2024

belongs in tree-sitter-c, but you can just do this

(translation_unit
  (struct_specifier (_))
  .
  ";") @c

@amaanq amaanq closed this as completed May 24, 2024
@amaanq amaanq transferred this issue from tree-sitter/tree-sitter May 24, 2024
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