68 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
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
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
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
Pierre-Marie de Rodat
1ffd449060 langkit.dsl_unparse: rework empty lines emitted for properties 2023-12-13 13:55:11 +00:00
Pierre-Marie de Rodat
dfb2360400 Lkt lowering: handle env specs and missing env-related expressions 2023-12-13 13:55:11 +00:00
Pierre-Marie de Rodat
a84bb14f92 Lkt/langkit.dsl_unparse: add env specs handling 2023-12-13 13:55:10 +00:00
Pierre-Marie de Rodat
f75832df8a langkit.dsl_unparse: minor style tweaks 2023-12-13 13:55:06 +00:00
Pierre-Marie de Rodat
58c90019ed Lkt: use Entity[N] to designate the entity type for the N node type
With the current low-tech approach to typing/validity checking for Lkt,
it is not possible to infer whether N designates a bare node type or an
entity type. Introduce a different syntax for entity types to avoid this
problem.
2023-12-13 13:36:31 +00:00
Pierre-Marie de Rodat
3a3eb9cd2e C/Python/OCaml APIs: merge "entity_repr" and "node_repr"
Public APIs are supposed to expose entities as black boxes: there is no
concept of bare node, there. For this reason, it makes no sense to have
two distinct "repr"/"image" primitives for them. Remove the existing
"entity_repr" primitive and make "node_repr" use the entity info for its
work.

For #639
2022-11-15 12:17:35 +00:00
Pierre-Marie de Rodat
7698a8d111 dsl_unparse: remove spurious line break in grammars
For GitLab issue #612
2022-05-17 11:52:36 +02:00
Pierre-Marie de Rodat
11ab0daea6 dsl_unparse: add an empty line after import statements
This makes the output sources more readable.

For GitLab issue #612
2022-05-17 11:52:36 +02:00
Pierre-Marie de Rodat
0521a6de67 Lkt: make ASTList derive from RootNode
This is necessary in order to let ASTList[T] have the same properties as
any other node.

TN: RA22-015
2021-12-13 16:19:34 +01:00
Romain Beguet
bf9d0ea1b1 UB16-053: Rename val to value in env assoc types.
Since `val` is a keyword in Lkt, dsl_unparse fails on expressions that retrieve this
component from an env_assoc value. In particular, such expressions are now used in
Libadalang as part of the changes made under this TN.
2021-11-23 12:57:35 +01:00
Pierre-Marie de Rodat
96537fe65f dsl_unparse + testsuite: reformat according to the new Lkt coding style
TN: U923-014
2021-10-13 10:29:57 +02:00
Laurent Thévenoux
042d578dd5 U920-002: avoid mismatched type error on root node
As the LexicalEnv.get method always return an array of root nodes
while the root node is defined in user code, we need to turn the Node
and LexicalEnv classes into generic traits and instantiate them using
the actual root node.

To make this works, root node declaration has to be changed from
`class FooNode : Node` to `class FooNode implements Node[FooNode]`,
which required to refactor a bit almost all the lkt tests.
2021-09-27 17:39:36 +02:00
Raphaël AMIARD
3eef9cdc25 RA22-015: make Node a base class rt. a trait 2020-06-30 15:43:53 +02:00
Raphaël AMIARD
119379f643 RA22-015 dsl_unparse: Unparse @with_lexer annotation 2020-06-30 15:43:53 +02:00
Pierre-Marie de Rodat
6600963d0f dsl_unparse: fix handling for abstract properties
TN: RA22-015
2020-06-23 16:19:45 +02:00
Pierre-Marie de Rodat
71f773e0ff Rename SymbolNode to TokenNode
TN: RA22-015
2020-06-17 11:45:07 +02:00