ctags fix for lisp (reposting)

Ken Arnold%UCB arnold at ucsfcgl.UUCP
Thu Nov 15 08:45:39 AEST 1984


Apparently my fix to my ctags program got truncataed at some sites.
I posted a version of ctags which recognized YACC and lex files, and
this is an update to it.  This is an editor script which will take
my posted ctags and (a) fix an introduced bug which prevented it
from recognizing lisp file, and (b) has ctags recognize the syntax
of "(defmethod", "(defwrapper" and "(defwhopper".  You MUST have
my posted ctags -- this will not work with the ctags source as
distributed by Berkeley (or anyone else).

--------------------cut here--------------------
931,932c
		if (!isspace(c) && c != '\r') {
.
918a
 * striccmp:
 *	Compare two strings over the length of the second, ignoring
 *	case distinctions.  If they are the same, return 0.  If they
 *	are different, return the difference of the first two different
 *	characters.  It is assumed that the pattern (second string) is
 *	completely lower case.
 */
striccmp(str, pat)
register char	*str, *pat;
{
	register int	c1;

	while (*pat) {
		if (isupper(*str))
			c1 = tolower(*str);
		else
			c1 = *str;
		if (c1 != *pat)
			return c1 - *pat;
		pat++;
		str++;
	}
	return 0;
}

/*
.
907,909c
	if (*dbp == 0)
		return;
	if (special) {
		if ((cp = index(dbp, ')')) == NULL)
			return;
		while (cp >= dbp && *cp != ':')
			cp--;
		if (cp < dbp)
			return;
		dbp = cp;
		while (*cp && *cp != ')' && *cp != ' ')
			cp++;
	}
	else
		for (cp = dbp + 1; *cp && *cp != '(' && *cp != ' '; cp++)
			continue;
.
905c
	for (cp = lbuf; *cp; cp++)
		continue;
.
901,903c
	register char	*cp;
	register char	c;
	char		nambuf[BUFSIZ];
.
899c
L_getit(special)
int	special;
.
897a
}
.
888,895c
		if (dbp[0] == '(' &&
		    (dbp[1] == 'D' || dbp[1] == 'd') &&
		    (dbp[2] == 'E' || dbp[2] == 'e') &&
		    (dbp[3] == 'F' || dbp[3] == 'f')) {
			dbp += 4;
			if (striccmp(dbp, "method") == 0 ||
			    striccmp(dbp, "wrapper") == 0 ||
			    striccmp(dbp, "whopper") == 0)
				special = TRUE;
			else
				special = FALSE;
			while (!isspace(*dbp))
				dbp++;
			while (isspace(*dbp))
				dbp++;
			L_getit(special);
.
883a
	register int	special;

.
217c
		if (index(";([", first_char()) != NULL) {	/* lisp */
.
0a
/* $Header */

.



More information about the Comp.sources.bugs mailing list