[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] allow new-line in typedef
From: |
Shigio Yamaguchi |
Subject: |
Re: [PATCH] allow new-line in typedef |
Date: |
Tue, 25 Mar 2003 22:00:24 +0900 |
Fixed. Thank you!
> >cat k.c
>
> typedef
> struct {
> int a;
> } foo;
>
> [current cvs version]
> >gctags -dtw k.c
> a 4 k.c int a;
> Warning: missing left '{' [+5 k.c].
>
> [patched version]
> >gctags -dtw k.c
> foo 5 k.c } foo;
>
>
> Index: gctags/C.c
> ===================================================================
> RCS file: /cvsroot/global/global/gctags/C.c,v
> retrieving revision 1.33
> diff -u -r1.33 C.c
> --- gctags/C.c 21 Mar 2003 01:17:02 -0000 1.33
> +++ gctags/C.c 25 Mar 2003 12:40:51 -0000
> @@ -299,7 +299,7 @@
> /* skip type qualifiers */
> do {
> c = nexttoken("{}(),;", reserved);
> - } while (IS_TYPE_QUALIFIER(c));
> + } while (IS_TYPE_QUALIFIER(c) || c == '\n');
>
> if (wflag && c == EOF) {
> fprintf(stderr, "Warning: unexpected eo
f. [+%d %s]\n", lineno, curfile);
> Index: gctags/Cpp.c
> ===================================================================
> RCS file: /cvsroot/global/global/gctags/Cpp.c,v
> retrieving revision 1.30
> diff -u -r1.30 Cpp.c
> --- gctags/Cpp.c 21 Mar 2003 01:17:02 -0000 1.30
> +++ gctags/Cpp.c 25 Mar 2003 12:40:52 -0000
> @@ -341,7 +341,12 @@
> int typedef_savelevel = level;
>
> savetok[0] = 0;
> - c = nexttoken("{}(),;", reserved);
> +
> + /* skip CV qualifiers */
> + do {
> + c = nexttoken("{}(),;", reserved);
> + } while (IS_CV_QUALIFIER(c) || c == '\n');
> +
> if (wflag && c == EOF) {
> fprintf(stderr, "Warning: unexpected eo
f. [+%d %s]\n", lineno, curfile);
> break;
> Index: gctags/Cpp.h
> ===================================================================
> RCS file: /cvsroot/global/global/gctags/Cpp.h,v
> retrieving revision 1.8
> diff -u -r1.8 Cpp.h
> --- gctags/Cpp.h 21 Mar 2003 01:17:02 -0000 1.8
> +++ gctags/Cpp.h 25 Mar 2003 12:40:52 -0000
> @@ -113,3 +113,5 @@
>
> #define MAXCOMPLETENAME 1024 /* max size of complete name of clas
s */
> #define MAXCLASSSTACK 100 /* max size of class stack */
> +
> +#define IS_CV_QUALIFIER(c) ((c) == CPP_CONST || (c) == CPP_VOLATILE)
>
> ----
> Hideki IWAMOTO address@hidden
>
>
> _______________________________________________
> Bug-global mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-global
>
>
--
Shigio Yamaguchi <address@hidden> - Tama Communications Corporation
PGP fingerprint: D1CB 0B89 B346 4AB6 5663 C4B6 3CA5 BBB3 57BE DDA3