enforce consistency in wrap:action wrt line spacing
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10411 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
d67d79e0dc
commit
46a0db50fe
8 changed files with 21 additions and 20 deletions
|
|
@ -907,7 +907,7 @@ public:
|
|||
|
||||
// below based on Swig_VargetToFunction()
|
||||
SwigType *ty = Swig_wrapped_var_type(Getattr(n, "type"), use_naturalvar_mode(n));
|
||||
Setattr(n, "wrap:action", NewStringf("result = (%s) %s;\n", SwigType_lstr(ty, 0), Getattr(n, "value")));
|
||||
Setattr(n, "wrap:action", NewStringf("result = (%s) %s;", SwigType_lstr(ty, 0), Getattr(n, "value")));
|
||||
}
|
||||
// Now write code to make the function call
|
||||
if (!native_function_flag)
|
||||
|
|
|
|||
|
|
@ -334,12 +334,12 @@ static void replace_contract_args(Parm *cp, Parm *rp, String *s) {
|
|||
/* -----------------------------------------------------------------------------
|
||||
* int emit_action()
|
||||
*
|
||||
* Emits action code for a wrapper and checks for exception handling
|
||||
* Emits action code for a wrapper. Adds in exception handling code (%exception).
|
||||
* ----------------------------------------------------------------------------- */
|
||||
int emit_action_code(Node *n, Wrapper *f, String *eaction) {
|
||||
assert(Getattr(n, "wrap:name"));
|
||||
|
||||
/* Look for except feature */
|
||||
/* Look for except feature (%exception) */
|
||||
String *tm = GetFlagAttr(n, "feature:except");
|
||||
if (tm)
|
||||
tm = Copy(tm);
|
||||
|
|
@ -410,6 +410,7 @@ void emit_action(Node *n, Wrapper *f) {
|
|||
}
|
||||
Setattr(n, "wrap:code:done", f_code);
|
||||
}
|
||||
|
||||
action = Getattr(n, "feature:action");
|
||||
if (!action)
|
||||
action = Getattr(n, "wrap:action");
|
||||
|
|
|
|||
|
|
@ -986,7 +986,7 @@ public:
|
|||
|
||||
// below based on Swig_VargetToFunction()
|
||||
SwigType *ty = Swig_wrapped_var_type(Getattr(n, "type"), use_naturalvar_mode(n));
|
||||
Setattr(n, "wrap:action", NewStringf("result = (%s) %s;\n", SwigType_lstr(ty, 0), Getattr(n, "value")));
|
||||
Setattr(n, "wrap:action", NewStringf("result = (%s) %s;", SwigType_lstr(ty, 0), Getattr(n, "value")));
|
||||
}
|
||||
// Now write code to make the function call
|
||||
if (!native_function_flag) {
|
||||
|
|
|
|||
|
|
@ -919,7 +919,7 @@ public:
|
|||
Printv(f_wrappers, "static void swig_delete_", class_name, "(void *obj) {\n", NIL);
|
||||
if (destructor_action) {
|
||||
Printv(f_wrappers, SwigType_str(rt, "arg1"), " = (", SwigType_str(rt, 0), ") obj;\n", NIL);
|
||||
Printv(f_wrappers, destructor_action, NIL);
|
||||
Printv(f_wrappers, destructor_action, "\n", NIL);
|
||||
} else {
|
||||
if (CPlusPlus) {
|
||||
Printv(f_wrappers, " delete (", SwigType_str(rt, 0), ") obj;\n", NIL);
|
||||
|
|
|
|||
|
|
@ -1413,7 +1413,7 @@ MODULA3():
|
|||
|
||||
// below based on Swig_VargetToFunction()
|
||||
SwigType *ty = Swig_wrapped_var_type(Getattr(n, "type"), use_naturalvar_mode(n));
|
||||
Setattr(n, "wrap:action", NewStringf("result = (%s) %s;\n", SwigType_lstr(ty, 0), Getattr(n, "value")));
|
||||
Setattr(n, "wrap:action", NewStringf("result = (%s) %s;", SwigType_lstr(ty, 0), Getattr(n, "value")));
|
||||
}
|
||||
|
||||
Setattr(n, "wrap:name", wname);
|
||||
|
|
|
|||
|
|
@ -1759,9 +1759,9 @@ public:
|
|||
Wrapper_add_local(f, "classname", classname);
|
||||
}
|
||||
if (action) {
|
||||
Append(action, "DATA_PTR(self) = result;\n");
|
||||
Append(action, "\nDATA_PTR(self) = result;");
|
||||
if (GetFlag(pn, "feature:trackobjects")) {
|
||||
Append(action, "SWIG_RubyAddTracking(result, self);\n");
|
||||
Append(action, "\nSWIG_RubyAddTracking(result, self);");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -2654,11 +2654,11 @@ public:
|
|||
Printv(f_wrappers, wrap, NIL);
|
||||
}
|
||||
/* Printv(freebody, Swig_name_destroy(name), "(", pname0, ")", NIL); */
|
||||
Printv(freebody, Getattr(n, "wrap:action"), NIL);
|
||||
Printv(freebody, Getattr(n, "wrap:action"), "\n", NIL);
|
||||
} else {
|
||||
String *action = Getattr(n, "wrap:action");
|
||||
if (action) {
|
||||
Printv(freebody, action, NIL);
|
||||
Printv(freebody, action, "\n", NIL);
|
||||
} else {
|
||||
/* In the case swig emits no destroy function. */
|
||||
if (CPlusPlus)
|
||||
|
|
|
|||
|
|
@ -782,7 +782,7 @@ public:
|
|||
Printv(f_wrappers, "SWIGINTERN void swig_delete_", class_name, "(void *obj) {\n", NIL);
|
||||
if (destructor_action) {
|
||||
Printv(f_wrappers, SwigType_str(rt, "arg1"), " = (", SwigType_str(rt, 0), ") obj;\n", NIL);
|
||||
Printv(f_wrappers, destructor_action, NIL);
|
||||
Printv(f_wrappers, destructor_action, "\n", NIL);
|
||||
} else {
|
||||
if (CPlusPlus) {
|
||||
Printv(f_wrappers, " delete (", SwigType_str(rt, 0), ") obj;\n", NIL);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue