176 Commits

Author SHA1 Message Date
Pierre-Marie de Rodat
18fa52f05a Transition to leftovers tests to types_from_lkt=True 2024-09-11 13:00:20 +00:00
Pierre-Marie de Rodat
5dbb6ea5a9 Testsuite: blacklist calls to build_and_run from DSL locations 2024-08-19 09:58:04 +00:00
Pierre-Marie de Rodat
ec4872e418 Lkt: change naming convention for token names for lower to camel
This makes the convention consistent with the DSL, and avoids
workarounds for conflicts with Lkt keywords: in Libadalang, the Null
token can stay Null, instead of null_tok (no API breakage needed).
2024-06-28 08:41:26 +00:00
Pierre-Marie de Rodat
5d5a1029cb Lkt: rename @unparse_newline_after to @with_unparsing_newline 2024-06-19 10:18:02 +00:00
Pierre-Marie de Rodat
0ca47a255c Lkt: rename @unparse_spacing to @unparsing_spacing 2024-06-19 10:18:02 +00:00
Pierre-Marie de Rodat
8da114fb26 Unparsing: keep track of the link to original tokens
This change enhances the unparsing engine so that template instantiation
keeps track of tokens from the source code to reformat as the unparsed
token are produced.

This is preparatory work to preserve formatting information from the
original source code (empty lines and comments), but no change of
behavior is expected at this stage.
2024-06-10 12:38:13 +00:00
Pierre-Marie de Rodat
a998c198dd Bind libraries and programs with -E/-Es depending on build mode 2024-05-29 09:42:28 +00:00
Pierre-Marie de Rodat
2467c2962b Unparsing: introduce built-in default configs for generated libraries 2024-05-24 11:58:44 +00:00
Pierre-Marie de Rodat
3df6923bcc Testsuite: enable lkt_compile tests to check the CompileCtx
Transition the remaining Lkt tests that needed this feature from the
Python driver to the lkt_compile one.
2024-05-13 10:55:03 +00:00
Pierre-Marie de Rodat
7feab1de46 Fix invalid escape sequences in Python code
With recent Python versions, this triggers a SyntaxWarning: address
them.
2024-04-23 14:47:22 +00:00
Romain Beguet
be7e345064 Implement a generic collection mechanism for lexical env lookup caches.
This also repurposes the `All_Diags_Trace` GNATCOLL trace which was
introduced recently but in fact never used.
2024-03-11 09:11:33 +00:00
Pierre-Marie de Rodat
73ef5560c0 Lexer: use the first text found for a token in order to unparse it 2024-02-28 09:51:39 +00:00
Pierre-Marie de Rodat
e2f68bb610 Introduce the "is_comment" trivia annotation
This new annotation will allow unparsers to determine which trivia
should be preserve during unparsing (no trivia is preserve right now).
2024-02-19 12:19:08 +00:00
Pierre-Marie de Rodat
af1fd458bf Testsuite: rework GPR main specifications
Rework the way testcases specify lists of GPR mains to run so that it is
possible to run the same main multiple times with different arguments.
2024-01-10 15:08:06 +00:00
Pierre-Marie de Rodat
f9a101856f Make "generate_unparser" a CompileCtx constructor parameter
Whether to generate unparsers or not has non-trivial implications on the
language spec. For this reason, it does not make much sense to keep this
setting as a code generation option: it should instead be a property of
the language spec itself.
2024-01-10 12:36:41 +00:00
Pierre-Marie de Rodat
dfcf584cbe Langkit_Support.Generic_API.Unparsing: add Prettier output prototype 2024-01-10 12:36:41 +00:00
Pierre-Marie de Rodat
a1ae4d9cda properties/warn_public_doc: transition to the lkt_compile driver 2023-12-13 13:36:33 +00:00
Pierre-Marie de Rodat
d46bddb785 properties/big_integer: rework testcase
Enhance it to cover more DSL operations on big integers, and remove uses
of lexical envs, clearly not necessary to test big integers. This will
help transitionning the testcase to Lkt.
2023-12-13 13:36:33 +00:00
Pierre-Marie de Rodat
8af036b351 python_support/lkt_compile.py: accept "*.lkt" files as arguments
When debugging a testcase that contains multiple "*.lkt" files, it is
sometimes convenient to run the "lkt_compile.py" script on a single
source file. This commit extends this script to accept "lkt entry
points" as command line arguments.
2023-12-13 13:36:32 +00:00
Pierre-Marie de Rodat
2f0f07acbe lkt_compile driver: add support to run post-compilation test.py scripts
Some test will use this script to perform arbitrary checks on the result
of the compilation.
2023-12-13 13:36:32 +00:00
Pierre-Marie de Rodat
eef3d0061f python_support/utils.py: remove obsolete argument 2023-12-13 13:36:31 +00:00
Pierre-Marie de Rodat
5f2a4be656 Python bindings: make the version number PEP 440-compliant 2023-11-30 10:58:41 +00:00
Pierre-Marie de Rodat
16639a7818 lexer_example: set "var" as alphanumerical
This is necessary so that unparsing inserts a space between "var" and
"foo" in "var foo". That problem was undetected so far in our only
rewriting API test because all variable declaration nodes were rewritten
from sources (they were not synthetized), so formatting (which includes
that space) was preserved.
2023-11-13 13:30:29 +00:00
Pierre-Marie de Rodat
27c7a4de00 Java API: bind AnalysisContext.Get_From_Provider 2023-07-31 09:28:19 +00:00
Pierre-Marie de Rodat
4f0edda8a3 Testsuite: rework "main" arguments for build_and_run
In particular, rename "ada_main" to "gpr_main" and allow it to contain
both Ada and C mains. Also remove the now useless "with_c" argument, and
the unused "mains" one as well.
2023-06-08 10:43:23 +00:00