fix incomplete module name replacement when using the -module flag #1282637
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7428 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
2557f80bba
commit
1c6a2a2cfb
1 changed files with 15 additions and 3 deletions
|
|
@ -166,6 +166,11 @@ static String *class_rename = 0;
|
||||||
#define CPLUS_PRIVATE 2
|
#define CPLUS_PRIVATE 2
|
||||||
#define CPLUS_PROTECTED 3
|
#define CPLUS_PROTECTED 3
|
||||||
|
|
||||||
|
/* include types */
|
||||||
|
static int include_type = 0;
|
||||||
|
#define INCLUDE_MODE 1
|
||||||
|
#define IMPORT_MODE 2
|
||||||
|
|
||||||
void SWIG_typemap_lang(const char *tm_lang) {
|
void SWIG_typemap_lang(const char *tm_lang) {
|
||||||
typemap_lang = Swig_copy_string(tm_lang);
|
typemap_lang = Swig_copy_string(tm_lang);
|
||||||
}
|
}
|
||||||
|
|
@ -1766,8 +1771,8 @@ include_directive: includetype options string LBRACKET {
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
includetype : INCLUDE { $$.type = (char *) "include"; }
|
includetype : INCLUDE { $$.type = (char *) "include"; include_type = INCLUDE_MODE;}
|
||||||
| IMPORT { $$.type = (char *) "import"; }
|
| IMPORT { $$.type = (char *) "import"; include_type = IMPORT_MODE;}
|
||||||
;
|
;
|
||||||
|
|
||||||
/* ------------------------------------------------------------
|
/* ------------------------------------------------------------
|
||||||
|
|
@ -1872,7 +1877,14 @@ module_directive: MODULE options idstring {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!ModuleName) ModuleName = NewString($3);
|
if (!ModuleName) ModuleName = NewString($3);
|
||||||
Setattr($$,"name",ModuleName);
|
if (include_type == INCLUDE_MODE) {
|
||||||
|
/* first module included, we apply global
|
||||||
|
ModuleName, which can be modify by -module */
|
||||||
|
Setattr($$,"name",Copy(ModuleName));
|
||||||
|
} else {
|
||||||
|
/* import mode, we just pass the idstring */
|
||||||
|
Setattr($$,"name",$3);
|
||||||
|
}
|
||||||
if (!module_node) module_node = $$;
|
if (!module_node) module_node = $$;
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue