Teach ctags(1) how to handle intermediate whitespace in macros
and function definitions. PR: misc/4128 Submitted by: Shigio Yamaguchi <shigio@wafu.netgate.net>
This commit is contained in:
parent
cf90bd0cbb
commit
0c30eecaa0
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=28625
@ -32,7 +32,12 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)C.c 8.4 (Berkeley) 4/2/94";
|
||||
#else
|
||||
static const char rcsid[] =
|
||||
"$Id$";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include <limits.h>
|
||||
@ -193,6 +198,16 @@ c_entries()
|
||||
* reserved words.
|
||||
*/
|
||||
default:
|
||||
/* ignore whitespace */
|
||||
if (c == ' ' || c == '\t') {
|
||||
int save = c;
|
||||
while (GETC(!=, EOF) && (c == ' ' || c == '\t'))
|
||||
;
|
||||
if (c == EOF)
|
||||
return;
|
||||
(void)ungetc(c, inf);
|
||||
c = save;
|
||||
}
|
||||
storec: if (!intoken(c)) {
|
||||
if (sp == tok)
|
||||
break;
|
||||
@ -311,6 +326,11 @@ hash_entry()
|
||||
char *sp; /* buffer pointer */
|
||||
char tok[MAXTOKEN]; /* storage buffer */
|
||||
|
||||
/* ignore leading whitespace */
|
||||
while (GETC(!=, EOF) && (c == ' ' || c == '\t'))
|
||||
;
|
||||
(void)ungetc(c, inf);
|
||||
|
||||
curline = lineno;
|
||||
for (sp = tok;;) { /* get next token */
|
||||
if (GETC(==, EOF))
|
||||
|
Loading…
Reference in New Issue
Block a user