Skip to content

fix: parse function definition with ptr and attribute#302

Open
maribu wants to merge 1 commit intotree-sitter:masterfrom
maribu:fix-issue-301
Open

fix: parse function definition with ptr and attribute#302
maribu wants to merge 1 commit intotree-sitter:masterfrom
maribu:fix-issue-301

Conversation

@maribu
Copy link

@maribu maribu commented Mar 1, 2026

This adds a possible attribute_specifier rules after the * to the pointer_declarator rule, so that function signatures like

int * __attribute__((used)) foobar(void);

can successfully be parsed. A test has been added to the corpus to verify that the change indeed fixes the issue.

Fixes #301

This adds a possible `attribute_specifier` rules after the `*` to
the `pointer_declarator` rule, so that function signatures like

```C
int * __attribute__((used)) foobar(void);
```

can successfully be parsed. A test has been added to the corpus to
verify that the change indeed fixes the issue.

Fixes tree-sitter#301
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: failure to parse valid function definition

1 participant