Added support for Ruby bang methods. Bang methods end in exclamation points and indicate that the object being worked on will be modified in-place as opposed to being copied.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8441 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
0f30bdd690
commit
723d385e36
3 changed files with 13 additions and 1 deletions
|
|
@ -1,6 +1,12 @@
|
||||||
Version 1.3.28 (unreleased).
|
Version 1.3.28 (unreleased).
|
||||||
===========================
|
===========================
|
||||||
|
|
||||||
|
01/14/2006: cfisavage
|
||||||
|
Added support for Ruby bang! methods via a new %bang feature.
|
||||||
|
Bang methods end in exclamation points and indicate that the
|
||||||
|
object being processed will be modified in-place as
|
||||||
|
opposed to being copied.
|
||||||
|
|
||||||
01/12/2006: cfisavage
|
01/12/2006: cfisavage
|
||||||
Updated the Ruby module to automatically convert
|
Updated the Ruby module to automatically convert
|
||||||
method names to lower_case_with_underscores using the
|
method names to lower_case_with_underscores using the
|
||||||
|
|
|
||||||
|
|
@ -3,4 +3,5 @@
|
||||||
#define %markfunc %feature("markfunc")
|
#define %markfunc %feature("markfunc")
|
||||||
#define %mixin %feature("mixin")
|
#define %mixin %feature("mixin")
|
||||||
#define %predicate %feature("predicate", "1")
|
#define %predicate %feature("predicate", "1")
|
||||||
|
#define %bang %feature("bang", "1")
|
||||||
#define %trackobjects %feature("trackobjects")
|
#define %trackobjects %feature("trackobjects")
|
||||||
|
|
|
||||||
|
|
@ -965,7 +965,7 @@ public:
|
||||||
* predicate methods that return true or false (e.g. Array#empty?).
|
* predicate methods that return true or false (e.g. Array#empty?).
|
||||||
*
|
*
|
||||||
* Methods whose names end with exclamation points are, by convention,
|
* Methods whose names end with exclamation points are, by convention,
|
||||||
* "mutators" that modify the instance in place (e.g. Array#sort!).
|
* called bang methods that modify the instance in place (e.g. Array#sort!).
|
||||||
*
|
*
|
||||||
* Methods whose names end with an equals sign are attribute setters
|
* Methods whose names end with an equals sign are attribute setters
|
||||||
* (e.g. Thread#critical=).
|
* (e.g. Thread#critical=).
|
||||||
|
|
@ -1038,6 +1038,11 @@ public:
|
||||||
Append(symname, "?");
|
Append(symname, "?");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Rename bang methods */
|
||||||
|
if (GetFlag(n, "feature:bang")) {
|
||||||
|
Append(symname, "!");
|
||||||
|
}
|
||||||
|
|
||||||
/* Determine the name of the SWIG wrapper function */
|
/* Determine the name of the SWIG wrapper function */
|
||||||
String *wname = Swig_name_wrapper(symname);
|
String *wname = Swig_name_wrapper(symname);
|
||||||
if (overname && current != CONSTRUCTOR_ALLOCATE) {
|
if (overname && current != CONSTRUCTOR_ALLOCATE) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue