* lib-src/etags.c (Ruby_suffixes): Add ".ruby".
(Ruby_functions): Support "module" and overloaded operators.
(Ruby_help): Mention "module".
* test/etags/ruby-src/test.rb:
* test/etags/ruby-src/test1.ruby: New files.
* test/etags/Makefile (RBSRC): New tests.
(SRCS): Add ${RBSRC}.
* 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 new Ruby tests.
* doc/man/etags.1: Mention Ruby support.
* etc/NEWS: Mention Ruby support.
\&. Both forms of the program understand
the syntax of C, Objective C, C++, Java, Fortran, Ada, Cobol, Erlang,
Forth, HTML, LaTeX, Emacs Lisp/Common Lisp, Lua, Makefile, Pascal, Perl,
-PHP, PostScript, Python, Prolog, Scheme and
+Ruby, PHP, PostScript, Python, Prolog, Scheme and
most assembler\-like syntaxes.
Both forms read the files specified on the command line, and write a tag
table (defaults: \fBTAGS\fP for \fBetags\fP, \fBtags\fP for
** Tearoff menus and detachable toolbars for Gtk+ has been removed.
Those features have been deprecated in Gtk+ for a long time.
-** Miscellaneous
+** Etags
*** etags no longer qualifies class members by default.
+
By default, `etags' will not qualify class members for C-like
object-oriented languages with their class names and namespaces, and
will remove qualifications used explicitly in the code from the tag
(`xref-find-definitions'); if so, you can use `C-u M-.' to specify the
qualified names by hand.
+*** New language Ruby
+
+Names of modules, classes, methods, and functions are tagged.
+Overloaded operators are also tagged.
+
\f
* Changes in Emacs 25.1 on Non-Free Operating Systems
generate a tag.";
static const char *Ruby_suffixes [] =
- { "rb", NULL };
+ { "rb", "ruby", NULL };
static const char Ruby_help [] =
- "In Ruby code, 'def' or 'class' at the beginning of a line\n\
-generate a tag.";
+ "In Ruby code, 'def' or 'class' or 'module' at the beginning of\n\
+a line generate a tag.";
/* Can't do the `SCM' or `scm' prefix with a version number. */
static const char *Scheme_suffixes [] =
LOOP_ON_INPUT_LINES (inf, lb, cp)
{
cp = skip_spaces (cp);
- if (LOOKING_AT (cp, "def") || LOOKING_AT (cp, "class"))
+ if (LOOKING_AT (cp, "def")
+ || LOOKING_AT (cp, "class")
+ || LOOKING_AT (cp, "module"))
{
char *name = cp;
- while (!notinname (*cp))
+ /* Ruby method names can end in a '='. Also, operator overloading can
+ define operators whose names include '='. */
+ while (!notinname (*cp) || *cp == '=')
cp++;
- make_tag(name, cp -name, true,
- lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
+ make_tag (name, cp - name, true,
+ lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
}
}
}
($string,$flag,@string,@temp,@last perl-src/yagrip.pl 40
(a-forth-constant forth-src/test-forth.fth /^constant (a-forth-constant$/
(another-forth-word forth-src/test-forth.fth /^: (another-forth-word) ( -- )$/
++ ruby-src/test.rb /^ def +(y)$/
+ tex-src/texinfo.tex /^\\def+{{\\tt \\char 43}}$/
/.notdef ps-src/rfc1245.ps /^\/.notdef \/.notdef \/.notdef \/.notdef \/.notdef \/.not/
/.notdef ps-src/rfc1245.ps /^\/.notdef \/.notdef \/.notdef \/.notdef \/.notdef \/.not/
/yen ps-src/rfc1245.ps /^\/yen \/.notdef \/.notdef \/.notdef \/.notdef \/.notdef /
:a-forth-dictionary-entry forth-src/test-forth.fth /^create :a-forth-dictionary-entry$/
< tex-src/texinfo.tex /^\\def<{{\\tt \\less}}$/
+<< ruby-src/test.rb /^ def <<(y)$/
+<= ruby-src/test.rb /^ def <=(y)$/
+<=> ruby-src/test.rb /^ def <=>(y)$/
= tex-src/texinfo.tex /^\\global\\let\\section = \\numberedsec$/
= tex-src/texinfo.tex /^\\global\\let\\subsection = \\numberedsubsec$/
= tex-src/texinfo.tex /^\\global\\let\\subsubsection = \\numberedsubsubsec$/
= tex-src/texinfo.tex /^\\global\\let\\subsubsection = \\numberedsubsubsec$/
= tex-src/texinfo.tex /^\\global\\def={{\\tt \\char 61}}}$/
=/f ada-src/etags-test-for.ada /^ function "=" (L, R : System.Address) return Boo/
+== ruby-src/test.rb /^ def ==(y)$/
+=== ruby-src/test.rb /^ def ===(y)$/
=\indexdummyfont tex-src/texinfo.tex /^\\let\\cite=\\indexdummyfont$/
=\relax tex-src/texinfo.tex /^\\let\\chapter=\\relax$/
=\relax tex-src/texinfo.tex /^\\let\\section=\\relax$/
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$/
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) \\$/
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.singleton_class_method ruby-src/test.rb /^ def ClassExample.singleton_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
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.singleton_module_method ruby-src/test.rb /^ def ModuleExample.singleton_module_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)$/
Yacc_help c-src/etags.c 693
Yacc_suffixes c-src/etags.c 691
Z c-src/h.h 100
+[] ruby-src/test.rb /^ def [](y)$/
+[]= ruby-src/test.rb /^ def []=(y, val)$/
\ tex-src/texinfo.tex /^\\def\\ {{\\fontdimen2\\font=\\tclosesave{} }}%$/
\ tex-src/texinfo.tex /^\\gdef\\sepspaces{\\def {\\ }}}$/
\' tex-src/texinfo.tex /^\\def\\'{{'}}$/
_realloc c-src/emacs/src/gmalloc.c /^_realloc (void *ptr, size_t size)$/
_realloc_internal c-src/emacs/src/gmalloc.c /^_realloc_internal (void *ptr, size_t size)$/
_realloc_internal_nolock c-src/emacs/src/gmalloc.c /^_realloc_internal_nolock (void *ptr, size_t size)$/
+` ruby-src/test.rb /^ def `(command)$/
a c.c 152
a c.c 180
a c.c /^a()$/
a c-src/h.h 40
a c-src/h.h 103
a cp-src/c.C 132
+a ruby-src/test1.ruby /^ def a()$/
a-forth-constant! forth-src/test-forth.fth /^99 constant a-forth-constant!$/
a-forth-value? forth-src/test-forth.fth /^55 value a-forth-value?$/
a-forth-word forth-src/test-forth.fth /^: a-forth-word ( a b c -- a*b+c ) + * ;$/
b c-src/h.h 103
b c-src/h.h 104
b cp-src/c.C 132
+b ruby-src/test1.ruby /^ def b()$/
backslash=0 tex-src/texinfo.tex /^\\let\\indexbackslash=0 %overridden during \\printin/
bar c-src/c.c /^void bar() {while(0) {}}$/
bar c.c 143
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 class_method$/
+class_method_equals= ruby-src/test.rb /^ def class_method_equals=$/
+class_method_exclamation! ruby-src/test.rb /^ def class_method_exclamation!$/
+class_method_question? ruby-src/test.rb /^ def class_method_question?$/
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, /
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_method ruby-src/test.rb /^ def module_method$/
more_aligned_int c.c 165
morecore_nolock c-src/emacs/src/gmalloc.c /^morecore_nolock (size_t size)$/
morecore_recursing c-src/emacs/src/gmalloc.c 604
def save(\7f797,26022
def nosave(\7f807,26310
\f
+ruby-src/test.rb,594
+module ModuleExample\7f1,0
+ class ClassExample\7f2,21
+ def class_method\7f3,44
+ def ClassExample.singleton_class_method\7f6,116
+ def class_method_exclamation!\7f9,221
+ def class_method_question?\7f12,319
+ def class_method_equals=\7fclass_method_equals=\ 115,411
+ def `(\7f18,499
+ def +(\7f21,589
+ def [](\7f24,637
+ def []=(\7f[]=\ 127,687
+ def <<(\7f30,749
+ def ==(\7f==\ 133,799
+ def <=(\7f<=\ 136,869
+ def <=>(\7f<=>\ 139,940
+ def ===(\7f===\ 142,987
+ def module_method\7f46,1048
+ def ModuleExample.singleton_module_method\7f49,1110
+\f
+ruby-src/test1.ruby,37
+class A\7f1,0
+ def a(\7f2,8
+ def b(\7f5,38
+\f
tex-src/testenv.tex,52
\newcommand{\nm}\7f\nm\ 14,77
\section{blah}\7fblah\ 18,139
def save(\7f797,26022
def nosave(\7f807,26310
\f
+ruby-src/test.rb,594
+module ModuleExample\7f1,0
+ class ClassExample\7f2,21
+ def class_method\7f3,44
+ def ClassExample.singleton_class_method\7f6,116
+ def class_method_exclamation!\7f9,221
+ def class_method_question?\7f12,319
+ def class_method_equals=\7fclass_method_equals=\ 115,411
+ def `(\7f18,499
+ def +(\7f21,589
+ def [](\7f24,637
+ def []=(\7f[]=\ 127,687
+ def <<(\7f30,749
+ def ==(\7f==\ 133,799
+ def <=(\7f<=\ 136,869
+ def <=>(\7f<=>\ 139,940
+ def ===(\7f===\ 142,987
+ def module_method\7f46,1048
+ def ModuleExample.singleton_module_method\7f49,1110
+\f
+ruby-src/test1.ruby,37
+class A\7f1,0
+ def a(\7f2,8
+ def b(\7f5,38
+\f
tex-src/testenv.tex,52
\newcommand{\nm}\7f\nm\ 14,77
\section{blah}\7fblah\ 18,139
def save(\7f797,26022
def nosave(\7f807,26310
\f
+ruby-src/test.rb,594
+module ModuleExample\7f1,0
+ class ClassExample\7f2,21
+ def class_method\7f3,44
+ def ClassExample.singleton_class_method\7f6,116
+ def class_method_exclamation!\7f9,221
+ def class_method_question?\7f12,319
+ def class_method_equals=\7fclass_method_equals=\ 115,411
+ def `(\7f18,499
+ def +(\7f21,589
+ def [](\7f24,637
+ def []=(\7f[]=\ 127,687
+ def <<(\7f30,749
+ def ==(\7f==\ 133,799
+ def <=(\7f<=\ 136,869
+ def <=>(\7f<=>\ 139,940
+ def ===(\7f===\ 142,987
+ def module_method\7f46,1048
+ def ModuleExample.singleton_module_method\7f49,1110
+\f
+ruby-src/test1.ruby,37
+class A\7f1,0
+ def a(\7f2,8
+ def b(\7f5,38
+\f
tex-src/testenv.tex,52
\newcommand{\nm}\7f\nm\ 14,77
\section{blah}\7fblah\ 18,139
def save(\7f797,26022
def nosave(\7f807,26310
\f
+ruby-src/test.rb,594
+module ModuleExample\7f1,0
+ class ClassExample\7f2,21
+ def class_method\7f3,44
+ def ClassExample.singleton_class_method\7f6,116
+ def class_method_exclamation!\7f9,221
+ def class_method_question?\7f12,319
+ def class_method_equals=\7fclass_method_equals=\ 115,411
+ def `(\7f18,499
+ def +(\7f21,589
+ def [](\7f24,637
+ def []=(\7f[]=\ 127,687
+ def <<(\7f30,749
+ def ==(\7f==\ 133,799
+ def <=(\7f<=\ 136,869
+ def <=>(\7f<=>\ 139,940
+ def ===(\7f===\ 142,987
+ def module_method\7f46,1048
+ def ModuleExample.singleton_module_method\7f49,1110
+\f
+ruby-src/test1.ruby,37
+class A\7f1,0
+ def a(\7f2,8
+ def b(\7f5,38
+\f
tex-src/testenv.tex,52
\newcommand{\nm}\7f\nm\ 14,77
\section{blah}\7fblah\ 18,139
def save(\7f797,26022
def nosave(\7f807,26310
\f
+ruby-src/test.rb,594
+module ModuleExample\7f1,0
+ class ClassExample\7f2,21
+ def class_method\7f3,44
+ def ClassExample.singleton_class_method\7f6,116
+ def class_method_exclamation!\7f9,221
+ def class_method_question?\7f12,319
+ def class_method_equals=\7fclass_method_equals=\ 115,411
+ def `(\7f18,499
+ def +(\7f21,589
+ def [](\7f24,637
+ def []=(\7f[]=\ 127,687
+ def <<(\7f30,749
+ def ==(\7f==\ 133,799
+ def <=(\7f<=\ 136,869
+ def <=>(\7f<=>\ 139,940
+ def ===(\7f===\ 142,987
+ def module_method\7f46,1048
+ def ModuleExample.singleton_module_method\7f49,1110
+\f
+ruby-src/test1.ruby,37
+class A\7f1,0
+ def a(\7f2,8
+ def b(\7f5,38
+\f
tex-src/testenv.tex,52
\newcommand{\nm}\7f\nm\ 14,77
\section{blah}\7fblah\ 18,139
def save(\7f797,26022
def nosave(\7f807,26310
\f
+ruby-src/test.rb,594
+module ModuleExample\7f1,0
+ class ClassExample\7f2,21
+ def class_method\7f3,44
+ def ClassExample.singleton_class_method\7f6,116
+ def class_method_exclamation!\7f9,221
+ def class_method_question?\7f12,319
+ def class_method_equals=\7fclass_method_equals=\ 115,411
+ def `(\7f18,499
+ def +(\7f21,589
+ def [](\7f24,637
+ def []=(\7f[]=\ 127,687
+ def <<(\7f30,749
+ def ==(\7f==\ 133,799
+ def <=(\7f<=\ 136,869
+ def <=>(\7f<=>\ 139,940
+ def ===(\7f===\ 142,987
+ def module_method\7f46,1048
+ def ModuleExample.singleton_module_method\7f49,1110
+\f
+ruby-src/test1.ruby,37
+class A\7f1,0
+ def a(\7f2,8
+ def b(\7f5,38
+\f
tex-src/testenv.tex,52
\newcommand{\nm}\7f\nm\ 14,77
\section{blah}\7fblah\ 18,139
PSSRC=$(addprefix ./ps-src/,rfc1245.ps)
PROLSRC=$(addprefix ./prol-src/,ordsets.prolog natded.prolog)
PYTSRC=$(addprefix ./pyt-src/,server.py)
+RBSRC=$(addprefix ./ruby-src/,test.rb test1.ruby)
TEXSRC=$(addprefix ./tex-src/,testenv.tex gzip.texi texinfo.tex nonewline.tex)
YSRC=$(addprefix ./y-src/,parse.y parse.c atest.y cccp.c cccp.y)
SRCS=${ADASRC} ${ASRC} ${CSRC} ${CPSRC} ${ELSRC} ${ERLSRC} ${FSRC}\
${FORTHSRC} ${HTMLSRC} ${JAVASRC} ${LUASRC} ${MAKESRC} ${OBJCSRC}\
${OBJCPPSRC} ${PASSRC} ${PHPSRC} ${PERLSRC} ${PSSRC} ${PROLSRC} ${PYTSRC}\
- ${TEXSRC} ${YSRC}
+ ${RBSRC} ${TEXSRC} ${YSRC}
NONSRCS=./f-src/entry.strange ./erl-src/lists.erl ./cp-src/clheir.hpp.gz
ETAGS_PROG=../../lib-src/etags
--- /dev/null
+module ModuleExample
+ class ClassExample
+ def class_method
+ puts "in class_method"
+ end
+ def ClassExample.singleton_class_method
+ puts "in singleton_class_method"
+ end
+ def class_method_exclamation!
+ puts "in class_method_exclamation!"
+ end
+ def class_method_question?
+ puts "in class_method_question?"
+ end
+ def class_method_equals=
+ puts "in class_method_equals="
+ end
+ def `(command)
+ return "just testing a backquote override"
+ end
+ def +(y)
+ @x + y
+ end
+ def [](y)
+ @ary[y]
+ end
+ def []=(y, val)
+ @ary[y] = val
+ end
+ def <<(y)
+ @x << y
+ end
+ def ==(y)
+ @ary.length == y.ary.length
+ end
+ def <=(y)
+ '@ary.length < y.ary.length'
+ end
+ def <=>(y)
+ nil
+ end
+ def ===(y)
+ self == y
+ end
+ end
+ def module_method
+ puts "in module_method"
+ end
+ def ModuleExample.singleton_module_method
+ puts "in singleton_module_method"
+ end
+end
+
+ModuleExample::ClassExample.singleton_class_method
--- /dev/null
+class A
+ def a()
+ super(" do ")
+ end
+ def b()
+ end
+end