69 Commits

Author SHA1 Message Date
Pierre-Marie de Rodat
6e88d6ec25 Lkt: revamp the module system 2026-01-20 16:03:43 +00:00
Hugo Guerrier
7809c5bfd0 Java API: Ensure empty structs 'dummy' field is correctly initialized when unwrapping
Also ensure empty struct types have a valid 'wrap' method.
2025-09-01 11:51:18 +02:00
Hugo Guerrier
565f495544 Adapt Java testing tools to the new GraalVM version 2025-08-22 09:26:09 +00:00
Pierre-Marie de Rodat
50f50f9f85 Generic API: add bindings for the rewriting features
Move the implementation of the rewriting engine to Langkit_Support and
add bindings to it in the generic API. Rework the C bindings to be
implemented on top of the generic API.

Note that no new testcase is added: the generic API is tested indirectly
by all existing rewriting testcases by the virtue of being the
common implementation behind all the other rewriting APIs. The Ada API
testcase will transition to the generic API once the Ada API is removed.
2025-05-21 08:49:08 +00:00
Pierre-Marie de Rodat
259a1317dc CompiledType.dsl_name: switch to Lkt notations
Also rename `dsl_*` properties, attributes, arguments, ... to `lkt_*`
for consistency.
2025-04-04 09:55:05 +00:00
Hugo Guerrier
7e70293542 Make 'NodeList' iterable in Java API 2025-04-04 09:23:57 +00:00
Pierre-Marie de Rodat
e3d641f973 C API: symbolize exception stack traces only on demand
Symbolization is a costly operation: do it only when requested. Rework
the C API to make this possible. For now, do it automatically in the
Java API to avoid breaking existing Java programs: this will fix the
performance situation in the other C-based APIs.
2025-03-10 13:49:16 +00:00
Remi Segard
c92a5d0027 Add visitor with default behavior in Java bindings 2025-01-31 14:35:27 +01:00
Hugo Guerrier
8c5d6fe202 Adapt Java API to exception stack trace exposure 2025-01-20 08:56:41 +00:00
Pierre-Marie de Rodat
389d78a6e7 langkit.config: introduce JSON deserialization
Also rework lkt_compile and lkt_build_and_run test drivers so that the
language spec configuration bits are stored in the testcase's test.yaml
file directly: no need to add glue code in various places (test driver,
lkt_compile.py/lkt_build_and_run.py scripts) to support a new kind of
language spec configuration.
2025-01-07 15:09:51 +00:00
Pierre-Marie de Rodat
aef63bd2f7 Avoid reparsing units when their source buffer does not change
Also adapt testcases so that they don't rely on unconditionnal
reparsing when the source buffer stays the same.
2024-12-16 09:07:47 +00:00
Hugo Guerrier
69e4c0397b Complete iterators support in the Java bindings
Support for iterators in the Java API was minimal: iterator types were
materialized as types with no iteration primitive.
2024-12-02 08:52:03 +00:00
Pierre-Marie de Rodat
9514b56cf6 Let language specs enable unparsers with a grammar annotation
Whether unparsers are generated or not has implications on legality
checks for the grammar, so it makes sense for this to be a property of
the grammar itself: introduce an Lkt annotation as well as a
langkit.parsers.Grammar argument for it, and remove the corresponding
CompileCtx argument.

Also rename "generate_unparser" to "generate_unparsers" for consistency
across the codebase.
2024-11-05 08:58:12 +00:00
Pierre-Marie de Rodat
e1c4fe5804 Introduce the lkt_build_and_run test driver
Transition all relevant testcases to it. In the process, port
docstrings/comments from test.py files to expected_concrete_syntax.lkt
(now test.lkt) sources and fix stylechecks issues there.
2024-10-15 14:13:10 +00:00
Hugo Guerrier
f5c19813ee Melt the Java 'node_identity' test into the 'general' one 2024-10-10 09:53:06 +00:00
Hugo Guerrier
4d573c6a8c Melt the Java 'event_handler' test into the 'general' one 2024-10-10 09:53:06 +00:00
Hugo Guerrier
623c051c44 Melt the Java 'array_exc' test into the 'general' one 2024-10-10 09:53:06 +00:00
Hugo Guerrier
302c01e265 Java API: Add member reference in the reflection field structure 2024-07-11 12:13:35 +02:00
Pierre-Marie de Rodat
a1c844d5ee Lkt: remove the root type argument for builtin generic types
For AnalysisUnit and LexicalEnv, there is no type argument left, so they
are not generic types anymore.
2024-07-04 12:37:30 +00:00
Romain Beguet
05362a5e93 Improve style and fix formatting issues in dsl_unparse. 2024-07-03 08:23:35 +00:00
Hugo Guerrier
d030b8bbcf Rename the 'Param' class and remove the 'ParamWithDefaultValue' one
Do this renaming to avoid conflicts with possible "Param" named nodes.
Remove 'ParamWithDefaultValue' because it is unnecessary.
2024-06-28 09:51:15 +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
52ed5ff98a Lkt: rename @use_in_equality to @used_in_equality 2024-06-19 10:18:02 +00:00
Pierre-Marie de Rodat
dca25f78d6 Lkt: rename @has_abstract_list to @with_abstract_list 2024-06-19 10:18:02 +00:00
Pierre-Marie de Rodat
eb36d66f4f Lkt: rename @export to @exported 2024-06-19 10:18:02 +00:00