1. Fix negative octals. Currently not handled correctly by `-py3`
(unusual case, but incorrect).
2. Fix arguments of type "octal + something" (e.g. `0640 | 04`).
Currently drops everything after the first octal. Nasty!
3. Fix bool arguments "0 + something" (e.g. `0 | 1`) are always
"False" (unusual case, but incorrect).
4. Remove special handling of "TRUE" and "FALSE" from
`convertValue` since there's no reason these have to match
"true" and "false".
5. Remove the Python 2 vs. Python 3 distinction based on the
`-py3` flag. Now the same python code is produced for default
arguments for Python 2 and Python 3. For this, octal default
arguments, e.g. 0644, are now wrapped as `int('644', 8)`. This
is required, as Python 2 and Python 3 have incompatible syntax
for octal literals.
Fixes#707
This ensures NotImplemented is returned on error so that the Python
interpreter will handle the operators correctly instead of throwing an
exception. NotImplemented was not being returned for non-builtin wrappers
when the operator overload did not have a function overload.
See PEP 207 and https://docs.python.org/3/library/constants.html#NotImplemented
Mentioned in SF patch #303 and SF bug #1208.
The director c++ exceptions are thrown in a helper method instead of in
the director overloaded method. This circumvents compiler warnings about
throwing exceptions when the method has an exception specification or
noexcept. If the exception is thrown, abort will still be called!
In Java, the "director:noexcept" typemap can be used to do something
else. This typemap should be ported to the other languages too.
Prerequisite to address issue #360, feature request of adding extension version.
This change has been taken from Sources/Modules/php.cxx - PHP7 Backend.
With Scilab 6 target specified, identifier names truncation is disabled (no longer necessary)
Signed-off-by: Simon Marchetto <simon.marchetto@scilab-enterprises.com>
Fix Coverity issue reported for wrapper argument checking:
"Null-checking args suggests that it may be null, but it has already
been dereferenced on all paths leading to the check."
So 'args' is null checked, but after dereferencing it with
PyTuple_Check(args).
PROBLEM:
There is a small ommission in parser.y, which will lead
to syntax errors in cases when non-empty throw declaration is
followed by `override`, `final` or both. E.g. in cases like:
void finalOverriden() throw(std::exception) final override;
SOLUTION:
- Add a `THROW LPAREN parms RPAREN virt_specifier_seq` to
exception_specification in Source/CParse/parser.y
- Add several methods in test-suite/cpp11_final_override.i
to verify the fix works.
Previous commit turned on the generation of an extra extend function
wrapper of a member template function when %template was inside a %extend
block instead of calling the real member template - reversed this side
effect.