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:
William S Fulton 2008-05-01 21:47:23 +00:00
commit 46a0db50fe
8 changed files with 21 additions and 20 deletions

View file

@ -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)

View file

@ -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");

View file

@ -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) {

View file

@ -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);

View file

@ -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);

View file

@ -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)

View file

@ -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);