Closed amaanq closed 1 year ago
@amaanq no additional testcases, sorry, but this one should be sufficient.
@amaanq actually, I might have one - char (*ptr_to_array)[];
That one seems to work on master, but good to add
reworked
@amaanq as you rework top level statement, I wonder if it makes sense to also target this case: https://github.com/tree-sitter/tree-sitter-c/issues/129
I'm not sure about that one, I think it is correct to associate the pointer declarator with a function name/identifier
I reworked it anyways just for top level functions..if that proves to be incorrect/disputed I will revert @XVilka
Actually, that breaks error recovery a bit in upstream tests and still doesn't fit fully right w/ me, so I reverted it, sorry. That needs a better solution than what I had
Closes #48
I don't like how this looks with the nearly repeated rule, but it's the best option I could think of that didn't impact state count too much, maybe some JS-magic could make it look prettier with manipulating top_level_item
@XVilka if you have some more test cases I could add them
cc @ahlinc