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
Add a check in high-level parser function to make sure that all tokens
are consumed by the parser. Also add an option to disable this check.
Fix testcases to strip trailing tokens that are no longer not accepted.
Followup on O525-009
Change-Id: I66799941ea8b37b95cf6b7ea25aa62cf04b01e7a
* 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