fixed NIL pointer problem for 'generaterename', nameToModula3 creates capitals after digits
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5844 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
906c610708
commit
c146a39d2e
1 changed files with 16 additions and 6 deletions
|
|
@ -127,6 +127,7 @@ char cvsroot_modula3_cxx[] =
|
||||||
#ifndef MACSWIG
|
#ifndef MACSWIG
|
||||||
#include "swigconfig.h"
|
#include "swigconfig.h"
|
||||||
#endif
|
#endif
|
||||||
|
// toupper, tolower, isalpha
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
const char usageArgDir[] =
|
const char usageArgDir[] =
|
||||||
|
|
@ -488,13 +489,18 @@ MODULA3 ():
|
||||||
if ((c == '_') || (c == ':')) {
|
if ((c == '_') || (c == ':')) {
|
||||||
cap = true;
|
cap = true;
|
||||||
} else {
|
} else {
|
||||||
if (cap) {
|
if (isdigit(c)) {
|
||||||
m3sym[i] = toupper (c);
|
m3sym[i] = c;
|
||||||
|
cap = true;
|
||||||
} else {
|
} else {
|
||||||
m3sym[i] = tolower (c);
|
if (cap) {
|
||||||
|
m3sym[i] = toupper (c);
|
||||||
|
} else {
|
||||||
|
m3sym[i] = tolower (c);
|
||||||
|
}
|
||||||
|
cap = false;
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
cap = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m3sym[i] = 0;
|
m3sym[i] = 0;
|
||||||
|
|
@ -886,13 +892,13 @@ MODULA3 ():
|
||||||
String *name = getQualifiedName (child);
|
String *name = getQualifiedName (child);
|
||||||
String *m3name = nameToModula3 (name, true);
|
String *m3name = nameToModula3 (name, true);
|
||||||
/*don't know how to get the original C type identifiers */
|
/*don't know how to get the original C type identifiers */
|
||||||
String *arguments = createCSignature (child);
|
//String *arguments = createCSignature (child);
|
||||||
Printf (file, "%%rename(\"%s\") %s;\n", m3name, name);
|
Printf (file, "%%rename(\"%s\") %s;\n", m3name, name);
|
||||||
/*Printf(file, "%%rename(\"%s\") %s %s(%s);\n",
|
/*Printf(file, "%%rename(\"%s\") %s %s(%s);\n",
|
||||||
m3name, Getattr(n,"type"), name, arguments); */
|
m3name, Getattr(n,"type"), name, arguments); */
|
||||||
Delete (name);
|
Delete (name);
|
||||||
Delete (m3name);
|
Delete (m3name);
|
||||||
Delete (arguments);
|
//Delete (arguments);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
scanRename (file, child);
|
scanRename (file, child);
|
||||||
|
|
@ -3942,6 +3948,9 @@ MODULA3 ():
|
||||||
return (arguments);
|
return (arguments);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* not used any longer
|
||||||
|
- try SwigType_str if required again */
|
||||||
|
#if 0
|
||||||
/* -----------------------------------------------------------------------------
|
/* -----------------------------------------------------------------------------
|
||||||
* createCSignature()
|
* createCSignature()
|
||||||
*
|
*
|
||||||
|
|
@ -3964,6 +3973,7 @@ MODULA3 ():
|
||||||
}
|
}
|
||||||
return arguments;
|
return arguments;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* -----------------------------------------------------------------------------
|
/* -----------------------------------------------------------------------------
|
||||||
* emitTypeWrapperClass()
|
* emitTypeWrapperClass()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue