8308 Commits

Author SHA1 Message Date
Pierre-Marie de Rodat
07218ed24a Merge branch 'mr/pmderodat/24.2' into '24.2'
[24.2] langkit/windows.py: fix Python 3.8 handling

See merge request eng/libadalang/langkit!1100
2024-05-27 09:01:43 +00:00
Pierre-Marie de Rodat
81c164b7dc langkit/windows.py: fix Python 3.8 handling
(cherry picked from commit 2e3cbe526d)
2024-05-27 10:52:02 +02:00
Ghjuvan Lacambre
a754e71010 Merge branch 'backport/eng/libadalang/langkit!998' into '24.2'
OCaml API: add defensive code when reading an exception

See merge request eng/libadalang/langkit!1005
2024-02-09 09:55:47 +00:00
Daniel Mercier
6b91cd7016 OCaml API: add defensive code when reading an exception
We have observed random segfaults when accessing last_exception.information,
which is apparently equal to null (while this is never supposed to happen).
Add defensive code to protect against this case.

Issue: eng/codepeer/infer#220
(cherry picked from commit e192fa0325)
2024-02-08 18:20:04 +01:00
Raphaël Amiard
3443fd4d6d Merge branch '241_fast_forward' into '24.1'
Fast forward 24.1 branch

See merge request eng/libadalang/langkit!979
2023-12-11 15:21:30 +00:00
Pierre-Marie de Rodat
96cf51ff6b C API: add a function to create a bare entity from a node 2023-12-08 11:42:05 +00:00
Pierre-Marie de Rodat
5280e12804 c_api/general: use "foo_node_image" to print nodes
This gives more accurate descriptions than just looking at the kind.
2023-12-08 11:42:05 +00:00
Pierre-Marie de Rodat
b5d6f4af31 c_api/general: minor reformattings 2023-12-08 11:42:05 +00:00
Pierre-Marie de Rodat
084c81194e Python bindings: make the version number PEP 440-compliant 2023-12-08 11:42:05 +00:00
Pierre-Marie de Rodat
8d9afae741 C API: make opaque pointers incompatible
In the generated C header, replace:

    typedef void *X;

declarations ("opaque pointers") with:

    typedef struct X__struct *X;

So that implicit conversions between them (generally a mistake) are
rejected. Also fix the issues in the rewriting API that can be found
thihs way.
2023-12-08 11:42:05 +00:00
Pierre-Marie de Rodat
cf5ad3d9fe C API: export symbols for the rewriting API
Include the $.Rewriting_Impl unit to the "library interface" in the
generated project file, as that unit contains the definitions for
rewriting API C symbols. The rewriting C API testcase worked so far
because it links its test program to the generated *static* library.
2023-12-08 11:42:05 +00:00
Romain Beguet
776a9b4452 Improve explanations of exceptions during evaluation of partial solution. 2023-12-08 11:42:05 +00:00
Pierre-Marie de Rodat
bd1ca9d3a8 Bind the rewriting API to C 2023-12-08 11:42:05 +00:00
Pierre-Marie de Rodat
dc2951a8a9 C API: define the default grammar rule as a macro
Defining it as a "const" declaration in a header file is incorrect, as
it defines a symbol: two compilation units that include the header file
will then trigger link error due to conflicting symbol definitions.

Define it as a macro instead to avoid this kind of issue. No new
dedicated testcase for this as the next commit reworks C test helpers to
have multiple compilation units (several "*.c" sources in test
projects).
2023-12-08 11:42:05 +00:00
Pierre-Marie de Rodat
e4a177bef3 testsuite/c_support: avoid static functions
Putting the implementation of helper functions in headers (static
functions) yields inconvenient warnings about unused functions. Put
implementations in regular functions in "*.c" files instead.
2023-12-08 11:42:05 +00:00
Pierre-Marie de Rodat
449d98a9a2 lexer_example: set "var" as alphanumerical
This is necessary so that unparsing inserts a space between "var" and
"foo" in "var foo". That problem was undetected so far in our only
rewriting API test because all variable declaration nodes were rewritten
from sources (they were not synthetized), so formatting (which includes
that space) was preserved.
2023-12-08 11:42:05 +00:00
Pierre-Marie de Rodat
6a9122a2e5 pkg_rewriting_impl_spec_ada.mako: minor comment fix 2023-12-08 11:42:05 +00:00
Pierre-Marie de Rodat
038d519fa0 $.Rewriting_Impl: minor reformattings 2023-12-08 11:42:05 +00:00
Pierre-Marie de Rodat
46b5a6f9ea $.Implementation.C: remove the "private" package qualifier
The $.Implementation package is already private: there is no need to
make its descendants private too in order to make them unreachable from
the users of generated libraries. On the contrary, we want
$.Implementation.C to be reachable from $.Rewriting_Implementation,
which will be necessary for the upcoming work to create C bindings for
the rewriting API.
2023-12-08 11:42:05 +00:00
Pierre-Marie de Rodat
3f581b47a3 misc/rewriting: move to ada_api/
Upcoming work will bind the rewriting API to C and thus add a
corresponding test in c_api/, so it makes more sense to have the Ada API
test in ada_api/.
2023-12-08 11:42:05 +00:00
Boris Yakobowski
b9b493d74c Simulate token removal
This will allow packages to be uploaded using a short-lifetime token.
2023-12-08 11:42:05 +00:00
Boris Yakobowski
df71596c24 Fix multiples 'rules' section
I suspect only the second one was taken into account. This was
visible as a langkit_test was executed after a push _before_
langkit was rebuilt.
2023-12-08 11:42:05 +00:00
Boris Yakobowski
e78f624bef Do not run tests if build has failed 2023-12-08 11:42:05 +00:00
Boris Yakobowski
c851c5a230 Upgrade CI script to remove the need for a PAT 2023-12-08 11:42:05 +00:00
Pierre-Marie de Rodat
918858c3ab Langkit_Support.Generic_API.Introspection: add Eval_Syntax_Field
Generic API users that need to browse parsing trees (i.e. handling
`Lk_Node` values) need a convenient way to get syntax fields:
`Eval_Member` and `Eval_Node_Member` both require various amounts of
conversions from/to `Value_Ref`. Introduce `Eval_Syntax_Field` to make
this process more convenient.
2023-12-08 11:42:05 +00:00