86 Commits

Author SHA1 Message Date
Pierre-Marie de Rodat
5a1ee73a26 Liblktlang: fix handling of property references with module prefixes 2026-02-12 11:48:42 +00:00
Pierre-Marie de Rodat
7235199b71 lkt_toolbox: hide type info for modules (always null) 2026-02-12 11:48:42 +00:00
Pierre-Marie de Rodat
d674f8ab4d Liblktlang: override referenced_decl for ImportedId
Also extend lkt_toolbox to exercise it.
2026-02-12 11:48:42 +00:00
Pierre-Marie de Rodat
5ff4e084d7 Enhance lkt_toolbox to exercise ModuleId.referenced_decl
Also extend lkt_toolbox to exercise it.
2026-02-12 11:48:42 +00:00
Pierre-Marie de Rodat
96adb4a586 Liblktlang: add missing handling of type references with module prefixes 2026-02-12 11:48:42 +00:00
Pierre-Marie de Rodat
1256e7a69f Liblktlang: fix semantic analysis for user-provided Metadata types 2026-02-12 11:48:42 +00:00
Pierre-Marie de Rodat
842c61c9f1 Regenerate bootstrap sources 2026-02-12 11:48:42 +00:00
Pierre-Marie de Rodat
c7bc0ca99c Liblktlang: rework properties used to handle prelude entities
Move/rename `LangkitRoot.fetch_prelude` to `LktNode.prelude_unit` so
that this property is easily available from all nodes and so that its
name is more "getter-like".

Also introduce the `LktNode.is_from_prelude` to simplify the codebase.
2026-02-12 11:48:42 +00:00
Pierre-Marie de Rodat
d04dc81e22 Liblktlang: minor refactoring 2026-02-12 11:48:42 +00:00
Pierre-Marie de Rodat
615bdc3b4f Liblktlang: add support for the revamped module system 2026-02-12 11:48:42 +00:00
Pierre-Marie de Rodat
df0ce00bfa Liblktlang: do not assume that the root scope is the env for unit roots
Upcoming work to correctly analyze Lkt modules will introduce one env
for each Lkt module (i.e. for each analysis unit root node): look for
prelude declarations in the root scope directly, and insert "magic"
types (the root node, Metadata) to it.
2026-02-12 11:48:42 +00:00
Pierre-Marie de Rodat
556e670d30 Liblktlang: make LangkitRoot derive Decl
`LangkitRoot` nodes now define modules, so they must be treated as
declarations for these modules. This is necessary for the semantic
analysis to allow named references to Lkt modules.
2026-02-12 11:48:42 +00:00
Pierre-Marie de Rodat
15745870c3 Lkt: regenerate bootstrap sources 2026-02-12 11:48:42 +00:00
Pierre-Marie de Rodat
a0f8539c0c Lkt: allow multiple modules for each import ... clause
It was not allowed so far because of an oversight in the recent revamp
of the module system.
2026-02-12 11:48:42 +00:00
Pierre-Marie de Rodat
58598281ed lkt_toolbox: make it possible to extend Lkt lookup path on the cmd line 2026-02-12 11:48:42 +00:00
Pierre-Marie de Rodat
09dfe3691c lkt_toolbox: add code completion capabilities
This will make it easier to debug code completion features from
Liblktlang.
2026-02-12 11:48:42 +00:00
Pierre-Marie de Rodat
967577513e lkt_toolbox: widen use of P_Custom_Image to all identifiers
There is no reason to restrict it to `Ref_Id` nodes, since this property
is defined on `Id` itself.
2026-02-12 11:48:42 +00:00
Pierre-Marie de Rodat
6ce4b119fa lkt_toolbox: minor reformattings/refactorings 2026-02-12 11:48:42 +00:00
Killian Perlin
8e9b0da932 Simplify parsing for PropertyPatternDetail 2026-02-11 10:37:39 +00:00
Pierre-Marie de Rodat
5fc8a36d3c Make it possible for plugin passes to register extra input files
Use it in Liblktlang so that any modification to the Lkt prelude or the
script that translates it into an Ada unit triggers a recompilation.
2026-02-02 08:50:01 +00:00
Killian Perlin
b66eafd4dc Regenerate bootstrap sources 2026-01-29 13:33:06 +00:00
Killian Perlin
53a7f2540e lkt: Match liblkqllang parse-tree shape for patterns
This commit is a "backport" of the recent changes in the LKQL pattern
syntax to the lkt pattern syntax.

Unused features, deprecated constructs where removed and the parse-tree
was flattened to simplify lowering.

See langkit-query-language#597 and langkit-query-language#596 for more
details.
2026-01-29 13:33:06 +00:00
Pierre-Marie de Rodat
2372b137a7 Liblktlang: add missing resolver arguments in prelude functions
Also add an extensive "lkt" testcase for these functions.
2026-01-27 11:01:47 +00:00
Pierre-Marie de Rodat
75309c8a14 Lkt: handle renaming parts in import clauses 2026-01-20 16:03:43 +00:00
Pierre-Marie de Rodat
63f7bcd73d Regenerate bootstrap sources 2026-01-20 16:03:43 +00:00