From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] emacs-25 504696d: Etags: yet another improvement in Ruby tags Date: Thu, 04 Feb 2016 05:48:07 +0200 Message-ID: <8337t9xhjc.fsf@gnu.org> References: <20160203162536.2954.45438@vcs.savannah.gnu.org> <56B29165.3040404@yandex.ru> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1454557715 6371 80.91.229.3 (4 Feb 2016 03:48:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 4 Feb 2016 03:48:35 +0000 (UTC) Cc: emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 04 04:48:31 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aRAuE-0001fS-Sf for ged-emacs-devel@m.gmane.org; Thu, 04 Feb 2016 04:48:31 +0100 Original-Received: from localhost ([::1]:39327 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRAuE-0007kl-6H for ged-emacs-devel@m.gmane.org; Wed, 03 Feb 2016 22:48:30 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48437) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRAuA-0007ka-Kq for emacs-devel@gnu.org; Wed, 03 Feb 2016 22:48:27 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aRAu7-0001ME-El for emacs-devel@gnu.org; Wed, 03 Feb 2016 22:48:26 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:43282) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRAu7-0001Lw-BD; Wed, 03 Feb 2016 22:48:23 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3752 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aRAu6-0002WT-OM; Wed, 03 Feb 2016 22:48:23 -0500 In-reply-to: <56B29165.3040404@yandex.ru> (message from Dmitry Gutov on Thu, 4 Feb 2016 02:46:45 +0300) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:199278 Archived-At: > From: Dmitry Gutov > Date: Thu, 4 Feb 2016 02:46:45 +0300 > > 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). Please modify the test files as you see fit, and tell me what the tags should be. > > + 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. > - 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. 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. Thanks.