unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: [Emacs-diffs] emacs-25 504696d: Etags: yet another improvement in Ruby tags
Date: Thu, 4 Feb 2016 12:36:25 +0300	[thread overview]
Message-ID: <56B31B99.6010400@yandex.ru> (raw)
In-Reply-To: <8337t9xhjc.fsf@gnu.org>

On 02/04/2016 06:48 AM, Eli Zaretskii wrote:

>> 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).
>
> Please modify the test files as you see fit, and tell me what the tags
> should be.

I've updated the example and the tags. No further action needed, thanks.

>>> +      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.
>
> It's there to test the algorithm, which should not tag the bogus
> accessor.

Why is it bogus, though? If it were not a syntax error (because of 
alias_method using a paren-less call as well, not because of preceding 
comma), it would be a valid attr_accessor call.

For instance, these examples are syntactically valid and would result in 
the generation of the method 'foo':

class C
   puts(attr_accessor :foo)
end

class C
   1 + 2; attr_reader :bar
end

We don't really need to support them, but actively fighting against them 
seems odd.

> I'm not sure how this simplifies things.  The point was that a comma
> doesn't reset the mini-state machine to the state where it is once
> again ready to see attr_accessor.  If you are saying there are other
> situations like that, please describe them.
>
> IOW, does etags handle the above intentionally invalid code correctly?
> It should.

Point is, the example code is syntactically invalid. etags doesn't need 
to handle that kind of code at all, right? It would be better to get a 
syntactically-valid example, if we an find one. Not sure if we can; 
these are also invalid:

1, 2, attr_accessor :bogus
puts(1, attr_accessor :bogus)

Ok, so it it doesn't simplify things, don't worry about it.



  reply	other threads:[~2016-02-04  9:36 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   ` [Emacs-diffs] emacs-25 504696d: Etags: yet another improvement in Ruby tags Dmitry Gutov
2016-02-04  3:48     ` Eli Zaretskii
2016-02-04  9:36       ` Dmitry Gutov [this message]
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

  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=56B31B99.6010400@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 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).