This patch fixes incorrect support of access-to-subprogram Pre/Post
aspects handling. Aspects were wrongly parsed along with the
access-to-subprogram while they should be parsed along with the
corresponding declaration. Name resolution has been fixed accordingly
too: in Ada 2022, Pre/Post accesses are allowed on
access-to-subprogram, therefore it is now part of the resolution.
TN: V510-008
Move most of "ada/*" to the root directory (this makes sense, as this
repository has been dedicated to Libadalang for years), and rename
"ada/language" to "ada".
TN: T914-010
* ada/ada_parser/*.py: Add indentation specifiers (hard coded at
the moment)
* ada/ada_parser/decl.py: Refactor subprogram parameters into their own
nodes, to be able to indent them correctly.
* compiler/parsers.py: Add an Indent data type that contains data about
the two kind of indents that we support for the moment: relative to
the parent scope's indent level (KIND_REL_POS), and relative to a
specific token's pos (KIND_TOKEN_POS)
Alter the Field's constructor to store the data about indentation
type. Allow a shorcut: passing an integer directly to the field param
will create an Indent datatype with KIND_REL_POS.
* AST (mako files):
* Refactor the parser to store sloc ranges as token indices, rather
than as a source location.
* This allows us to add a 'snap' mode to the lookup primitive, that
will snap to surrounding tokens while doing loookup.
* Add a compute_indent_level method as well as an indent field to
ASTNodes. Calling compute_indent_level on the top node will compute
the indent level of every node.
* interactive_main: Add a stub implementation of file indentation, that
is hard coded in the middle of the main at the moment. It uses the
node visitor and the compute_indent_level primitive to indent a file.
Change-Id: Id0c294ab80c1773ee4ebee91a61c309632473fb1