From 2cbcd0abc67e46c930a4bd9f71d07679ebc7ef0f Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Mon, 31 Oct 2005 09:36:01 +0000 Subject: [PATCH] manage the labels as fail: git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7754 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/Source/Swig/wrapfunc.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/SWIG/Source/Swig/wrapfunc.c b/SWIG/Source/Swig/wrapfunc.c index c22f7adaa..c6bae881b 100644 --- a/SWIG/Source/Swig/wrapfunc.c +++ b/SWIG/Source/Swig/wrapfunc.c @@ -79,6 +79,7 @@ Wrapper_pretty_print(String *str, File *f) { int empty = 1; int indent = 4; int plevel = 0; + int label = 0; ts = NewString(""); Seek(str,0, SEEK_SET); @@ -106,6 +107,12 @@ Wrapper_pretty_print(String *str, File *f) { if (c == '\'') break; } empty = 0; + } else if (c == ':') { + Putc(c,ts); + if ((c = Getc(str)) == '\n') { + if (!empty && !Strstr(ts,"?")) label = 1; + } + Ungetc(c,str); } else if (c == '(') { Putc(c,ts); plevel+=indent; @@ -144,7 +151,7 @@ Wrapper_pretty_print(String *str, File *f) { Putc(c,ts); empty = 0; if (!empty) { - if ((Char(ts))[0] != '#') { + if (!label && (Char(ts))[0] != '#') { for (i = 0; i < level; i++) Putc(' ',f); } @@ -153,6 +160,7 @@ Wrapper_pretty_print(String *str, File *f) { Putc(' ',f); } Clear(ts); + label = 0; empty = 1; } else if (c == '/') { empty = 0;