all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: emacs-devel@gnu.org, Eli Zaretskii <eliz@gnu.org>
Subject: Re: [Emacs-diffs] emacs-25 504696d: Etags: yet another improvement in Ruby tags
Date: Thu, 4 Feb 2016 02:46:45 +0300	[thread overview]
Message-ID: <56B29165.3040404@yandex.ru> (raw)
In-Reply-To: <E1aR0FM-0000mG-Up@vcs.savannah.gnu.org>

On 02/03/2016 07:25 PM, Eli Zaretskii wrote:

> --- a/test/etags/ruby-src/test1.ru
> +++ b/test/etags/ruby-src/test1.ru
> @@ -24,10 +24,14 @@ module A
>       end
>       def X

Just noticed this. attr_X calls will not, as a rule, be inside a method 
definition (which is what 'def X' is).

If an attr_X call is inside a method definition, we're unlikely to be 
able to make much sense of it. Most likely, the arguments will be local 
variables, not Symbol literals. It's also likely that the target of this 
call in that kind of situation won't be the current class.

Anyway, the example shouldn't put attr_X calls inside a method 
definition, or it gives an impression that we handle this situation 
intentionally, or somehow differently from the usual case. Whereas we 
could as well skip those tags altogether (but we don't really have to, 
as long as we only generate non-qualified tags, and check that every 
argument is a Symbol literal, i.e. it starts with a colon).

>         attr_reader :foo
> -      attr_reader :read1, :read2; attr_writer :write1, :write2
> -      attr_writer :bar
> +      attr_reader :read1 , :read2; attr_writer :write1, :write2
> +      attr_writer :bar,
> +                  :baz,
> +                  :more
>         attr_accessor :tee
> -      alias_method :qux, :tee
> +      alias_method :qux, :tee, attr_accessor :bogus

This one is a bit weird as well:

- An alias_method call with three arguments will raise an ArgumentError.

- If it didn't, the 'attr_accessor :bogus' calls would raise a 
SyntaxError, due to evaluation rules. However, an attr_X call can be 
inside an expression, such as:

class C
   puts(attr_accessor :bogus)
end

This is not a typical case, we don't need to handle it, but it's odd to 
see a test case that implies that this example is invalid, and we 
somehow prohibit it. Hopefully, this observation will allow you to 
simplify some code.



       reply	other threads:[~2016-02-03 23:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20160203162536.2954.45438@vcs.savannah.gnu.org>
     [not found] ` <E1aR0FM-0000mG-Up@vcs.savannah.gnu.org>
2016-02-03 23:46   ` Dmitry Gutov [this message]
2016-02-04  3:48     ` [Emacs-diffs] emacs-25 504696d: Etags: yet another improvement in Ruby tags Eli Zaretskii
2016-02-04  9:36       ` Dmitry Gutov
2016-02-04 17:28         ` Eli Zaretskii
2016-02-05  5:26           ` Dmitry Gutov
2016-02-05  5:29             ` Dmitry Gutov
2016-02-05  9:14             ` Eli Zaretskii
2016-02-05 10:11               ` Dmitry Gutov
2016-02-05 11:15                 ` Eli Zaretskii
2016-02-05 11:26                   ` Eli Zaretskii
2016-02-05 12:15                   ` Dmitry Gutov
2016-02-05 14:34                     ` Eli Zaretskii
2016-02-06  9:09                     ` Eli Zaretskii

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

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

  git send-email \
    --in-reply-to=56B29165.3040404@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.