bug-global
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] brace level in typedef


From: Hideki IWAMOTO
Subject: [PATCH] brace level in typedef
Date: Fri, 07 Mar 2003 00:02:45 +0900

If the brace level of the beginning of typedef is not 0,
gctags does not escape from a loop until it reaches the end of a file.

? gctags/.deps
? gctags/Makefile
? gctags/Makefile.in
? gctags/const.h
? gctags/gctags
? gctags/gctags.1
Index: gctags/C.c
===================================================================
RCS file: /cvsroot/global/global/gctags/C.c,v
retrieving revision 1.23
diff -u -r1.23 C.c
--- gctags/C.c  5 Mar 2003 16:04:12 -0000       1.23
+++ gctags/C.c  6 Mar 2003 14:35:08 -0000
@@ -403,7 +403,7 @@
                                        else if (c == ')')
                                                level--;
                                        else if (c == SYMBOL) {
-                                               if (level > 0) {
+                                               if (level > typedef_savelevel) {
                                                        if (target == SYM)
                                                                PUT(token, 
lineno, sp);
                                                } else {
@@ -423,13 +423,13 @@
                                                        savetok[0] = 0;
                                                }
                                        }
-                                       if (level == 0 && c == ';')
+                                       if (level == typedef_savelevel && c == 
';')
                                                break;
                                }
                                if (wflag) {
                                        if (c == EOF)
                                                fprintf(stderr, "Warning: 
unexpected eof. [+%d %s]\n", lineno, curfile);
-                                       else if (level > 0)
+                                       else if (level != typedef_savelevel)
                                                fprintf(stderr, "Warning: () 
block unmatched. (last at level %d.)[+%d %s]\n", level, lineno, curfile);
                                }
                        }
Index: gctags/Cpp.c
===================================================================
RCS file: /cvsroot/global/global/gctags/Cpp.c,v
retrieving revision 1.21
diff -u -r1.21 Cpp.c
--- gctags/Cpp.c        5 Mar 2003 16:04:12 -0000       1.21
+++ gctags/Cpp.c        6 Mar 2003 14:35:08 -0000
@@ -449,7 +449,7 @@
                                        else if (c == ')')
                                                level--;
                                        else if (c == SYMBOL) {
-                                               if (level > 0) {
+                                               if (level > typedef_savelevel) {
                                                        if (target == SYM)
                                                                PUT(token, 
lineno, sp);
                                                } else {
@@ -469,13 +469,13 @@
                                                        savetok[0] = 0;
                                                }
                                        }
-                                       if (level == 0 && c == ';')
+                                       if (level == typedef_savelevel && c == 
';')
                                                break;
                                }
                                if (wflag) {
                                        if (c == EOF)
                                                fprintf(stderr, "Warning: 
unexpected eof. [+%d %s]\n", lineno, curfile);
-                                       else if (level > 0)
+                                       else if (level != typedef_savelevel)
                                                fprintf(stderr, "Warning: () 
block unmatched. (last at level %d.)[+%d %s]\n", level, lineno, curfile);
                                }
                        }

----
Hideki IWAMOTO  address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]