139 Commits

Author SHA1 Message Date
Pierre-Marie de Rodat
6e88d6ec25 Lkt: revamp the module system 2026-01-20 16:03:43 +00:00
Pierre-Marie de Rodat
74388746c7 Python API: make it possible to create custom unit providers 2026-01-14 15:03:45 +00:00
Pierre-Marie de Rodat
cc22d84bd6 $.C: add converters for entities (public nodes) 2025-11-20 16:22:57 +00:00
Pierre-Marie de Rodat
b91eb80e1a python_api/external_bindings: new test to formalize bindings for users
Add the missing `AnalysisContext._unwrap` classmethod, which was missing
so far for this purpose.
2025-11-20 15:10:27 +00:00
Pierre-Marie de Rodat
6cefc74c93 Set up pre-commit checks and reformat the Python sources with black 2025-03-26 14:04:20 +00:00
Pierre-Marie de Rodat
b22b9e2e64 Python API: fix type checking for entity arguments in properties 2025-03-26 14:03:05 +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
Pierre-Marie de Rodat
4bae239699 Testsuite: rework obsolete output refiners
Now that the Python DSL is gone, must line number hiding is
counter-productive: Python line numbers are not expected to show up in
test outputs in the general case, and hiding them hindes debugging when
there is a Python crash in a testcase. Rework the corresponding output
refiners so that this is done only when actually needed.
2025-02-17 12:02:08 +01:00
Pierre-Marie de Rodat
11af931f2a langkit.config: add support for external exceptions 2025-01-07 15:09:51 +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
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
df84be5d5d python_api/app: fix testcase for Python <3.9 2024-10-18 12:24:37 +00:00
Pierre-Marie de Rodat
54a7dd3a6c Modernize type annotations 2024-10-16 15:23:56 +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
Pierre-Marie de Rodat
345b52a4f7 Sort diagnostics by sloc range after (re) parsing 2024-10-11 09:43:39 +00:00
Pierre-Marie de Rodat
35d5d6a4b8 Switch to property syntax all argument-less built in properties 2024-09-27 10:29:01 +00: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
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
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
Raphaël AMIARD
c9d78f71dc Adapt symbol representation: store reference to symbol table
That'll allow us to go from (thin_symbol, sym_table) to symbol, and vice
versa, where with the old representation there was no other way to go
from symbol to thin than redoing a full-lookup.

That'll help us transition to thin-symbol storage everywhere.
2024-03-22 09:42:03 +01:00
Pierre-Marie de Rodat
9d0d41a826 Add Source_Location as a compiled type
Future work on Lkt will use this compiled type so that properties can
return precisely located errors on string literals.

Note that the exposition of this new compiled type to the OCaml and Java
APIs is incomplete, and is deferred to future developments.
2024-01-11 17:29:43 +00:00
Pierre-Marie de Rodat
1ffd449060 langkit.dsl_unparse: rework empty lines emitted for properties 2023-12-13 13:55:11 +00:00