Also stop building it in `manage.py`` (it is no longer needed for common
Langkit operations). Rename and repurpose `contrib/python_grammar` to
generate+build Libpythonlang, in an attempt to ensure it does not bit
rot.
Minor refactoring: pass the right verbosity level to CompileCtx.__init__
constructor instead of patching it after the instance has been created
(cleaner).
Replace the messy collection of arguments for CompileCtx.__init__ and
CompileCtx.create_all_passes with better organized dataclasses in the
new langkit.config module. Update the codebase to use these data
structures.
Since nowadays Langkit itself depends on both libraries to do its work
and since both libraries use `Langkit_Support`, the standalone mode is
necessary to allow Langkit developpers to use Langkit testcases to check
and debug (potentially very buggy) patches on `Langkit_Support`.
Since `val` is a keyword in Lkt, dsl_unparse fails on expressions that retrieve this
component from an env_assoc value. In particular, such expressions are now used in
Libadalang as part of the changes made under this TN.
That encoding is no longer available in Python3, so roll our own
temporary implementation (before we can get rid of dsl_unparse). Also
remove useless backslashes in the Python grammar.
TN: T511-017
This reverts commit 8d8137610a.
This change had unintended consequences: the indentation tracking
machinery interacts interfers with the trivia production for
whitespaces, breaking Python code parsing. Revert for now, until we have
a plan to more forward. This change was mostly cosmetic anyway (no real
need to preserve whitespaces for the Python parser).
TN: T107-050
Instead of using Python's inheritance mechanism to define enum nodes,
the new mechanism requires adding enum_node = True to the class' body.
Inheritance can now be used to make the enum node derive from any
subclass of ASTNode instead ASTNode itself.