diff options
author | Eli Zaretskii <eliz@gnu.org> | 2016-01-30 14:16:36 +0200 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2016-01-30 14:16:36 +0200 |
commit | 25b79d7bc71079cd6ebb2700623e7e3b76b03287 (patch) | |
tree | 1654109110b07b8ebf8fd9b9196e73f2d4553972 /test | |
parent | ccc3b3cd68312e1d69d9f9af943ee2b9a9d88198 (diff) | |
download | emacs-25b79d7bc71079cd6ebb2700623e7e3b76b03287.tar.gz |
Improve Ruby support in 'etags'
* lib-src/etags.c (Ruby_functions): Tag constants. Don't tag
singleton classes. Remove class qualifiers from tags generated
for method and constant names. (Bug#22241)
* doc/emacs/maintaining.texi (Tag Syntax): Mention that constants
are tagged by etags in Ruby.
* etc/NEWS: Mention that constants are tagged by etags in Ruby.
* test/etags/ruby-src/test1.ruby: Add more tests.
* test/etags/ETAGS.good_1:
* test/etags/ETAGS.good_2:
* test/etags/ETAGS.good_3:
* test/etags/ETAGS.good_4:
* test/etags/ETAGS.good_5:
* test/etags/ETAGS.good_6:
* test/etags/CTAGS.good: Adapt to the changes in etags and in Ruby
tests.
Diffstat (limited to 'test')
-rw-r--r-- | test/etags/CTAGS.good | 11 | ||||
-rw-r--r-- | test/etags/ETAGS.good_1 | 15 | ||||
-rw-r--r-- | test/etags/ETAGS.good_2 | 15 | ||||
-rw-r--r-- | test/etags/ETAGS.good_3 | 15 | ||||
-rw-r--r-- | test/etags/ETAGS.good_4 | 15 | ||||
-rw-r--r-- | test/etags/ETAGS.good_5 | 15 | ||||
-rw-r--r-- | test/etags/ETAGS.good_6 | 15 | ||||
-rw-r--r-- | test/etags/ruby-src/test1.ruby | 22 |
8 files changed, 97 insertions, 26 deletions
diff --git a/test/etags/CTAGS.good b/test/etags/CTAGS.good index 1c494d64277..86eb9f85cf3 100644 --- a/test/etags/CTAGS.good +++ b/test/etags/CTAGS.good @@ -227,6 +227,8 @@ A cp-src/c.C 117 A cp-src/fail.C 7 A cp-src/fail.C 23 A ruby-src/test1.ruby /^class A$/ +A ruby-src/test1.ruby /^module A$/ +ABC ruby-src/test1.ruby 11 ADDRESS c-src/emacs/src/gmalloc.c /^#define ADDRESS(B) ((void *) (((B) - 1) * BLOCKSIZ/ ALIGNOF_STRUCT_LISP_VECTOR c-src/emacs/src/lisp.h 1378 ALLOCATED_BEFORE_DUMPING c-src/emacs/src/gmalloc.c /^#define ALLOCATED_BEFORE_DUMPING(P) \\$/ @@ -289,6 +291,7 @@ B cp-src/c.C /^void B::B() {}$/ B cp-src/c.C 122 B cp-src/fail.C 8 B cp-src/fail.C 24 +B ruby-src/test1.ruby /^ class B$/ BE_Node cp-src/c.C /^void BE_Node::BE_Node() {}$/ BE_Node cp-src/c.C 77 BITS_PER_BITS_WORD c-src/emacs/src/lisp.h 125 @@ -438,7 +441,6 @@ Cjava_entries c-src/etags.c /^Cjava_entries (FILE *inf)$/ Cjava_help c-src/etags.c 551 Cjava_suffixes c-src/etags.c 549 ClassExample ruby-src/test.rb /^ class ClassExample$/ -ClassExample.class_method ruby-src/test.rb /^ def ClassExample.class_method$/ Clear/p ada-src/2ataspri.adb /^ procedure Clear (Cell : in out TAS_Cell) is$/ Clear/p ada-src/2ataspri.ads /^ procedure Clear (Cell : in out TAS_Cell)/ Cobol_help c-src/etags.c 558 @@ -458,6 +460,7 @@ Condition_Variable/t ada-src/2ataspri.ads /^ type Condition_Variable is privat Condition_Variable/t ada-src/2ataspri.ads /^ type Condition_Variable is$/ Configure pyt-src/server.py /^class Configure(Frame, ControlEdit):$/ ConfirmQuit pyt-src/server.py /^def ConfirmQuit(frame, context):$/ +Constant ruby-src/test1.ruby 26 ControlEdit pyt-src/server.py /^class ControlEdit(Frame):$/ Controls pyt-src/server.py /^class Controls:$/ CopyTextString pas-src/common.pas /^function CopyTextString;(*($/ @@ -939,7 +942,6 @@ Metags c-src/etags.c /^main (int argc, char **argv)$/ Mfail cp-src/fail.C /^main()$/ Mkai-test.pl perl-src/kai-test.pl /^package main;$/ ModuleExample ruby-src/test.rb /^module ModuleExample$/ -ModuleExample.module_class_method ruby-src/test.rb /^ def ModuleExample.module_class_method$/ More_Lisp_Bits c-src/emacs/src/lisp.h 801 MoveLayerAfter lua-src/allegro.lua /^function MoveLayerAfter (this_one)$/ MoveLayerBefore lua-src/allegro.lua /^function MoveLayerBefore (this_one)$/ @@ -2351,6 +2353,7 @@ __str__ pyt-src/server.py /^ def __str__(self):$/ __up c.c 160 _aligned_blocks c-src/emacs/src/gmalloc.c 1004 _aligned_blocks_mutex c-src/emacs/src/gmalloc.c 518 +_bar? ruby-src/test1.ruby /^ def self._bar?(abc)$/ _bytes_free c-src/emacs/src/gmalloc.c 376 _bytes_used c-src/emacs/src/gmalloc.c 374 _chunks_free c-src/emacs/src/gmalloc.c 375 @@ -2620,6 +2623,7 @@ childDidExit objc-src/Subprocess.m /^- childDidExit$/ chunks_free c-src/emacs/src/gmalloc.c 313 chunks_used c-src/emacs/src/gmalloc.c 311 cjava c-src/etags.c 2936 +class_method ruby-src/test.rb /^ def ClassExample.class_method$/ classifyLine php-src/lce_functions.php /^ function classifyLine($line)$/ clear cp-src/conway.hpp /^ void clear(void) { alive = 0; }$/ clear-abbrev-table c-src/abbrev.c /^DEFUN ("clear-abbrev-table", Fclear_abbrev_table, / @@ -2952,6 +2956,7 @@ foo f-src/entry.for /^ character*(*) function foo()$/ foo f-src/entry.strange_suffix /^ character*(*) function foo()$/ foo f-src/entry.strange /^ character*(*) function foo()$/ foo php-src/ptest.php /^foo()$/ +foo! ruby-src/test1.ruby /^ def foo!$/ foobar c-src/c.c /^int foobar() {;}$/ foobar c.c /^extern void foobar (void) __attribute__ ((section / foobar2 c-src/h.h 20 @@ -3450,6 +3455,7 @@ miti html-src/softwarelibero.html /^Sfatiamo alcuni miti$/ modifier_names c-src/emacs/src/keyboard.c 6319 modifier_symbols c-src/emacs/src/keyboard.c 6327 modify_event_symbol c-src/emacs/src/keyboard.c /^modify_event_symbol (ptrdiff_t symbol_num, int mod/ +module_class_method ruby-src/test.rb /^ def ModuleExample.module_class_method$/ module_instance_method ruby-src/test.rb /^ def module_instance_method$/ more_aligned_int c.c 165 morecore_nolock c-src/emacs/src/gmalloc.c /^morecore_nolock (size_t size)$/ @@ -3812,6 +3818,7 @@ quantizing html-src/algrthms.html /^Quantizing the Received$/ questo ../c/c.web 34 quit_char c-src/emacs/src/keyboard.c 192 quit_throw_to_read_char c-src/emacs/src/keyboard.c /^quit_throw_to_read_char (bool from_signal)$/ +qux= ruby-src/test1.ruby /^ def qux=(tee)$/ r0 c-src/sysdep.h 54 r1 c-src/sysdep.h 55 r_alloc c-src/emacs/src/lisp.h /^extern void *r_alloc (void **, size_t) ATTRIBUTE_A/ diff --git a/test/etags/ETAGS.good_1 b/test/etags/ETAGS.good_1 index 52ded46e28a..44ac091066b 100644 --- a/test/etags/ETAGS.good_1 +++ b/test/etags/ETAGS.good_1 @@ -2977,11 +2977,11 @@ class Configure(760,24879 def save(797,26022 def nosave(807,26310 -ruby-src/test.rb,604 +ruby-src/test.rb,637 module ModuleExample1,0 class ClassExample2,21 def instance_method3,44 - def ClassExample.class_method6,121 + def ClassExample.class_methodclass_method6,121 def instance_method_exclamation!9,206 def instance_method_question?12,310 def instance_method_equals=instance_method_equals=15,408 @@ -2995,12 +2995,19 @@ module ModuleExample1,0 def <=>(<=>39,943 def ===(===42,990 def module_instance_method46,1051 - def ModuleExample.module_class_method49,1131 + def ModuleExample.module_class_methodmodule_class_method49,1131 -ruby-src/test1.ruby,37 +ruby-src/test1.ruby,191 class A1,0 def a(2,8 def b(5,38 +module A9,57 + class B10,66 + ABC 11,76 + def foo!13,89 + def self._bar?(_bar?16,111 + def qux=(qux=20,162 +A::Constant Constant26,211 tex-src/testenv.tex,52 \newcommand{\nm}\nm4,77 diff --git a/test/etags/ETAGS.good_2 b/test/etags/ETAGS.good_2 index ea10012669c..8a93e3b0656 100644 --- a/test/etags/ETAGS.good_2 +++ b/test/etags/ETAGS.good_2 @@ -3548,11 +3548,11 @@ class Configure(760,24879 def save(797,26022 def nosave(807,26310 -ruby-src/test.rb,604 +ruby-src/test.rb,637 module ModuleExample1,0 class ClassExample2,21 def instance_method3,44 - def ClassExample.class_method6,121 + def ClassExample.class_methodclass_method6,121 def instance_method_exclamation!9,206 def instance_method_question?12,310 def instance_method_equals=instance_method_equals=15,408 @@ -3566,12 +3566,19 @@ module ModuleExample1,0 def <=>(<=>39,943 def ===(===42,990 def module_instance_method46,1051 - def ModuleExample.module_class_method49,1131 + def ModuleExample.module_class_methodmodule_class_method49,1131 -ruby-src/test1.ruby,37 +ruby-src/test1.ruby,191 class A1,0 def a(2,8 def b(5,38 +module A9,57 + class B10,66 + ABC 11,76 + def foo!13,89 + def self._bar?(_bar?16,111 + def qux=(qux=20,162 +A::Constant Constant26,211 tex-src/testenv.tex,52 \newcommand{\nm}\nm4,77 diff --git a/test/etags/ETAGS.good_3 b/test/etags/ETAGS.good_3 index 3b3650f8fa8..e575b40ab0d 100644 --- a/test/etags/ETAGS.good_3 +++ b/test/etags/ETAGS.good_3 @@ -3321,11 +3321,11 @@ class Configure(760,24879 def save(797,26022 def nosave(807,26310 -ruby-src/test.rb,604 +ruby-src/test.rb,637 module ModuleExample1,0 class ClassExample2,21 def instance_method3,44 - def ClassExample.class_method6,121 + def ClassExample.class_methodclass_method6,121 def instance_method_exclamation!9,206 def instance_method_question?12,310 def instance_method_equals=instance_method_equals=15,408 @@ -3339,12 +3339,19 @@ module ModuleExample1,0 def <=>(<=>39,943 def ===(===42,990 def module_instance_method46,1051 - def ModuleExample.module_class_method49,1131 + def ModuleExample.module_class_methodmodule_class_method49,1131 -ruby-src/test1.ruby,37 +ruby-src/test1.ruby,191 class A1,0 def a(2,8 def b(5,38 +module A9,57 + class B10,66 + ABC 11,76 + def foo!13,89 + def self._bar?(_bar?16,111 + def qux=(qux=20,162 +A::Constant Constant26,211 tex-src/testenv.tex,52 \newcommand{\nm}\nm4,77 diff --git a/test/etags/ETAGS.good_4 b/test/etags/ETAGS.good_4 index 0415c17bff3..28258060517 100644 --- a/test/etags/ETAGS.good_4 +++ b/test/etags/ETAGS.good_4 @@ -3141,11 +3141,11 @@ class Configure(760,24879 def save(797,26022 def nosave(807,26310 -ruby-src/test.rb,604 +ruby-src/test.rb,637 module ModuleExample1,0 class ClassExample2,21 def instance_method3,44 - def ClassExample.class_method6,121 + def ClassExample.class_methodclass_method6,121 def instance_method_exclamation!9,206 def instance_method_question?12,310 def instance_method_equals=instance_method_equals=15,408 @@ -3159,12 +3159,19 @@ module ModuleExample1,0 def <=>(<=>39,943 def ===(===42,990 def module_instance_method46,1051 - def ModuleExample.module_class_method49,1131 + def ModuleExample.module_class_methodmodule_class_method49,1131 -ruby-src/test1.ruby,37 +ruby-src/test1.ruby,191 class A1,0 def a(2,8 def b(5,38 +module A9,57 + class B10,66 + ABC 11,76 + def foo!13,89 + def self._bar?(_bar?16,111 + def qux=(qux=20,162 +A::Constant Constant26,211 tex-src/testenv.tex,52 \newcommand{\nm}\nm4,77 diff --git a/test/etags/ETAGS.good_5 b/test/etags/ETAGS.good_5 index 8dc814e5ac8..35bb353c767 100644 --- a/test/etags/ETAGS.good_5 +++ b/test/etags/ETAGS.good_5 @@ -4056,11 +4056,11 @@ class Configure(760,24879 def save(797,26022 def nosave(807,26310 -ruby-src/test.rb,604 +ruby-src/test.rb,637 module ModuleExample1,0 class ClassExample2,21 def instance_method3,44 - def ClassExample.class_method6,121 + def ClassExample.class_methodclass_method6,121 def instance_method_exclamation!9,206 def instance_method_question?12,310 def instance_method_equals=instance_method_equals=15,408 @@ -4074,12 +4074,19 @@ module ModuleExample1,0 def <=>(<=>39,943 def ===(===42,990 def module_instance_method46,1051 - def ModuleExample.module_class_method49,1131 + def ModuleExample.module_class_methodmodule_class_method49,1131 -ruby-src/test1.ruby,37 +ruby-src/test1.ruby,191 class A1,0 def a(2,8 def b(5,38 +module A9,57 + class B10,66 + ABC 11,76 + def foo!13,89 + def self._bar?(_bar?16,111 + def qux=(qux=20,162 +A::Constant Constant26,211 tex-src/testenv.tex,52 \newcommand{\nm}\nm4,77 diff --git a/test/etags/ETAGS.good_6 b/test/etags/ETAGS.good_6 index 322c1651984..8add300784f 100644 --- a/test/etags/ETAGS.good_6 +++ b/test/etags/ETAGS.good_6 @@ -4056,11 +4056,11 @@ class Configure(760,24879 def save(797,26022 def nosave(807,26310 -ruby-src/test.rb,604 +ruby-src/test.rb,637 module ModuleExample1,0 class ClassExample2,21 def instance_method3,44 - def ClassExample.class_method6,121 + def ClassExample.class_methodclass_method6,121 def instance_method_exclamation!9,206 def instance_method_question?12,310 def instance_method_equals=instance_method_equals=15,408 @@ -4074,12 +4074,19 @@ module ModuleExample1,0 def <=>(<=>39,943 def ===(===42,990 def module_instance_method46,1051 - def ModuleExample.module_class_method49,1131 + def ModuleExample.module_class_methodmodule_class_method49,1131 -ruby-src/test1.ruby,37 +ruby-src/test1.ruby,191 class A1,0 def a(2,8 def b(5,38 +module A9,57 + class B10,66 + ABC 11,76 + def foo!13,89 + def self._bar?(_bar?16,111 + def qux=(qux=20,162 +A::Constant Constant26,211 tex-src/testenv.tex,52 \newcommand{\nm}\nm4,77 diff --git a/test/etags/ruby-src/test1.ruby b/test/etags/ruby-src/test1.ruby index 43b1a14b95e..26b7d538b64 100644 --- a/test/etags/ruby-src/test1.ruby +++ b/test/etags/ruby-src/test1.ruby @@ -5,3 +5,25 @@ class A def b() end end + +module A + class B + ABC = 4 + + def foo! + end + + def self._bar?(abc) + end + + class << self + def qux=(tee) + end + end + end +end + +A::Constant = 5 + +# def foo_in_comment +# end |