Commit Graph

8 Commits

Author SHA1 Message Date
William S Fulton 26b0911a74 Add support for $n special variable expansion in the names of typemap local variables
For example:

  %typemap(in) int MYINT (int $1_temp) { ... }

$1_temp is typically expanded to arg1_temp, arg2_temp etc depending on
which argument the typemap is applied to.
2025-02-19 20:44:40 +00:00
William S Fulton e8d3c74590 Improvements to $typemap() special variable replacement overrides
In $typemap(), the $n special variables are replaced by the appropriate
value for the type associated with the typemap calling $typemap().
The (undocumented) special variable overrides now also support
controlling what the $n special variables are replaced with from the
calling typemap, for example:

  %typemap(in) std::pair<std::string, int> {
    int& input_value_second = $1.second;
    $typemap(in, int, 1=input_value_second);
    ...
  }

replaces $1 in the int typemap with input_value_second instead of
whatever is the default for the target language (a variable that holds
the int value after marshalling from the target language).

This additional functionality might make it possible to replace the C++
templates used in the UTL with a much simpler system of typemaps utilising
$typemap(). See follow on commit to typemaps.c.
2023-11-03 09:07:51 +00:00
Seth R Johnson 1329670640 Allow referencing of typemap keywords inside of "$typemap(" 2022-02-25 10:52:33 -05:00
Jon Schlueter b77f3afafb autopep8 cleanup of Examples/test-suite/python
automated cleanup of python pep8 whitespace compliance
2015-05-08 21:35:52 -04:00
Jesus Lopez 9be3235988 Support $descriptor() macro in fragments
Closes #36
2013-04-18 23:04:07 +01:00
William S Fulton 41d3c98993 fix $typemap() when the type contains template parameters
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11506 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-05 21:40:49 +00:00
William S Fulton bbcfa0b089 () for multi-argument typemaps
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11481 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-07-30 17:42:18 +00:00
William S Fulton 75aa67b99c rename special_variable_functions testcase to special_variable_macros
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11475 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-07-30 06:15:50 +00:00