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

Query pattern under a field name matches only the first child #790

Closed
ubolonton opened this issue Nov 2, 2020 · 1 comment
Closed

Query pattern under a field name matches only the first child #790

ubolonton opened this issue Nov 2, 2020 · 1 comment
Assignees
Labels

Comments

@ubolonton
Copy link
Contributor

This is the C code:

struct S {
  int a, b, c;
}

This query returns 3 matches:

(field_declaration (field_identifier) @property.definition)
/tmp/tmp.c
  pattern: 0
    capture: property.definition, start: (1, 6), text: "a"
  pattern: 0
    capture: property.definition, start: (1, 9), text: "b"
  pattern: 0
    capture: property.definition, start: (1, 12), text: "c"

This query returns 1 match:

(field_declaration declarator: (field_identifier) @property.definition)
/tmp/tmp.c
  pattern: 0
    capture: property.definition, start: (1, 6), text: "a"
@maxbrunsfeld
Copy link
Contributor

Thanks for the reproducible report. I will try to look into it this week.

@maxbrunsfeld maxbrunsfeld self-assigned this Nov 2, 2020
@tree-sitter tree-sitter deleted a comment from issue-label-bot bot Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants