From: SourceForge.net <no...@so...> - 2008-09-17 23:19:21
|
Bugs item #2095273, was opened at 2008-09-05 17:09 Message generated for change (Settings changed) made by olly You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101645&aid=2095273&group_id=1645 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: php Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Barry Cohen (barrycohen) >Assigned to: Olly Betts (olly) Summary: [php5] Cannot rename enum within a class properly Initial Comment: I've been working with SWIG for Python, Perl and PHP5 and have found the following to be a problem on PHP5 only. Using SWIG 1.3.36. We happen to use an enum with a member TRY. This is a reserved work in PHP so I tried to rename it with %rename: == example.h == class Foo { public: enum bar { BAZ, TRY }; }; == example.i == %module example %{ #include "example.h" %} %rename(c_TRY) TRY; %include "example.h" example.php contains: class Foo { const BAZ = 0; const TRY = Foo_c_TRY; } This won't run in PHP as TRY is a reserved word. I would have expected: class Foo { const BAZ = 0; const c_TRY = 1; } or something similar. Thanks ---------------------------------------------------------------------- Comment By: Olly Betts (olly) Date: 2008-09-18 07:19 Message: You'll get Foo_c_TRY not 1 currently, just because that's how implicitly numbered enums are handled. But it looks like we're grabbing the PHP enum name from the wrong place. I'll take a look when I get a chance. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101645&aid=2095273&group_id=1645 |