briot / tree-sitter-ada

Ada grammar for tree-sitter
MIT License
21 stars 5 forks source link

Correct discriminant_constraint parsing within allocators #11

Closed brownts closed 5 months ago

brownts commented 5 months ago

The existing grammar was causing discriminant constraints in allocators to be incorrectly parsed as function calls. This change modifies the grammar to more accurately follow the grammar of the language and corrects the issue.

Updated the test corpus to add additional allocator tests with numerous subtype indications and qualified expressions for more extensive testing.

This also removes a duplicate entry_declaration rule.

briot commented 5 months ago

Patch looks good to me. In the first commit, the test for the various allocators is getting pretty long though. Perhaps it would be better to create separate tests for each of the allocators ? I am worried that if we have a regression in the future it might be hard to look at the output of the test, since it doesn't fit on one screen (admittedly, we already have other such tests, so this is not blocking).

brownts commented 5 months ago

No problem, I'll pull those out into a separate file and make individual tests for them.