Commit Graph

30 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
ca0f8eb315 Transition Libpythonlang to Lkt/lkm
Also stop building it in `manage.py`` (it is no longer needed for common
Langkit operations). Rename and repurpose `contrib/python_grammar` to
generate+build Libpythonlang, in an attempt to ensure it does not bit
rot.
2025-02-06 09:31:49 +00:00
Pierre-Marie de Rodat
3fbb1c38b7 langkit.config: rename "lkt" to "lkt_spec" 2025-01-09 19:59:12 +00:00
Pierre-Marie de Rodat
f9465ae01f langkit.libmanage: initialize verbosity in __init__ rather than setattr
Minor refactoring: pass the right verbosity level to CompileCtx.__init__
constructor instead of patching it after the instance has been created
(cleaner).
2025-01-07 15:09:51 +00:00
Pierre-Marie de Rodat
109fd493c7 Introduce separate data structure to hold the language spec config
Replace the messy collection of arguments for CompileCtx.__init__ and
CompileCtx.create_all_passes with better organized dataclasses in the
new langkit.config module. Update the codebase to use these data
structures.
2025-01-07 09:54:56 +00:00
Pierre-Marie de Rodat
f233d6482c dsl_unparse: fix handling of backslashes in patterns
Unparsing patterns must escape backslashes themselves ('\\' to encode
'\').
2024-03-21 09:25:36 +00:00
Pierre-Marie de Rodat
736b3ee3a6 Make libpythonlang and liblktlang standalone
Since nowadays Langkit itself depends on both libraries to do its work
and since both libraries use `Langkit_Support`, the standalone mode is
necessary to allow Langkit developpers to use Langkit testcases to check
and debug (potentially very buggy) patches on `Langkit_Support`.
2023-06-23 13:02:58 +00: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
ed8a12c302 Fix language name casings in manage.py scripts
... and do the necessary adjustments in the rest of the codebase.
2021-09-24 12:07:42 +02:00
Pierre-Marie de Rodat
45445a1544 Enable warnings by default in Libpythonlang and Liblktlang
TN: TC14-031
2020-12-15 14:28:46 +01:00
Raphaël AMIARD
e21ff492fa T511-017: make stylechecks work with pycodestyle 2020-06-02 13:22:02 +02:00
Pierre-Marie de Rodat
2b9b33d6a0 Remove __future__ imports and adjust stylechecks
TN: T511-017
2020-05-26 12:33:48 +02:00
Pierre-Marie de Rodat
0e2868fd02 dsl_unparse: stop relying on the string_escape encoding
That encoding is no longer available in Python3, so roll our own
temporary implementation (before we can get rid of dsl_unparse). Also
remove useless backslashes in the Python grammar.

TN: T511-017
2020-05-26 12:33:48 +02:00
Pierre-Marie de Rodat
8817669523 Revert "contrib/python: do not use Ignore in the lexer"
This reverts commit 8d8137610a.

This change had unintended consequences: the indentation tracking
machinery interacts interfers with the trivia production for
whitespaces, breaking Python code parsing. Revert for now, until we have
a plan to more forward. This change was mostly cosmetic anyway (no real
need to preserve whitespaces for the Python parser).

TN: T107-050
2020-01-08 11:58:04 +01:00
Pierre-Marie de Rodat
8d8137610a contrib/python: do not use Ignore in the lexer
TN: T107-050
2020-01-07 17:52:01 +01:00
Pierre-Marie de Rodat
3dd788055d Sort imported entitities in all Python scripts
TN: S425-011
2019-04-25 14:39:56 +02:00
Romain Beguet
0dd1f1bbd6 S418-018: Refactor add_to_env.
- "env_assoc"s now take themselves the dest_env and the metadata info.
- Add add_to_env_kv and new_env_assoc to simplify common usage.
2019-04-25 11:51:59 +02:00
Pierre-Marie de Rodat
5ac1a19c20 contrib/python: do not use the Eof lexer matcher
TN: R913-030
2019-02-08 17:54:23 +01:00
Pierre-Marie de Rodat
1b48a52d2d Replace Quex with our own lexer generator
TN: R913-030
2019-02-07 17:44:36 +01:00
Romain Beguet
42a7dacb91 S121-011: Revise enum node definition mechanism.
Instead of using Python's inheritance mechanism to define enum nodes,
the new mechanism requires adding enum_node = True to the class' body.
Inheritance can now be used to make the enum node derive from any
subclass of ASTNode instead ASTNode itself.
2019-02-07 12:54:10 +01:00
Pierre-Marie de Rodat
cc63ebf2c0 contrib/python: make BinOp abstract instead of synthetic
TN: S121-029
2019-01-25 17:48:42 +01:00
Pierre-Marie de Rodat
a50ba54b6d contrib/python: fix a compilation warning
TN: R807-033
2018-08-16 12:16:02 +02:00
Pierre-Marie de Rodat
86c9702c5b contrib/python: remove obsolete List() keyword argument
TN: R807-033
2018-08-16 12:16:02 +02:00
Raphael Amiard
d70b094f44 Simplify python tree #11 no-tn-check
Change-Id: I8ad7b67d65a71fdf0348e29746dbf05a11c7b62e
2018-02-06 17:04:53 +01:00
Raphael Amiard
eff6f179c2 Update python engine #11 no-tn-check
Change-Id: I0789d223ad0439ffbcd0425a68c11115d8fecbc2
2018-02-06 17:04:53 +01:00