diff options
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/etags.c | 21 |
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 | ||