From e003da2beafb02406a4a3912d5885f6db317d821 Mon Sep 17 00:00:00 2001 From: Colomban Wendling Date: Thu, 23 Jul 2015 18:08:28 +0200 Subject: [PATCH] ruby: Properly skip documentation contents --- tagmanager/ctags/ruby.c | 2 ++ tests/ctags/Makefile.am | 1 + tests/ctags/ruby-doc.rb | 22 ++++++++++++++++++++++ tests/ctags/ruby-doc.rb.tags | 5 +++++ 4 files changed, 30 insertions(+) create mode 100644 tests/ctags/ruby-doc.rb create mode 100644 tests/ctags/ruby-doc.rb.tags diff --git a/tagmanager/ctags/ruby.c b/tagmanager/ctags/ruby.c index fdb5335f..053b33f7 100644 --- a/tagmanager/ctags/ruby.c +++ b/tagmanager/ctags/ruby.c @@ -331,6 +331,8 @@ static void findRubyTags (void) inMultiLineComment = FALSE; continue; } + if (inMultiLineComment) + continue; skipWhitespace (&cp); diff --git a/tests/ctags/Makefile.am b/tests/ctags/Makefile.am index be042da4..8b187e26 100644 --- a/tests/ctags/Makefile.am +++ b/tests/ctags/Makefile.am @@ -255,6 +255,7 @@ test_sources = \ regexp.js \ return-hint.zep \ return-types.go \ + ruby-doc.rb \ ruby-sf-bug-364.rb \ rules.t2t \ sample.t2t \ diff --git a/tests/ctags/ruby-doc.rb b/tests/ctags/ruby-doc.rb new file mode 100644 index 00000000..4e852b19 --- /dev/null +++ b/tests/ctags/ruby-doc.rb @@ -0,0 +1,22 @@ +def f0; end + +=begin +def bug1 +end +=end + +def f1; end + +=begin +def bug2 +end +=end + +def f2; end + +=begin def doesntcount end +def bug3 +end +=end def notparsed end + +def f3; end diff --git a/tests/ctags/ruby-doc.rb.tags b/tests/ctags/ruby-doc.rb.tags new file mode 100644 index 00000000..0fc8eee0 --- /dev/null +++ b/tests/ctags/ruby-doc.rb.tags @@ -0,0 +1,5 @@ +# format=tagmanager +f0Ì128Ö0 +f1Ì128Ö0 +f2Ì128Ö0 +f3Ì128Ö0