(entry_index_specification): accept aspect_specification
In accordance with Ada 2022 RM 9.5.2(8/5); this was not allowed in Ada
2012, but was changed in AI12-0398-1/03.
add dummy test.
(entry_body): directly parse entry_body_formal_part
In Ada grammar the entry_body_formal_part both the
entry_index_specification and the parameter_profile are optional
(because they describe both simple entries and entry families,
both with and without parameters). However, tree-sitter does not
allow rules that match empty strings.
The simplest solution is to directly encode entry_body_formal_part
within the entry_body.
add test.
(extended_return_object_declaration): accept aspect_specification
In accordance with Ada 2022 RM 6.5(2.1/5); this was not allowed in Ada
2012, but was changed in AI12-0398-1/03.
add test.
(_declare_item): accept pragmas
Assert pragmas (and other "executable" pragmas) are specifically allowed
in declare expressions, thanks to a recent AI22-0045. They are accepted
by the latest GNAT compilers.
Regenerate grammar using tree-sitter-linux-x64-0.20.7; add test.
The existing grammar was causing simple expressions to be incorrectly
parsed as a subtype indication. This change raises the precedence for
a discrete choice expression to address that issue.
Updated the test corpus to reflect the parsing correction. Additional
test cases were added for discrete choice.
Instead, package_declaration replaces it. This provides
better folding in nvim: otherwise, the final ';' was not
part of the tree node, and thus the last line "end P;" was
not folded.
This was copied from ada_mode, but results in
confusion when we have statements after the pragma
Fix allocates with if-expression, which no longer
needs double-parenthesis.