7878 Commits

Author SHA1 Message Date
Pierre-Marie de Rodat
a3eaa75a57 Merge branch 'pmderodat/23.2' into '23.2'
Update flake8 version

See merge request eng/libadalang/langkit!824
2023-03-29 08:27:01 +00:00
Pierre-Marie de Rodat
4f20c160d3 Update flake8 version
... to reflect the version currently used at AdaCore. It seems that
newer versions of flake8 reject missing spaces after the "not" keyword.
Fix occurences in the codebase.

TN: W310-006
(cherry picked from commit 4250bdca54)
2023-03-29 10:14:40 +02:00
Pierre-Marie de Rodat
0e4e1f7226 python_api/app: fix propagation of path_wrapper to subprocesses
TN: VA12-016
(cherry picked from commit b298a62b39)
2022-12-12 13:03:29 +00:00
Pierre-Marie de Rodat
8cfeaae439 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
(cherry picked from commit 0b029ac1b0)
2022-12-12 12:45:57 +00:00
Pierre-Marie de Rodat
971b1f059c Python API: allow App subclasses to associate event handlers to contexts
TN: VA12-016
(cherry picked from commit 52297d3c8c)
2022-12-12 12:45:57 +00:00
Pierre-Marie de Rodat
1ee873e139 python_api/app: refactor testcase
TN: VA12-016
(cherry picked from commit dc16344d15)
2022-12-12 12:45:57 +00:00
Pierre-Marie de Rodat
48bd6005f0 python_support/path_wrapper.py: fix sys.argv for the script to run
Upcoming work will start to use command line arguments in a "main.py"
test script. Fix "path_wrapper.py" so that command line arguments are
correctly passed to "main.py".

TN: VA12-016
(cherry picked from commit 869141de11)
2022-12-12 12:45:57 +00:00
Pierre-Marie de Rodat
b53ffbedf6 python_api/python_app: rename to python_api/app
TN: VA12-016
(cherry picked from commit 5c9eea0853)
2022-12-12 12:45:57 +00:00
Pierre-Marie de Rodat
a8dd47515c Python API: bind the event handler API
TN: VA12-016
(cherry picked from commit c6adec40a2)
2022-12-12 12:45:57 +00:00
Pierre-Marie de Rodat
0fce4b5109 c_api/event_handler: new testcase
TN: VA12-016
(cherry picked from commit 83c26aa941)
2022-12-12 12:45:57 +00:00
Pierre-Marie de Rodat
418d9856eb Unit_Requested_Callback: ensure Reparse=False for first parsing
Even though Get_From_Buffer forces the parsing of the requested unit,
the Unit_Requested_Callback event must pass False to its Reparse
argument when that forced parsing happens for the analysis unit creation
(first parsing).

TN: VA12-016
(cherry picked from commit 641d49088e)
2022-12-12 12:45:57 +00:00
Pierre-Marie de Rodat
e0a7268316 ada_api/event_handler: tidy up and enhance
Extend this testcase so that it checks more callback arguments.

TN: VA12-016
(cherry picked from commit 62c62524d9)
2022-12-12 12:45:56 +00:00
Pierre-Marie de Rodat
490a33de9f misc/event_handler: move testcase to ada_api/
Upcoming work for this ticket will bind the event_handler API to C and
Python. Make it clear that this testcase checks the Ada API, since we
will create new tests specifically for C and Python.

TN: VA12-016
(cherry picked from commit c1b581cf3c)
2022-12-12 12:45:56 +00:00
Pierre-Marie de Rodat
590306d8bf langkit.documentation: add missing doc for create_context/event_handler
TN: VA12-016
(cherry picked from commit 5215112003)
2022-12-12 12:45:56 +00:00
Raphaël AMIARD
2f9dfa7256 Add App.default_get_files mechanism to Python API
This will allow Libadalang to use GPR's API to get source files.

Needed for libadalang#938

(cherry picked from commit a4c7be1865)
2022-12-12 12:45:56 +00:00
Pierre-Marie de Rodat
16b721b462 misc/c_exc_name: new testcase
The previous commit for this ticket was supposed to add this test (pilot
error).

TN: VA14-036
(cherry picked from commit f6b3f58b1c)
2022-12-12 10:45:30 +00:00
Pierre-Marie de Rodat
221cb48ab6 Testsuite: include C in test projects only optionally
In order to avoid GPR warnings ("no C sources for this project") for all
projects that contain only Ada sources, make the C language optional in
generated project files.

TN: VA14-036
(cherry picked from commit 558f53748f)
2022-12-12 10:45:30 +00:00
Pierre-Marie de Rodat
860ad92f09 C API: add a getter for exception names, for testing purposes
Printing the int value for the exception IDs makes test outputs
unstable, as IDs can change when new exceptions are added. Add an
exception name getter to restore stable output.

TN: VA14-036
(cherry picked from commit 3a838da876)
2022-12-12 10:45:30 +00:00
Raphaël AMIARD
173055263e U607-013: Add Node.Equals function
For use with containers instantiations.
2022-11-30 14:36:34 +01:00
Raphaël AMIARD
3dd61e854d V825-017: Use proper MD comparison in the Langkit_Support generic API 2022-11-25 15:53:58 +01:00
Raphaël AMIARD
81673581ee V825-017: Enhance equality & hash for env metadata
So that users can choose which fields are relevant for computing
properties about the node's identity.
2022-11-25 15:53:48 +01:00
Daniel Mercier
02d7a2cd83 Bind file readers in OCaml bindings
TN: TC21-009
2022-11-07 17:58:23 +01:00
Daniel Mercier
931fb69083 Add generic language specific extensions for OCaml bindings
TN: TC21-009
2022-11-07 17:58:09 +01:00
Pierre-Marie de Rodat
71a540b027 c_api/header_c.mako: new general purpose extension point at the end
TN: VA12-019
(cherry picked from commit 96523888db)
2022-11-07 10:45:44 +00:00
Romain Beguet
a638facb03 V622-017: Fix env grouping with non-default metadata.
The routine for grouping lexical envs would previously always flatten grouped
envs. However, this process would discard the `default_md` field of the nested
grouped envs.
The implementation now decides to flatten grouped envs only if the resulting
env behavior is the same.
v23.0.0
2022-09-01 12:45:19 +02:00