unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: 22241@debbugs.gnu.org
Subject: bug#22241: 25.0.50; etags Ruby parser problems
Date: Sat, 23 Jan 2016 18:38:06 +0200	[thread overview]
Message-ID: <83si1o45g1.fsf@gnu.org> (raw)
In-Reply-To: <86r3i9hnbt.fsf@yandex.ru> (message from Dmitry Gutov on Sat, 26 Dec 2015 05:59:34 +0200)

> From: Dmitry Gutov <dgutov@yandex.ru>
> Date: Sat, 26 Dec 2015 05:59:34 +0200
> 
> It's great that we've incorporated some Ruby support, but it has some
> apparent problems:

I don't speak Ruby.  So please give a more detailed spec for the
features you want added.  I wrote some questions below, but I'm quite
sure there are more questions I should ask, but don't know about.  So
please provide as complete specification for each feature as you
possibly can, TIA.

> - Constants are not indexed.

What is the full syntax of a "constant"?  Is it just

  IDENTIFIER "=" INTEGER-NUMBER

?  Is whitespace significant?  What about newlines?

> - Class methods (def self.foo) are given the wrong name ("self."
>   shouldn't be included).

Is it enough to remove a single "self.", case-sensitive, at the
beginning of an identifier?  Can there be more than one, like
"self.self.SOMETHING"?  Your other example, i.e.

  def ModuleExample.singleton_module_method

indicates that anything up to and including the period should be
removed, is that correct?  Is there only one, or can there be many?
Should they all be removed for an unqualified name?

> - "class << self" blocks are given a separate entry.

What should be done instead?  Can't a class be named "<<"?

> - Qualified tag names are never generated.

(Etags never promised qualified names except for C and derived
languages, and also in Java.)

How to know when a module's or a class's scope ends?  Is it enough to
count "end" lines?  Can I assume that "end" will always appear by
itself on a line?  Can I disregard indentation of "end" (and of
everything else) when I determine where a scope begins and ends?

> A
> A::B
> A::B::ABC
> A::B#foo!
> A::B.bar?
> A::B.qux=

Why did 'foo!' get a '#' instead of a '.', as for '_bar'?  Why doesn't
"class << self" count as a class scope, and add something to qualified
names?

> Lastly, it would be great if the parser recognized some built-in
> code-generating methods. Example:
> 
> def A
>   attr_reader :foo
>   attr_writer :bar
>   attr_accessor :tee
>   alias_method :qux, :tee
> end
> 
> should become (the unqualified version):
> 
> A
> foo
> bar=
> tee
> tee=
> qux
> 
> All attr_* methods can take a variable number of arguments. The parser
> should take each argument, check that it's a symbol and not a variable
> (starts with :), and if so, record the corresponding method name.

Why did 'bar' and 'tee' git a '=' appended?  Are there any other such
"append rules"?





  parent reply	other threads:[~2016-01-23 16:38 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-26  3:59 bug#22241: 25.0.50; etags Ruby parser problems Dmitry Gutov
2015-12-26  4:13 ` Dmitry Gutov
2015-12-26  4:34 ` Dmitry Gutov
2016-01-23 16:38 ` Eli Zaretskii [this message]
2016-01-23 18:23   ` Dmitry Gutov
2016-01-23 18:59     ` Eli Zaretskii
2016-01-23 19:29       ` Dmitry Gutov
2016-01-23 20:48         ` Eli Zaretskii
2016-01-23 21:43           ` Dmitry Gutov
2016-01-24 15:44             ` Eli Zaretskii
2016-01-30 12:21               ` Eli Zaretskii
2016-01-30 22:06                 ` Dmitry Gutov
2016-01-31  3:37                   ` Eli Zaretskii
2016-01-31  5:43                     ` Dmitry Gutov
2016-01-31 18:11                       ` Eli Zaretskii
2016-02-01  8:40                         ` Dmitry Gutov
2016-02-02 18:16                           ` Eli Zaretskii
2016-02-02 19:59                             ` Dmitry Gutov
2016-02-03 16:26                               ` Eli Zaretskii
2016-02-03 23:21                                 ` Dmitry Gutov
2016-02-04  3:43                                   ` Eli Zaretskii
2016-02-04  8:24                                     ` Dmitry Gutov
2016-02-04 17:24                                       ` Eli Zaretskii
2016-02-04 20:06                                         ` Dmitry Gutov
2016-01-31 18:01                     ` Eli Zaretskii
2016-02-01  8:24                       ` Dmitry Gutov
2016-02-02 18:13                         ` Eli Zaretskii
2016-01-30 10:52     ` Eli Zaretskii
2016-01-30 16:43       ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83si1o45g1.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=22241@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).