6310 Commits

Author SHA1 Message Date
Pierre-Marie de Rodat
d92444bda3 $.Analysis: enhance the formatting of generated property declarations
TN: SC10-032
2019-12-19 15:42:42 +01:00
Pierre-Marie de Rodat
19e1f60836 Use language-specific namings when referring to node in doc strings
TN: SC13-015
2019-12-19 11:46:47 +01:00
Pierre-Marie de Rodat
6acd74388b Interpret entity docs as Mako templates
This will allow us to have different doc renderings depending on the
context. For instance, having different casings depending on the
generated API.

TN: SC13-015
2019-12-19 11:46:47 +01:00
Pierre-Marie de Rodat
342118a417 properties/memoized_unit_loading: flush to avoid output sync issues
TN: S917-027
2019-12-19 11:36:47 +01:00
Pierre-Marie de Rodat
d69d8cb6f8 $.Iterators: add a Kind_In node predicate
TN: SC19-006
2019-12-19 11:31:08 +01:00
Pierre-Marie de Rodat
850f0e92f4 Fix coding style issues in testcases
TN: SC05-019
2019-12-18 17:11:51 +01:00
Pierre-Marie de Rodat
82d9e7c58f misc/c_text_to_locale_string: import testcase from Libadalang
TN: SC05-019
2019-12-18 15:28:19 +01:00
Pierre-Marie de Rodat
6119d49b15 Python API: accept unicode source buffers in get_from_buffer/reparse
TN: SC05-019
2019-12-18 15:28:19 +01:00
Pierre-Marie de Rodat
396ee10dc0 C API: fix handling of empty buffers
A test exercizing this case comes in the next commit.

TN: SC05-019
2019-12-18 15:28:19 +01:00
Pierre-Marie de Rodat
d93770c583 Analysis unit parsing: always fallback to context-wide charset
This commit removes the "sticky" behavior of the Charset argument in
analysis unit constructors: either users pass a charset to
get_from_buffer/file/reparse, either they don't and the charset used is
the context-wide default charset.

TN: SC05-019
2019-12-18 15:28:19 +01:00
Pierre-Marie de Rodat
0a0d2f8c32 Do not memoize prop. if mmz. table reset happened during its execution
If memoization table reset happens in the middle of the execution of a
property, then computings that happened before that reset could change
in later calls, so it is not sound to keep the result of that property
execution.

TN: S917-027
2019-12-18 15:06:54 +01:00
Romain Beguet
7eef7123f0 properties/invalidation_during_mmz: new testcase
TN: SC09-060
2019-12-13 18:28:04 +01:00
Pierre-Marie de Rodat
e2140bd3cb Recompute memoization key on memoization table reset
Memoization table invalidation can happen in the middle of the execution
of a memoized property, for instance when an external property loads a
new analysis unit.

Because of this, memoized properties must check cache version when
re-using memoization keys and cursors: on cache version bump,
memoization keys and cursors must be recomputed.

TN: SC09-060
2019-12-13 18:28:04 +01:00
Pierre-Marie de Rodat
89152410d9 Libmanage: make the install command copy all Python modules
Doing so is necesarry now that we have a "_py2to3.py" module in addition
to the "__init__.py". Using a glob pattern to select all modules will
avoid such a breakage in the future.

TN: SB13-026
2019-12-09 10:04:23 +01:00
Pierre-Marie de Rodat
3260fb63e1 Add Python3 compatibility for the Python bindings to generated libraries
TN: SB13-026
2019-12-05 14:47:36 +01:00
Pierre-Marie de Rodat
95b0118b2e C API: fix handling of empty buffers in unit_reparse_from_buffer
A pasto in the commit that introduced this testcase passed a filename to
as reparse's buffer argument, hiding this bug.

TN: SB13-026
2019-12-05 14:47:36 +01:00
Pierre-Marie de Rodat
ae5f15bd86 C API: add missing exception propagation to context decref/incref funcs
Even though these functions are not supposed to raise errors, the fact
that they don't clear the exception info global variable makes the
previous exception propagated 'leak' to the Python binding layer.

For some reason, this is visible only when using Python3.

TN: SB13-026
2019-12-05 14:47:36 +01:00
Pierre-Marie de Rodat
d0bfb10cda Python API: remove the 'u' prefix from Token.__repr__'s result
This is not only more user friendly, but also removes a discrepancy
between Python2 and Python3.

TN: SB13-026
2019-12-05 14:47:36 +01:00
Pierre-Marie de Rodat
204d729633 Python API: wrap enums as simple strings
Enums are always pure ASCII, so using Unicode is not necessary. This
will help avoiding a Python2/Python3 discrepancy.

TN: SB13-026
2019-12-05 14:47:36 +01:00
Pierre-Marie de Rodat
e93bf2dc03 Python API: add a helper package for Python2/3 compatibility
TN: SB13-026
2019-12-05 14:47:36 +01:00
Pierre-Marie de Rodat
e3ad650821 Python API: use type full name in error message
This makes error messages that are propagated to users in case of type
mismatch clearer.

This change was originally motivated by the discrepancy between Python2
and Python3:

    # Python2
    >>> int
    <type 'int'>

    # Python3
    >>> int
    <class 'int'>

Using the type full name avoids relying on a particular representation
for the types.

TN: SB13-026
2019-12-05 14:47:36 +01:00
Pierre-Marie de Rodat
8f071f623e Remove an obsolete and unused Mako template
TN: SB13-026
2019-12-05 14:47:36 +01:00
Pierre-Marie de Rodat
7b0ca1944f Enhance error messages for As_* node conversion functions
TN: SB28-011
2019-11-28 17:47:38 +01:00
Pierre-Marie de Rodat
627358f134 $.Analysis: document the .As_* node conversion functions
TN: SB28-011
2019-11-28 17:47:38 +01:00
Pierre-Marie de Rodat
1281697f1f ManageScript.do_generate: do not set the build mode if already set
Even though do_generate must define a dummy build mode when run
standalone, it should not set it when it is already defined, for
instance when called from do_make. This used to trigger debug builds
through the "make" subcommand in even when --build-mode=prod was passed.

TN: SA30-026
2019-11-19 15:06:00 +01:00