Fixed problem in enum parsing.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@561 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Dave Beazley 2000-07-10 22:52:29 +00:00
commit e1e0136fa3

View file

@ -1796,7 +1796,10 @@ edecl : ID {
temp_typeptr = new DataType($4.type); temp_typeptr = new DataType($4.type);
// Use enum name instead of value // Use enum name instead of value
// OLD create_constant($1, temp_typeptr, $4.id); // OLD create_constant($1, temp_typeptr, $4.id);
create_constant($1, temp_typeptr, $1); if ($4.type == T_CHAR)
create_constant($1,temp_typeptr, $4.id);
else
create_constant($1, temp_typeptr, $1);
delete temp_typeptr; delete temp_typeptr;
scanner_ignore_typedef(); scanner_ignore_typedef();
} }
@ -1817,7 +1820,7 @@ etype : expr {
} }
| CHARCONST { | CHARCONST {
$$.id = $1; $$.id = $1;
$$.type = T_CHAR; $$.type = T_INT;
} }
; ;