aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorEli Zaretskii2021-06-10 16:55:04 +0300
committerEli Zaretskii2021-06-10 16:57:03 +0300
commitaf4cccb8d98516ae96a3ebdc9a9eb7d7d8d5c1c5 (patch)
treecfc7462c073e3726b7dfdd112fa7a768fb92ec82 /lib-src
parente27b531d5a61e37d5e7d453663f3ec1a08a76fb9 (diff)
downloademacs-af4cccb8d98516ae96a3ebdc9a9eb7d7d8d5c1c5.tar.gz
emacs-af4cccb8d98516ae96a3ebdc9a9eb7d7d8d5c1c5.zip
Support mercury in 'ctags' as well
The previous lack of support was due to incorrect calls to 'make_tag' in 'mercury_pr', which caused 'pfnote' to refrain from adding Mercury tags to the list of recorded tags. * lib-src/etags.c (mercury_pr): Pass the correct NAME and NAMELEN arguments to 'make_tag'. * test/manual/etags/CTAGS.good: Adjust to the above change.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/etags.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/lib-src/etags.c b/lib-src/etags.c
index e5bd36c782f..9f20e44caf4 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -6399,7 +6399,7 @@ mercury_decl (char *s, size_t pos)
6399 { 6399 {
6400 if (strcmp (buf, "pred") != 0 && strcmp (buf, "func") != 0) /* Bad syntax. */ 6400 if (strcmp (buf, "pred") != 0 && strcmp (buf, "func") != 0) /* Bad syntax. */
6401 return 0; 6401 return 0;
6402 is_mercury_quantifier = false; /* Beset to base value. */ 6402 is_mercury_quantifier = false; /* Reset to base value. */
6403 found_decl_tag = true; 6403 found_decl_tag = true;
6404 } 6404 }
6405 else 6405 else
@@ -6530,7 +6530,7 @@ mercury_pr (char *s, char *last, ptrdiff_t lastlen)
6530 len0 = skip_spaces (s + 2) - s; 6530 len0 = skip_spaces (s + 2) - s;
6531 } 6531 }
6532 6532
6533 size_t len = mercury_decl (s , len0); 6533 size_t len = mercury_decl (s, len0);
6534 if (len == 0) return 0; 6534 if (len == 0) return 0;
6535 len += len0; 6535 len += len0;
6536 6536
@@ -6545,7 +6545,22 @@ mercury_pr (char *s, char *last, ptrdiff_t lastlen)
6545 the first line. */ 6545 the first line. */
6546 || is_mercury_type) 6546 || is_mercury_type)
6547 { 6547 {
6548 make_tag (s, 0, true, s, len, lineno, linecharno); 6548 char *name = skip_non_spaces (s + len0);
6549 size_t namelen;
6550 if (name >= s + len)
6551 {
6552 name = s;
6553 namelen = len;
6554 }
6555 else
6556 {
6557 name = skip_spaces (name);
6558 namelen = len - (name - s);
6559 }
6560 /* Remove trailing non-name characters. */
6561 while (namelen > 0 && notinname (name[namelen - 1]))
6562 namelen--;
6563 make_tag (name, namelen, true, s, len, lineno, linecharno);
6549 return len; 6564 return len;
6550 } 6565 }
6551 6566