From fc2f54c647eca1df2b9efa68953c70ea3a182d1f Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Thu, 28 Oct 2004 19:31:33 +0000 Subject: [PATCH] better option name templatereduce git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6542 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Examples/test-suite/template_typedef.i | 2 +- Examples/test-suite/template_typedef_ptr.i | 11 ++++++----- Source/CParse/parser.y | 8 ++++---- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Examples/test-suite/template_typedef.i b/Examples/test-suite/template_typedef.i index a16b67462..8ad5de209 100644 --- a/Examples/test-suite/template_typedef.i +++ b/Examples/test-suite/template_typedef.i @@ -1,5 +1,5 @@ #ifdef SWIGPYTHON -%module("tpltreduc") template_typedef +%module("templatereduce") template_typedef #else %module template_typedef #endif diff --git a/Examples/test-suite/template_typedef_ptr.i b/Examples/test-suite/template_typedef_ptr.i index 358c03e37..a528c7b28 100644 --- a/Examples/test-suite/template_typedef_ptr.i +++ b/Examples/test-suite/template_typedef_ptr.i @@ -1,11 +1,12 @@ -%module("tpltreduc") template_typedef_ptr +%module("templatereduce") template_typedef_ptr +%module("templatereduce") template_typedef_ptr /* - Use the "tpltreduc" to force swig to reduce the temaplate - typedef as much as possible. + Use the "templatereduce" option to force swig to reduce the + temaplate typedef as much as possible. - This fix cases like this one, but it can prevent some - typemaps for working. + This fix cases like the one in this file, but it can prevent some + typemaps for working as expected. */ diff --git a/Source/CParse/parser.y b/Source/CParse/parser.y index ca65cba3d..383257918 100644 --- a/Source/CParse/parser.y +++ b/Source/CParse/parser.y @@ -53,7 +53,7 @@ static Parm *template_parameters = 0; static int extendmode = 0; static int dirprot_mode = 0; static int compact_default_args = 0; -static int template_typedef_reduction = 0; +static int template_reduce = 0; /* ----------------------------------------------------------------------------- * Assist Functions @@ -1625,8 +1625,8 @@ module_directive: MODULE options idstring { */ dirprot_mode = 1; } - if (Getattr($2,"tpltreduc")) { - template_typedef_reduction = 1; + if (Getattr($2,"templatereduce")) { + template_reduce = 1; } } if (!ModuleName) ModuleName = NewString($3); @@ -2134,7 +2134,7 @@ template_directive: SWIGTEMPLATE LPAREN idstringopt RPAREN idcolonnt LESSTHAN va if (!value) { SwigType *ty = Getattr(p,"type"); if (ty) { - if (template_typedef_reduction) { + if (template_reduce) { SwigType *rty = Swig_symbol_typedef_reduce(ty,0); ty = Swig_symbol_type_qualify(rty,0); Setattr(p,"type",ty);