made enum block_type a protected member of class MODULA3, hope that VC++ 6 is satisfied with that

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5818 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Henning Thielemann 2004-04-01 15:49:16 +00:00
commit 92dbf178bc

View file

@ -16,7 +16,6 @@ char cvsroot_modula3_cxx[] =
indent -sob -br -ce -nut -npsl indent -sob -br -ce -nut -npsl
*/ */
/* /*
Report: Report:
- It's not a good concept to use member variables or global variables - It's not a good concept to use member variables or global variables
@ -135,15 +134,18 @@ const char usageArgDir[] =
class MODULA3:public Language class MODULA3:public Language
{ {
protected:
enum block_type enum block_type
{ no_block, constant, variable, type, revelation }; { no_block, constant, variable, type, revelation };
private:
struct M3File struct M3File
{ {
String *f; String *f;
Hash *import; Hash *import;
block_type bt; block_type bt;
/* VC++ 6 doesn't allow the access to 'no_block'
if it is a private member of MODULA3 class */
M3File ():f (NewString ("")), import (NewHash ()), bt (no_block) M3File ():f (NewString ("")), import (NewHash ()), bt (no_block)
{ {
}; };
@ -288,8 +290,7 @@ MODULA3 ():
m3raw_class_modifiers (NULL), m3raw_class_modifiers (NULL),
m3wrap_modifiers (NULL), m3wrap_modifiers (NULL),
upcasts_code (NULL), upcasts_code (NULL),
m3raw_cppcasts_code (NULL), destructor_call (NULL), outfile (NULL) m3raw_cppcasts_code (NULL), destructor_call (NULL), outfile (NULL) {
{
} }
/************** some utility functions ***************/ /************** some utility functions ***************/
@ -2175,9 +2176,9 @@ MODULA3 ():
bool isEnumItem = Strcmp (nodeType (n), "enumitem") == 0; bool isEnumItem = Strcmp (nodeType (n), "enumitem") == 0;
if ((isConstant || isEnumItem) && if ((isConstant || isEnumItem) &&
((pat.prefix == NIL) || (hasPrefix (name, pat.prefix))) && ((pat.prefix == NIL) || (hasPrefix (name, pat.prefix))) &&
((pat.parentEnum == NIL) || ((pat.parentEnum == NIL) || ((parentEnum != NIL)
((parentEnum != NIL) && (Strcmp (pat.parentEnum, parentEnum)
&& (Strcmp (pat.parentEnum, parentEnum) == 0)))) { == 0)))) {
//printf("tag %s\n", Char(name)); //printf("tag %s\n", Char(name));
String *srctype = Getitem (convdesc, 1); String *srctype = Getitem (convdesc, 1);
String *relationstr = Getitem (convdesc, 3); String *relationstr = Getitem (convdesc, 3);
@ -3849,10 +3850,10 @@ MODULA3 ():
count++; count++;
plist = nextSibling (plist); plist = nextSibling (plist);
} }
String *arg = (!pn String *arg = (!pn || (count > 1)) ? NewStringf ("arg%d",
|| (count > 1)) ? NewStringf ("arg%d", arg_num) :
arg_num) : Copy (Getattr (p, Copy (Getattr (p,
"name")); "name"));
return arg; return arg;
} }