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
|
|
@ -965,7 +965,7 @@ public:
|
|||
* predicate methods that return true or false (e.g. Array#empty?).
|
||||
*
|
||||
* 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
|
||||
* (e.g. Thread#critical=).
|
||||
|
|
@ -1038,6 +1038,11 @@ public:
|
|||
Append(symname, "?");
|
||||
}
|
||||
|
||||
/* Rename bang methods */
|
||||
if (GetFlag(n, "feature:bang")) {
|
||||
Append(symname, "!");
|
||||
}
|
||||
|
||||
/* Determine the name of the SWIG wrapper function */
|
||||
String *wname = Swig_name_wrapper(symname);
|
||||
if (overname && current != CONSTRUCTOR_ALLOCATE) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue