5 Commits

Author SHA1 Message Date
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
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
157d06edef python_api/event_handler: fix stdout/stderr sync issues
Add flushing close to places that deal with exceptions so that the order
of lines in the output reflect the order of execution for the
corresponding print statements.

The actual buffering behavior differs depending on the Python
interpreter version used, which led to spurious diffs with older
versions.

TN: W306-034
2023-03-14 10:48:38 +00:00
Pierre-Marie de Rodat
0b029ac1b0 C API: split analysis context allocation/initialization
Since the analysis context initialization may trigger events (e.g.
"prelude file parsed"), language bindings (in particular Python) may
need to create/register their wrapper around the context that is just
created so that they can use that wrapper when invoking the callback.

Having allocation and initialization as a single atomic step makes this
impossible: this change splits them in the C API and update the
Python/OCaml bindings to allow this.

TN: VA12-016
2022-11-23 12:37:21 +00:00
Pierre-Marie de Rodat
c6adec40a2 Python API: bind the event handler API
TN: VA12-016
2022-11-23 12:37:21 +00:00