aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorAlexander Gramiak2017-07-08 11:25:53 +0300
committerEli Zaretskii2017-07-08 11:25:53 +0300
commit42cdb68649c24eab07baa39b0c553c87e7ac9989 (patch)
tree8dd97bc0a5c6733287a86427b8239884d7192971 /lib-src
parent92307cb05d8b0d05dab7981f30c13962f8050eb0 (diff)
downloademacs-42cdb68649c24eab07baa39b0c553c87e7ac9989.tar.gz
emacs-42cdb68649c24eab07baa39b0c553c87e7ac9989.zip
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 *);
373static long readline_internal (linebuffer *, FILE *, char const *); 373static long readline_internal (linebuffer *, FILE *, char const *);
374static bool nocase_tail (const char *); 374static bool nocase_tail (const char *);
375static void get_tag (char *, char **); 375static void get_tag (char *, char **);
376static void get_lispy_tag (char *);
376 377
377static void analyze_regex (char *); 378static void analyze_regex (char *);
378static void free_regexps (void); 379static void free_regexps (void);
@@ -5347,7 +5348,7 @@ L_getit (void)
5347 /* Ok, then skip "(" before name in (defstruct (foo)) */ 5348 /* Ok, then skip "(" before name in (defstruct (foo)) */
5348 dbp = skip_spaces (dbp); 5349 dbp = skip_spaces (dbp);
5349 } 5350 }
5350 get_tag (dbp, NULL); 5351 get_lispy_tag (dbp);
5351} 5352}
5352 5353
5353static void 5354static void
@@ -5549,14 +5550,14 @@ Scheme_functions (FILE *inf)
5549 if (strneq (bp, "(def", 4) || strneq (bp, "(DEF", 4)) 5550 if (strneq (bp, "(def", 4) || strneq (bp, "(DEF", 4))
5550 { 5551 {
5551 bp = skip_non_spaces (bp+4); 5552 bp = skip_non_spaces (bp+4);
5552 /* Skip over open parens and white space. Don't continue past 5553 /* Skip over open parens and white space.
5553 '\0'. */ 5554 Don't continue past '\0' or '='. */
5554 while (*bp && notinname (*bp)) 5555 while (*bp && notinname (*bp) && *bp != '=')
5555 bp++; 5556 bp++;
5556 get_tag (bp, NULL); 5557 get_lispy_tag (bp);
5557 } 5558 }
5558 if (LOOKING_AT (bp, "(SET!") || LOOKING_AT (bp, "(set!")) 5559 if (LOOKING_AT (bp, "(SET!") || LOOKING_AT (bp, "(set!"))
5559 get_tag (bp, NULL); 5560 get_lispy_tag (bp);
5560 } 5561 }
5561} 5562}
5562 5563
@@ -6591,6 +6592,22 @@ get_tag (register char *bp, char **namepp)
6591 *namepp = savenstr (bp, cp - bp); 6592 *namepp = savenstr (bp, cp - bp);
6592} 6593}
6593 6594
6595/* Similar to get_tag, but include '=' as part of the tag. */
6596static void
6597get_lispy_tag (register char *bp)
6598{
6599 register char *cp = bp;
6600
6601 if (*bp != '\0')
6602 {
6603 /* Go till you get to white space or a syntactic break */
6604 for (cp = bp + 1; !notinname (*cp) || *cp == '='; cp++)
6605 continue;
6606 make_tag (bp, cp - bp, true,
6607 lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
6608 }
6609}
6610
6594/* 6611/*
6595 * Read a line of text from `stream' into `lbp', excluding the 6612 * Read a line of text from `stream' into `lbp', excluding the
6596 * newline or CR-NL, if any. Return the number of characters read from 6613 * newline or CR-NL, if any. Return the number of characters read from