manage the labels as fail:
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7754 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
0c33167c26
commit
2cbcd0abc6
1 changed files with 9 additions and 1 deletions
|
|
@ -79,6 +79,7 @@ Wrapper_pretty_print(String *str, File *f) {
|
||||||
int empty = 1;
|
int empty = 1;
|
||||||
int indent = 4;
|
int indent = 4;
|
||||||
int plevel = 0;
|
int plevel = 0;
|
||||||
|
int label = 0;
|
||||||
|
|
||||||
ts = NewString("");
|
ts = NewString("");
|
||||||
Seek(str,0, SEEK_SET);
|
Seek(str,0, SEEK_SET);
|
||||||
|
|
@ -106,6 +107,12 @@ Wrapper_pretty_print(String *str, File *f) {
|
||||||
if (c == '\'') break;
|
if (c == '\'') break;
|
||||||
}
|
}
|
||||||
empty = 0;
|
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 == '(') {
|
} else if (c == '(') {
|
||||||
Putc(c,ts);
|
Putc(c,ts);
|
||||||
plevel+=indent;
|
plevel+=indent;
|
||||||
|
|
@ -144,7 +151,7 @@ Wrapper_pretty_print(String *str, File *f) {
|
||||||
Putc(c,ts);
|
Putc(c,ts);
|
||||||
empty = 0;
|
empty = 0;
|
||||||
if (!empty) {
|
if (!empty) {
|
||||||
if ((Char(ts))[0] != '#') {
|
if (!label && (Char(ts))[0] != '#') {
|
||||||
for (i = 0; i < level; i++)
|
for (i = 0; i < level; i++)
|
||||||
Putc(' ',f);
|
Putc(' ',f);
|
||||||
}
|
}
|
||||||
|
|
@ -153,6 +160,7 @@ Wrapper_pretty_print(String *str, File *f) {
|
||||||
Putc(' ',f);
|
Putc(' ',f);
|
||||||
}
|
}
|
||||||
Clear(ts);
|
Clear(ts);
|
||||||
|
label = 0;
|
||||||
empty = 1;
|
empty = 1;
|
||||||
} else if (c == '/') {
|
} else if (c == '/') {
|
||||||
empty = 0;
|
empty = 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue