diff options
| author | Eli Zaretskii | 2016-02-06 11:08:20 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2016-02-06 11:08:20 +0200 |
| commit | 87ae21858adc173c129ff8dfec8ce74cd82e77be (patch) | |
| tree | 4f1bb96cf27a38ed387746d1bc6e5d6e5bfd3678 | |
| parent | aa35257118a09ff8c90d5dc364e8dc65e2fbd6dd (diff) | |
| download | emacs-87ae21858adc173c129ff8dfec8ce74cd82e77be.tar.gz emacs-87ae21858adc173c129ff8dfec8ce74cd82e77be.zip | |
Extend etags Ruby support for accessors
* lib-src/etags.c (Ruby_functions): Support accessors defined with
parentheses. (Bug#22563)
* test/etags/ruby-src/test1.ru (A::B): Add tests for accessors
defined with parentheses.
* 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 changes in Ruby tests.
| -rw-r--r-- | lib-src/etags.c | 6 | ||||
| -rw-r--r-- | test/etags/CTAGS.good | 8 | ||||
| -rw-r--r-- | test/etags/ETAGS.good_1 | 12 | ||||
| -rw-r--r-- | test/etags/ETAGS.good_2 | 12 | ||||
| -rw-r--r-- | test/etags/ETAGS.good_3 | 12 | ||||
| -rw-r--r-- | test/etags/ETAGS.good_4 | 12 | ||||
| -rw-r--r-- | test/etags/ETAGS.good_5 | 12 | ||||
| -rw-r--r-- | test/etags/ETAGS.good_6 | 12 | ||||
| -rw-r--r-- | test/etags/ruby-src/test1.ru | 6 |
9 files changed, 64 insertions, 28 deletions
diff --git a/lib-src/etags.c b/lib-src/etags.c index 0f5bfa3a951..182cb4cc876 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c | |||
| @@ -4730,8 +4730,12 @@ Ruby_functions (FILE *inf) | |||
| 4730 | if (reader || writer || alias) | 4730 | if (reader || writer || alias) |
| 4731 | { | 4731 | { |
| 4732 | do { | 4732 | do { |
| 4733 | char *np = cp; | 4733 | char *np; |
| 4734 | 4734 | ||
| 4735 | cp = skip_spaces (cp); | ||
| 4736 | if (*cp == '(') | ||
| 4737 | cp = skip_spaces (cp + 1); | ||
| 4738 | np = cp; | ||
| 4735 | cp = skip_name (cp); | 4739 | cp = skip_name (cp); |
| 4736 | if (*np != ':') | 4740 | if (*np != ':') |
| 4737 | continue; | 4741 | continue; |
diff --git a/test/etags/CTAGS.good b/test/etags/CTAGS.good index 58b1db6b0a3..ebde715272a 100644 --- a/test/etags/CTAGS.good +++ b/test/etags/CTAGS.good | |||
| @@ -454,7 +454,7 @@ Condition_Variable/t ada-src/2ataspri.ads /^ type Condition_Variable is privat | |||
| 454 | Condition_Variable/t ada-src/2ataspri.ads /^ type Condition_Variable is$/ | 454 | Condition_Variable/t ada-src/2ataspri.ads /^ type Condition_Variable is$/ |
| 455 | Configure pyt-src/server.py /^class Configure(Frame, ControlEdit):$/ | 455 | Configure pyt-src/server.py /^class Configure(Frame, ControlEdit):$/ |
| 456 | ConfirmQuit pyt-src/server.py /^def ConfirmQuit(frame, context):$/ | 456 | ConfirmQuit pyt-src/server.py /^def ConfirmQuit(frame, context):$/ |
| 457 | Constant ruby-src/test1.ru 38 | 457 | Constant ruby-src/test1.ru 42 |
| 458 | ControlEdit pyt-src/server.py /^class ControlEdit(Frame):$/ | 458 | ControlEdit pyt-src/server.py /^class ControlEdit(Frame):$/ |
| 459 | Controls pyt-src/server.py /^class Controls:$/ | 459 | Controls pyt-src/server.py /^class Controls:$/ |
| 460 | CopyTextString pas-src/common.pas /^function CopyTextString;(*($/ | 460 | CopyTextString pas-src/common.pas /^function CopyTextString;(*($/ |
| @@ -2555,6 +2555,7 @@ bar c-src/c.c /^void bar() {while(0) {}}$/ | |||
| 2555 | bar c.c 143 | 2555 | bar c.c 143 |
| 2556 | bar c-src/h.h 19 | 2556 | bar c-src/h.h 19 |
| 2557 | bar cp-src/x.cc /^XX::bar()$/ | 2557 | bar cp-src/x.cc /^XX::bar()$/ |
| 2558 | bar1 ruby-src/test1.ru /^ attr_reader(:foo1, :bar1, # comment$/ | ||
| 2558 | bar= ruby-src/test1.ru /^ attr_writer :bar,$/ | 2559 | bar= ruby-src/test1.ru /^ attr_writer :bar,$/ |
| 2559 | bas_syn prol-src/natded.prolog /^bas_syn(n(_)).$/ | 2560 | bas_syn prol-src/natded.prolog /^bas_syn(n(_)).$/ |
| 2560 | base c-src/emacs/src/lisp.h 2188 | 2561 | base c-src/emacs/src/lisp.h 2188 |
| @@ -3008,6 +3009,8 @@ foo f-src/entry.strange /^ character*(*) function foo()$/ | |||
| 3008 | foo php-src/ptest.php /^foo()$/ | 3009 | foo php-src/ptest.php /^foo()$/ |
| 3009 | foo ruby-src/test1.ru /^ attr_reader :foo$/ | 3010 | foo ruby-src/test1.ru /^ attr_reader :foo$/ |
| 3010 | foo! ruby-src/test1.ru /^ def foo!$/ | 3011 | foo! ruby-src/test1.ru /^ def foo!$/ |
| 3012 | foo1 ruby-src/test1.ru /^ attr_reader(:foo1, :bar1, # comment$/ | ||
| 3013 | foo2 ruby-src/test1.ru /^ alias_method ( :foo2, #cmmt$/ | ||
| 3011 | foobar c-src/c.c /^int foobar() {;}$/ | 3014 | foobar c-src/c.c /^int foobar() {;}$/ |
| 3012 | foobar c.c /^extern void foobar (void) __attribute__ ((section / | 3015 | foobar c.c /^extern void foobar (void) __attribute__ ((section / |
| 3013 | foobar2 c-src/h.h 20 | 3016 | foobar2 c-src/h.h 20 |
| @@ -3880,7 +3883,8 @@ questo ../c/c.web 34 | |||
| 3880 | quiettest make-src/Makefile /^quiettest:$/ | 3883 | quiettest make-src/Makefile /^quiettest:$/ |
| 3881 | quit_char c-src/emacs/src/keyboard.c 192 | 3884 | quit_char c-src/emacs/src/keyboard.c 192 |
| 3882 | quit_throw_to_read_char c-src/emacs/src/keyboard.c /^quit_throw_to_read_char (bool from_signal)$/ | 3885 | quit_throw_to_read_char c-src/emacs/src/keyboard.c /^quit_throw_to_read_char (bool from_signal)$/ |
| 3883 | qux ruby-src/test1.ru /^ alias_method :qux, :tee, attr_accessor :bogus$/ | 3886 | qux ruby-src/test1.ru /^ alias_method :qux, :tee, attr_accessor(:bogus)/ |
| 3887 | qux1 ruby-src/test1.ru /^ :qux1)$/ | ||
| 3884 | qux= ruby-src/test1.ru /^ def qux=(tee)$/ | 3888 | qux= ruby-src/test1.ru /^ def qux=(tee)$/ |
| 3885 | r0 c-src/sysdep.h 54 | 3889 | r0 c-src/sysdep.h 54 |
| 3886 | r1 c-src/sysdep.h 55 | 3890 | r1 c-src/sysdep.h 55 |
diff --git a/test/etags/ETAGS.good_1 b/test/etags/ETAGS.good_1 index 90bbe774f05..d2550863428 100644 --- a/test/etags/ETAGS.good_1 +++ b/test/etags/ETAGS.good_1 | |||
| @@ -3061,7 +3061,7 @@ module ModuleExample1,0 | |||
| 3061 | def module_instance_method46,1051 | 3061 | def module_instance_method46,1051 |
| 3062 | def ModuleExample.module_class_methodmodule_class_method49,1131 | 3062 | def ModuleExample.module_class_methodmodule_class_method49,1131 |
| 3063 | 3063 | ||
| 3064 | ruby-src/test1.ru,785 | 3064 | ruby-src/test1.ru,935 |
| 3065 | class A1,0 | 3065 | class A1,0 |
| 3066 | def a(2,8 | 3066 | def a(2,8 |
| 3067 | def b(5,38 | 3067 | def b(5,38 |
| @@ -3084,9 +3084,13 @@ module A9,57 | |||
| 3084 | attr_accessor :teetee31,382 | 3084 | attr_accessor :teetee31,382 |
| 3085 | attr_accessor :teetee=31,382 | 3085 | attr_accessor :teetee=31,382 |
| 3086 | alias_method :qux,qux32,405 | 3086 | alias_method :qux,qux32,405 |
| 3087 | alias_method :xyz,xyz33,455 | 3087 | alias_method :xyz,xyz33,456 |
| 3088 | :tee ; attr_reader :subtlesubtle34,478 | 3088 | :tee ; attr_reader :subtlesubtle34,479 |
| 3089 | A::Constant Constant38,533 | 3089 | attr_reader(:foo1,foo135,523 |
| 3090 | attr_reader(:foo1, :bar1,bar135,523 | ||
| 3091 | :qux1)qux136,563 | ||
| 3092 | alias_method ( :foo2,foo237,586 | ||
| 3093 | A::Constant Constant42,655 | ||
| 3090 | 3094 | ||
| 3091 | tex-src/testenv.tex,52 | 3095 | tex-src/testenv.tex,52 |
| 3092 | \newcommand{\nm}\nm4,77 | 3096 | \newcommand{\nm}\nm4,77 |
diff --git a/test/etags/ETAGS.good_2 b/test/etags/ETAGS.good_2 index d774bb1b190..9eb1d4297c8 100644 --- a/test/etags/ETAGS.good_2 +++ b/test/etags/ETAGS.good_2 | |||
| @@ -3631,7 +3631,7 @@ module ModuleExample1,0 | |||
| 3631 | def module_instance_method46,1051 | 3631 | def module_instance_method46,1051 |
| 3632 | def ModuleExample.module_class_methodmodule_class_method49,1131 | 3632 | def ModuleExample.module_class_methodmodule_class_method49,1131 |
| 3633 | 3633 | ||
| 3634 | ruby-src/test1.ru,785 | 3634 | ruby-src/test1.ru,935 |
| 3635 | class A1,0 | 3635 | class A1,0 |
| 3636 | def a(2,8 | 3636 | def a(2,8 |
| 3637 | def b(5,38 | 3637 | def b(5,38 |
| @@ -3654,9 +3654,13 @@ module A9,57 | |||
| 3654 | attr_accessor :teetee31,382 | 3654 | attr_accessor :teetee31,382 |
| 3655 | attr_accessor :teetee=31,382 | 3655 | attr_accessor :teetee=31,382 |
| 3656 | alias_method :qux,qux32,405 | 3656 | alias_method :qux,qux32,405 |
| 3657 | alias_method :xyz,xyz33,455 | 3657 | alias_method :xyz,xyz33,456 |
| 3658 | :tee ; attr_reader :subtlesubtle34,478 | 3658 | :tee ; attr_reader :subtlesubtle34,479 |
| 3659 | A::Constant Constant38,533 | 3659 | attr_reader(:foo1,foo135,523 |
| 3660 | attr_reader(:foo1, :bar1,bar135,523 | ||
| 3661 | :qux1)qux136,563 | ||
| 3662 | alias_method ( :foo2,foo237,586 | ||
| 3663 | A::Constant Constant42,655 | ||
| 3660 | 3664 | ||
| 3661 | tex-src/testenv.tex,52 | 3665 | tex-src/testenv.tex,52 |
| 3662 | \newcommand{\nm}\nm4,77 | 3666 | \newcommand{\nm}\nm4,77 |
diff --git a/test/etags/ETAGS.good_3 b/test/etags/ETAGS.good_3 index e3855a59309..1f5a34272e3 100644 --- a/test/etags/ETAGS.good_3 +++ b/test/etags/ETAGS.good_3 | |||
| @@ -3408,7 +3408,7 @@ module ModuleExample1,0 | |||
| 3408 | def module_instance_method46,1051 | 3408 | def module_instance_method46,1051 |
| 3409 | def ModuleExample.module_class_methodmodule_class_method49,1131 | 3409 | def ModuleExample.module_class_methodmodule_class_method49,1131 |
| 3410 | 3410 | ||
| 3411 | ruby-src/test1.ru,785 | 3411 | ruby-src/test1.ru,935 |
| 3412 | class A1,0 | 3412 | class A1,0 |
| 3413 | def a(2,8 | 3413 | def a(2,8 |
| 3414 | def b(5,38 | 3414 | def b(5,38 |
| @@ -3431,9 +3431,13 @@ module A9,57 | |||
| 3431 | attr_accessor :teetee31,382 | 3431 | attr_accessor :teetee31,382 |
| 3432 | attr_accessor :teetee=31,382 | 3432 | attr_accessor :teetee=31,382 |
| 3433 | alias_method :qux,qux32,405 | 3433 | alias_method :qux,qux32,405 |
| 3434 | alias_method :xyz,xyz33,455 | 3434 | alias_method :xyz,xyz33,456 |
| 3435 | :tee ; attr_reader :subtlesubtle34,478 | 3435 | :tee ; attr_reader :subtlesubtle34,479 |
| 3436 | A::Constant Constant38,533 | 3436 | attr_reader(:foo1,foo135,523 |
| 3437 | attr_reader(:foo1, :bar1,bar135,523 | ||
| 3438 | :qux1)qux136,563 | ||
| 3439 | alias_method ( :foo2,foo237,586 | ||
| 3440 | A::Constant Constant42,655 | ||
| 3437 | 3441 | ||
| 3438 | tex-src/testenv.tex,52 | 3442 | tex-src/testenv.tex,52 |
| 3439 | \newcommand{\nm}\nm4,77 | 3443 | \newcommand{\nm}\nm4,77 |
diff --git a/test/etags/ETAGS.good_4 b/test/etags/ETAGS.good_4 index dbae59bd59e..b8a3d9de6db 100644 --- a/test/etags/ETAGS.good_4 +++ b/test/etags/ETAGS.good_4 | |||
| @@ -3225,7 +3225,7 @@ module ModuleExample1,0 | |||
| 3225 | def module_instance_method46,1051 | 3225 | def module_instance_method46,1051 |
| 3226 | def ModuleExample.module_class_methodmodule_class_method49,1131 | 3226 | def ModuleExample.module_class_methodmodule_class_method49,1131 |
| 3227 | 3227 | ||
| 3228 | ruby-src/test1.ru,785 | 3228 | ruby-src/test1.ru,935 |
| 3229 | class A1,0 | 3229 | class A1,0 |
| 3230 | def a(2,8 | 3230 | def a(2,8 |
| 3231 | def b(5,38 | 3231 | def b(5,38 |
| @@ -3248,9 +3248,13 @@ module A9,57 | |||
| 3248 | attr_accessor :teetee31,382 | 3248 | attr_accessor :teetee31,382 |
| 3249 | attr_accessor :teetee=31,382 | 3249 | attr_accessor :teetee=31,382 |
| 3250 | alias_method :qux,qux32,405 | 3250 | alias_method :qux,qux32,405 |
| 3251 | alias_method :xyz,xyz33,455 | 3251 | alias_method :xyz,xyz33,456 |
| 3252 | :tee ; attr_reader :subtlesubtle34,478 | 3252 | :tee ; attr_reader :subtlesubtle34,479 |
| 3253 | A::Constant Constant38,533 | 3253 | attr_reader(:foo1,foo135,523 |
| 3254 | attr_reader(:foo1, :bar1,bar135,523 | ||
| 3255 | :qux1)qux136,563 | ||
| 3256 | alias_method ( :foo2,foo237,586 | ||
| 3257 | A::Constant Constant42,655 | ||
| 3254 | 3258 | ||
| 3255 | tex-src/testenv.tex,52 | 3259 | tex-src/testenv.tex,52 |
| 3256 | \newcommand{\nm}\nm4,77 | 3260 | \newcommand{\nm}\nm4,77 |
diff --git a/test/etags/ETAGS.good_5 b/test/etags/ETAGS.good_5 index 9ea77977ab6..9e3b258eabc 100644 --- a/test/etags/ETAGS.good_5 +++ b/test/etags/ETAGS.good_5 | |||
| @@ -4142,7 +4142,7 @@ module ModuleExample1,0 | |||
| 4142 | def module_instance_method46,1051 | 4142 | def module_instance_method46,1051 |
| 4143 | def ModuleExample.module_class_methodmodule_class_method49,1131 | 4143 | def ModuleExample.module_class_methodmodule_class_method49,1131 |
| 4144 | 4144 | ||
| 4145 | ruby-src/test1.ru,785 | 4145 | ruby-src/test1.ru,935 |
| 4146 | class A1,0 | 4146 | class A1,0 |
| 4147 | def a(2,8 | 4147 | def a(2,8 |
| 4148 | def b(5,38 | 4148 | def b(5,38 |
| @@ -4165,9 +4165,13 @@ module A9,57 | |||
| 4165 | attr_accessor :teetee31,382 | 4165 | attr_accessor :teetee31,382 |
| 4166 | attr_accessor :teetee=31,382 | 4166 | attr_accessor :teetee=31,382 |
| 4167 | alias_method :qux,qux32,405 | 4167 | alias_method :qux,qux32,405 |
| 4168 | alias_method :xyz,xyz33,455 | 4168 | alias_method :xyz,xyz33,456 |
| 4169 | :tee ; attr_reader :subtlesubtle34,478 | 4169 | :tee ; attr_reader :subtlesubtle34,479 |
| 4170 | A::Constant Constant38,533 | 4170 | attr_reader(:foo1,foo135,523 |
| 4171 | attr_reader(:foo1, :bar1,bar135,523 | ||
| 4172 | :qux1)qux136,563 | ||
| 4173 | alias_method ( :foo2,foo237,586 | ||
| 4174 | A::Constant Constant42,655 | ||
| 4171 | 4175 | ||
| 4172 | tex-src/testenv.tex,52 | 4176 | tex-src/testenv.tex,52 |
| 4173 | \newcommand{\nm}\nm4,77 | 4177 | \newcommand{\nm}\nm4,77 |
diff --git a/test/etags/ETAGS.good_6 b/test/etags/ETAGS.good_6 index 7420a41b108..f5e0ad4407f 100644 --- a/test/etags/ETAGS.good_6 +++ b/test/etags/ETAGS.good_6 | |||
| @@ -4142,7 +4142,7 @@ module ModuleExample1,0 | |||
| 4142 | def module_instance_method46,1051 | 4142 | def module_instance_method46,1051 |
| 4143 | def ModuleExample.module_class_methodmodule_class_method49,1131 | 4143 | def ModuleExample.module_class_methodmodule_class_method49,1131 |
| 4144 | 4144 | ||
| 4145 | ruby-src/test1.ru,785 | 4145 | ruby-src/test1.ru,935 |
| 4146 | class A1,0 | 4146 | class A1,0 |
| 4147 | def a(2,8 | 4147 | def a(2,8 |
| 4148 | def b(5,38 | 4148 | def b(5,38 |
| @@ -4165,9 +4165,13 @@ module A9,57 | |||
| 4165 | attr_accessor :teetee31,382 | 4165 | attr_accessor :teetee31,382 |
| 4166 | attr_accessor :teetee=31,382 | 4166 | attr_accessor :teetee=31,382 |
| 4167 | alias_method :qux,qux32,405 | 4167 | alias_method :qux,qux32,405 |
| 4168 | alias_method :xyz,xyz33,455 | 4168 | alias_method :xyz,xyz33,456 |
| 4169 | :tee ; attr_reader :subtlesubtle34,478 | 4169 | :tee ; attr_reader :subtlesubtle34,479 |
| 4170 | A::Constant Constant38,533 | 4170 | attr_reader(:foo1,foo135,523 |
| 4171 | attr_reader(:foo1, :bar1,bar135,523 | ||
| 4172 | :qux1)qux136,563 | ||
| 4173 | alias_method ( :foo2,foo237,586 | ||
| 4174 | A::Constant Constant42,655 | ||
| 4171 | 4175 | ||
| 4172 | tex-src/testenv.tex,52 | 4176 | tex-src/testenv.tex,52 |
| 4173 | \newcommand{\nm}\nm4,77 | 4177 | \newcommand{\nm}\nm4,77 |
diff --git a/test/etags/ruby-src/test1.ru b/test/etags/ruby-src/test1.ru index 93888c1040b..eafaec6248b 100644 --- a/test/etags/ruby-src/test1.ru +++ b/test/etags/ruby-src/test1.ru | |||
| @@ -29,9 +29,13 @@ module A | |||
| 29 | :baz, | 29 | :baz, |
| 30 | :more | 30 | :more |
| 31 | attr_accessor :tee | 31 | attr_accessor :tee |
| 32 | alias_method :qux, :tee, attr_accessor :bogus | 32 | alias_method :qux, :tee, attr_accessor(:bogus) |
| 33 | alias_method :xyz, | 33 | alias_method :xyz, |
| 34 | :tee ; attr_reader :subtle | 34 | :tee ; attr_reader :subtle |
| 35 | attr_reader(:foo1, :bar1, # comment | ||
| 36 | :qux1) | ||
| 37 | alias_method ( :foo2, #cmmt | ||
| 38 | :bar2) | ||
| 35 | end | 39 | end |
| 36 | end | 40 | end |
| 37 | 41 | ||