131 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
0844481e22 Generic API: add accessors for type/member documentation 2026-01-05 10:34:07 +00:00
Pierre-Marie de Rodat
35c8546082 Add missing comparison operators for token references 2026-01-05 10:29:08 +00:00
Pierre-Marie de Rodat
84f0666890 Rework how token equivalence works
For tokens matched by literals only (like keywords), only compare the
kind. For `@symbol` tokens (generally matched by patterns), also compare
the symbol. For all the other tokens, keep comparing the actual token
text.
2025-07-03 12:49:02 +00:00
Pierre-Marie de Rodat
e116416bde ada_api/generic_api: update test baseline 2025-04-16 07:37:06 +00:00
Pierre-Marie de Rodat
37791c250d Generic API: add converters for concrete node types 2025-04-16 06:14:15 +00:00
Pierre-Marie de Rodat
cfd545d2fa Generic API: add the Is_Error_Node type reference primitive 2025-04-16 06:14:00 +00:00
Pierre-Marie de Rodat
259a1317dc CompiledType.dsl_name: switch to Lkt notations
Also rename `dsl_*` properties, attributes, arguments, ... to `lkt_*`
for consistency.
2025-04-04 09:55:05 +00:00
Pierre-Marie de Rodat
c5a89de2bd Remove processings of enum types from CompiledTypeRepo
Note that this fixes the sorting of enum types by name. It used to be
done only during the `CompileTypeRepo -> CompileCtx` transition, and tha
transition used to happen before all enum types were known.
2025-03-24 15:39:29 +00:00
Remi Segard
aba052abcc Add generic interfaces types for the language server 2025-02-06 17:39:03 +01: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
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
2cba8e5a39 Generic API: add a Compare primitive for Lk_Node 2024-10-09 09:19:34 +00:00
Pierre-Marie de Rodat
1af5dcd970 Generic API: add a Children_And_Trivia primitive for Lk_Node 2024-10-09 09:19:34 +00:00
Pierre-Marie de Rodat
c66e97c5c9 Generic API: add a Print debug primitive for Lk_Unit 2024-10-09 09:19:34 +00:00
Pierre-Marie de Rodat
2d8a68daed Generic API: add a Lookup_Token primitive for Lk_Unit 2024-10-09 09:19:34 +00:00
Pierre-Marie de Rodat
caf24efa4b Generic API: add a Charset primitive for Lk_Unit 2024-10-09 09:19:34 +00:00
Pierre-Marie de Rodat
721788f56b Generic API: protect Previous_Sibling against invalid input values 2024-10-09 09:19:34 +00:00
Pierre-Marie de Rodat
c6eb573084 Generic API: bind the analysis unit reparsing primitives 2024-10-09 09:19:34 +00:00
Pierre-Marie de Rodat
e832112f97 Generic_API: add a Has_With_Trivia primitive for Lk_Context 2024-10-09 09:19:34 +00:00
Pierre-Marie de Rodat
8eb2de3f8b Generic_API: add a Is_Synthetic primitive for Type_Ref 2024-10-09 09:19:34 +00:00
Pierre-Marie de Rodat
2078fe6baf Generic API: add a Language primitive for Struct_Member_Ref 2024-10-09 09:19:34 +00:00
Pierre-Marie de Rodat
4f87b82186 Generic API: add Eval_(Node_)Member overloads for managed exceptions
The purpose of these overloads is to catch managed exceptions (that
properties may raise) but not the other ones (that may indicate
Langkit/user program bugs).
2024-09-04 15:06:02 +00:00
Pierre-Marie de Rodat
a27fa929c9 Generic API: add the List_Element_Type introspection accessor
This accessor will be useful for upcoming unparsing API work, to look
for the properties that belong to a list type's children.
2024-09-04 15:06:02 +00:00