diff --git a/NEWS b/NEWS index 19e8e88..0681aa5 100644 --- a/NEWS +++ b/NEWS @@ -29,6 +29,7 @@ ctags-NEXT (Mon June 6 2007) * Fixed typo in man page [Debian bug #366412]. * Fixed missing chunk of text in man page and over-use of hyphens in UTF-8 locales [Debian bug #271323]. * Fixed parsing of ` as a method name [Ruby]. +* Fixed parsing of keywords in string literals [Ruby, Bug #1742588]. * Fixed potential segmentation violation [Bug #1672834, Bug #1222926]. * Fixed parsing of destructors with whitespace after the '~' [C++, Bug #1585745]. * Fixed default access of unions to be public [C++, Bug #1548443]. diff --git a/Test/bug1742588.rb b/Test/bug1742588.rb new file mode 100644 index 0000000..43b1a14 --- /dev/null +++ b/Test/bug1742588.rb @@ -0,0 +1,7 @@ +class A + def a() + super(" do ") + end + def b() + end +end diff --git a/ruby.c b/ruby.c index 35e5150..684c164 100644 --- a/ruby.c +++ b/ruby.c @@ -346,7 +346,7 @@ static void findRubyTags (void) while (*cp != '\0') { - /* FIXME: we don't cope with here documents, or string literals, + /* FIXME: we don't cope with here documents, * or regular expression literals, or ... you get the idea. * Hopefully, the restriction above that insists on seeing * definitions at the starts of lines should keep us out of @@ -374,6 +374,15 @@ static void findRubyTags (void) vStringDelete (stringListLast (nesting)); stringListRemoveLast (nesting); } + else if (*cp == '"') + { + /* Skip string literals. + * FIXME: should cope with escapes and interpolation. + */ + do { + ++cp; + } while (*cp != 0 && *cp != '"'); + } else if (*cp != '\0') { do