summaryrefslogtreecommitdiff
path: root/lib-src
diff options
context:
space:
mode:
authorAlexander Gramiak <agrambot@gmail.com>2017-07-08 11:25:53 +0300
committerEli Zaretskii <eliz@gnu.org>2017-07-08 11:25:53 +0300
commit42cdb68649c24eab07baa39b0c553c87e7ac9989 (patch)
tree8dd97bc0a5c6733287a86427b8239884d7192971 /lib-src
parent92307cb05d8b0d05dab7981f30c13962f8050eb0 (diff)
downloademacs-42cdb68649c24eab07baa39b0c553c87e7ac9989.tar.gz
Support '=' in Scheme and Lisp tags in 'etags'
* lib-src/etags.c (get_lispy_tag): New function. (L_getit, Scheme_functions): Use get_lispy_tag (Bug#5624). * test/manual/etags/CTAGS.good: * test/manual/etags/ETAGS.good_1: * test/manual/etags/ETAGS.good_2: * test/manual/etags/ETAGS.good_3: * test/manual/etags/ETAGS.good_4: * test/manual/etags/ETAGS.good_5: * test/manual/etags/ETAGS.good_6: * test/manual/etags/Makefile: * test/manual/etags/el-src/TAGTEST.EL: Update tests. * test/manual/etags/scm-src/test.scm: New tests for Scheme.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/etags.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/lib-src/etags.c b/lib-src/etags.c
index e5ff7bd10fc..7b1a7fc1851 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -373,6 +373,7 @@ static void readline (linebuffer *, FILE *);
static long readline_internal (linebuffer *, FILE *, char const *);
static bool nocase_tail (const char *);
static void get_tag (char *, char **);
+static void get_lispy_tag (char *);
static void analyze_regex (char *);
static void free_regexps (void);
@@ -5347,7 +5348,7 @@ L_getit (void)
/* Ok, then skip "(" before name in (defstruct (foo)) */
dbp = skip_spaces (dbp);
}
- get_tag (dbp, NULL);
+ get_lispy_tag (dbp);
}
static void
@@ -5549,14 +5550,14 @@ Scheme_functions (FILE *inf)
if (strneq (bp, "(def", 4) || strneq (bp, "(DEF", 4))
{
bp = skip_non_spaces (bp+4);
- /* Skip over open parens and white space. Don't continue past
- '\0'. */
- while (*bp && notinname (*bp))
+ /* Skip over open parens and white space.
+ Don't continue past '\0' or '='. */
+ while (*bp && notinname (*bp) && *bp != '=')
bp++;
- get_tag (bp, NULL);
+ get_lispy_tag (bp);
}
if (LOOKING_AT (bp, "(SET!") || LOOKING_AT (bp, "(set!"))
- get_tag (bp, NULL);
+ get_lispy_tag (bp);
}
}
@@ -6591,6 +6592,22 @@ get_tag (register char *bp, char **namepp)
*namepp = savenstr (bp, cp - bp);
}
+/* Similar to get_tag, but include '=' as part of the tag. */
+static void
+get_lispy_tag (register char *bp)
+{
+ register char *cp = bp;
+
+ if (*bp != '\0')
+ {
+ /* Go till you get to white space or a syntactic break */
+ for (cp = bp + 1; !notinname (*cp) || *cp == '='; cp++)
+ continue;
+ make_tag (bp, cp - bp, true,
+ lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
+ }
+}
+
/*
* Read a line of text from `stream' into `lbp', excluding the
* newline or CR-NL, if any. Return the number of characters read from