summaryrefslogtreecommitdiff
path: root/Examples/test-suite/rename_pcre_encoder.i
diff options
context:
space:
mode:
authorVadim Zeitlin <vz-swig@zeitlins.org>2010-08-14 14:12:23 +0000
committerVadim Zeitlin <vz-swig@zeitlins.org>2010-08-14 14:12:23 +0000
commit024ed6ce2a3191c57c5c030dd133bf0e9e2a1971 (patch)
treeb071adb6a3a881265340909be5efbe4ed009a3fd /Examples/test-suite/rename_pcre_encoder.i
parent70b4d1231743911806b8a9625926187ce914560b (diff)
downloadswig-024ed6ce2a3191c57c5c030dd133bf0e9e2a1971.tar.gz
Fix bug in applying regex replacement to non-matching strings.
We didn't handle pcre_exec() return code properly and so the replacement could be still done even if there was no match if the replacement part contained anything else than back-references (in this, the only tested so far, case the replacement was still done but the result turned out to be empty and the calling code assumed the regex didn't match). Do check for PCRE_ERROR_NOMATCH now and also give an error message if another error unexpectedly occurred. Add a test case for the bug that was fixed. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12187 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Examples/test-suite/rename_pcre_encoder.i')
-rw-r--r--Examples/test-suite/rename_pcre_encoder.i7
1 files changed, 6 insertions, 1 deletions
diff --git a/Examples/test-suite/rename_pcre_encoder.i b/Examples/test-suite/rename_pcre_encoder.i
index 568a2a82d..1bee1dca8 100644
--- a/Examples/test-suite/rename_pcre_encoder.i
+++ b/Examples/test-suite/rename_pcre_encoder.i
@@ -3,9 +3,14 @@
// strip the wx prefix from all identifiers except those starting with wxEVT
%rename("%(regex:/wx(?!EVT)(.*)/\\1/)s") "";
+// Replace "Set" prefix with "put" in all functions
+%rename("%(regex:/^Set(.*)/put\\1/)s", %$isfunction) "";
+
%inline %{
-class wxSomeWidget {
+struct wxSomeWidget {
+ void SetBorderWidth(int);
+ void SetSize(int, int);
};
struct wxAnotherWidget {