7 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
ee5303cc68 Lkt lowering: fix null-cond propagation for x?.y or? z
When `x` is null, the result of this expression must be `z`. Because of
incorrect lowering of the `or?` operator to abstract expressions, the
left operand (`x?.y`) was considered as a prefix, and so the whole
expression returned null when any prefix in `x?.y` (thus `x` included)
was null.

The `or?` operator has no prefix, since it does not use dot notation, so
its lowering must not create a prefix.
2024-12-20 08:02:25 +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
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
eb36d66f4f Lkt: rename @export to @exported 2024-06-19 10:18:02 +00:00
Pierre-Marie de Rodat
89db9af5e8 Properties: correct compilation for the null-cond operator (._. / ?.)
Completely rework the expansion of expressions to account for
null-conditional operations: for instance, compile `a?.b.c` as
`a.then(a => a.b.c)` instead of the current `a.then(a => a.b).c`.
2024-04-29 10:51:55 +00:00