aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/etags.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/lib-src/etags.c b/lib-src/etags.c
index c91cef40bfa..cd49f7199ba 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -724,10 +724,10 @@ static const char Python_help [] =
724generate a tag."; 724generate a tag.";
725 725
726static const char *Ruby_suffixes [] = 726static const char *Ruby_suffixes [] =
727 { "rb", NULL }; 727 { "rb", "ruby", NULL };
728static const char Ruby_help [] = 728static const char Ruby_help [] =
729 "In Ruby code, 'def' or 'class' at the beginning of a line\n\ 729 "In Ruby code, 'def' or 'class' or 'module' at the beginning of\n\
730generate a tag."; 730a line generate a tag.";
731 731
732/* Can't do the `SCM' or `scm' prefix with a version number. */ 732/* Can't do the `SCM' or `scm' prefix with a version number. */
733static const char *Scheme_suffixes [] = 733static const char *Scheme_suffixes [] =
@@ -4552,15 +4552,19 @@ Ruby_functions (FILE *inf)
4552 LOOP_ON_INPUT_LINES (inf, lb, cp) 4552 LOOP_ON_INPUT_LINES (inf, lb, cp)
4553 { 4553 {
4554 cp = skip_spaces (cp); 4554 cp = skip_spaces (cp);
4555 if (LOOKING_AT (cp, "def") || LOOKING_AT (cp, "class")) 4555 if (LOOKING_AT (cp, "def")
4556 || LOOKING_AT (cp, "class")
4557 || LOOKING_AT (cp, "module"))
4556 { 4558 {
4557 char *name = cp; 4559 char *name = cp;
4558 4560
4559 while (!notinname (*cp)) 4561 /* Ruby method names can end in a '='. Also, operator overloading can
4562 define operators whose names include '='. */
4563 while (!notinname (*cp) || *cp == '=')
4560 cp++; 4564 cp++;
4561 4565
4562 make_tag(name, cp -name, true, 4566 make_tag (name, cp - name, true,
4563 lb.buffer, cp - lb.buffer + 1, lineno, linecharno); 4567 lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
4564 } 4568 }
4565 } 4569 }
4566} 4570}