diff --git a/CHANGES.current b/CHANGES.current index ea728a569..27eb7d1c5 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -7,6 +7,15 @@ the issue number to the end of the URL: https://github.com/swig/swig/issues/ Version 4.0.0 (in progress) =========================== +2019-01-19: vadz + #1272, #1421 When a function's parameter is a keyword, the name of the paramater is + no longer simply changed to argN, where N is the argument number. Instead the + parameter name is changed to the renaming rules for keywords that normally apply to + symbols such as classes/functions etc. Note that unlike other symbol renaming, + parameter renaming does not issue a warning when the parameter is renamed. This + change only affects languages where the parameter names are actually used, for example, + Java function parameter lists in the proxy class or Python documentation comments. + 2019-01-18: wsfulton #1420 Fix gdb debugger functions 'swigprint' and 'locswigprint' from swig.gdb to work with newer versions of gdb-8. Fixes errors when debugging SWIG source with gdb: diff --git a/Examples/test-suite/autodoc.i b/Examples/test-suite/autodoc.i index ec7307a35..76e6cfb24 100644 --- a/Examples/test-suite/autodoc.i +++ b/Examples/test-suite/autodoc.i @@ -149,10 +149,21 @@ bool is_python_builtin() { return false; } #endif %} -// Autodoc Python keywords -%warnfilter(SWIGWARN_PARSE_KEYWORD) process; -%feature(autodoc,0) process; +// Autodoc language keywords +%feature(autodoc,1) process; +%feature(autodoc,1) process2; %feature("compactdefaultargs") process; +%feature("compactdefaultargs") process2; %inline %{ -int process(int from) { return from; } +int process(int from, int in, int var) { return from; } +int process2(int from = 0, int _in = 1, int var = 2) { return from; } +%} + +%feature(autodoc,1) process3; +%feature(autodoc,1) process4; +%feature("kwargs") process3; +%feature("kwargs") process4; +%inline %{ +int process3(int from, int _in, int var) { return from; } +int process4(int from = 0, int _in = 1, int var = 2) { return from; } %} diff --git a/Examples/test-suite/python/autodoc_runme.py b/Examples/test-suite/python/autodoc_runme.py index ab963a748..d643d2247 100644 --- a/Examples/test-suite/python/autodoc_runme.py +++ b/Examples/test-suite/python/autodoc_runme.py @@ -203,4 +203,7 @@ check(inspect.getdoc(TInteger), "Proxy of C++ T< int > class.", "::T< int >") check(inspect.getdoc(TInteger.__init__), "__init__(TInteger self) -> TInteger", None, skip) check(inspect.getdoc(TInteger.inout), "inout(TInteger self, TInteger t) -> TInteger") -check(inspect.getdoc(process), "process(_from) -> int") +check(inspect.getdoc(process), "process(int _from, int _in, int var) -> int") +check(inspect.getdoc(process2), "process2(int _from=0, int _in=1, int var=2) -> int") +check(inspect.getdoc(process3), "process3(int _from, int _in, int var) -> int") +check(inspect.getdoc(process4), "process4(int _from=0, int _in=1, int var=2) -> int")