From 22531698e596392dc17ef1a8110dfd92f4a260f0 Mon Sep 17 00:00:00 2001 From: Dave Beazley Date: Mon, 10 Jul 2000 22:52:29 +0000 Subject: [PATCH] Fixed problem in enum parsing. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@561 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/Source/SWIG1.1/parser.yxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/SWIG/Source/SWIG1.1/parser.yxx b/SWIG/Source/SWIG1.1/parser.yxx index 172293f62..6bf0a9eaf 100644 --- a/SWIG/Source/SWIG1.1/parser.yxx +++ b/SWIG/Source/SWIG1.1/parser.yxx @@ -1796,7 +1796,10 @@ edecl : ID { temp_typeptr = new DataType($4.type); // Use enum name instead of value // 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; scanner_ignore_typedef(); } @@ -1817,7 +1820,7 @@ etype : expr { } | CHARCONST { $$.id = $1; - $$.type = T_CHAR; + $$.type = T_INT; } ;