From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] emacs-25 504696d: Etags: yet another improvement in Ruby tags Date: Thu, 4 Feb 2016 12:36:25 +0300 Message-ID: <56B31B99.6010400@yandex.ru> References: <20160203162536.2954.45438@vcs.savannah.gnu.org> <56B29165.3040404@yandex.ru> <8337t9xhjc.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1454578613 22220 80.91.229.3 (4 Feb 2016 09:36:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 4 Feb 2016 09:36:53 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 04 10:36:48 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 1aRGLG-0001Es-85 for ged-emacs-devel@m.gmane.org; Thu, 04 Feb 2016 10:36:46 +0100 Original-Received: from localhost ([::1]:40527 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRGLF-0002N0-EQ for ged-emacs-devel@m.gmane.org; Thu, 04 Feb 2016 04:36:45 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49794) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRGL0-0002Mi-QS for emacs-devel@gnu.org; Thu, 04 Feb 2016 04:36:31 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aRGKx-0005IW-KN for emacs-devel@gnu.org; Thu, 04 Feb 2016 04:36:30 -0500 Original-Received: from mail-lb0-x231.google.com ([2a00:1450:4010:c04::231]:34084) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRGKx-0005IP-Cq; Thu, 04 Feb 2016 04:36:27 -0500 Original-Received: by mail-lb0-x231.google.com with SMTP id cw1so27642083lbb.1; Thu, 04 Feb 2016 01:36:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=r11NG1OGN7SOy/0/xRHUfj8Y4H4nBGvDoz+cJQgNBVo=; b=mM7ya7R/vwl2qhlPsLmzj/4PAjCzfZ0lSrDUfSC28Gdw308vCB46Kh8mcTUxyE6suw QymrORH+Mh+V/F0DXW9UVIJNfyJCnkc8rmseHy8TaMlVpdFHGl2jvyB1fhSZRC67iLUE LZl7zXea6SpOFQ7RAvlUvQB2fseqlNJQKugKiw51W2hzBMsIimDGRgWHlmmtTM8xFEBl Vvpfd3pYVRjvIHmOOcjTQJLxpNweSfHPIARPVDoZR2qiO4ZsUW4kr1epdZH3eceLKlEw 3Dq4g973Dbqx8RkaGdHmODH9rSN7AdNIPFMwff3W8Fk3Reoydi394BHgQt3AHcNFMaBF C3Zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:to:references:cc:from:message-id :date:user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=r11NG1OGN7SOy/0/xRHUfj8Y4H4nBGvDoz+cJQgNBVo=; b=hjTeud09Tc9rB7F3DmrgTKLnox+mh5oWU9YIHsDSL8CDLeIIf6/Xt8YRCgtW2NMp72 tfgreZpRxGeyc+jm/tzqOuVhwR5gITLJBysf8AUHGLqkjAFWkm6Hxl2oxNBQVbDloIgz WqQCoB/LBWwbIcYaxE0ihx19iWEvcgn1zgjnG0uPuRr9kWLgAbvUiHa0BkXAlTtztpp2 KYAXhJTtubfWhno+Fcrzm0QCgVyxiYHcvxa7DcAA5fEmwkBDdZa8GFzEsruXs+s+oL1l +iD/GV7F3wZgc7guctp10GRFVMhUjsSl++eK82i9IeslqjUqagHFN0lS0KJVjgixe3/O Ltqg== X-Gm-Message-State: AG10YOQyUUfNVQTQVav2fMYIGWvqGgGrNcoWqfglXu8dQD0syhoy/H/qMeqCl2MxxCSVfw== X-Received: by 10.112.161.104 with SMTP id xr8mr3046654lbb.29.1454578586325; Thu, 04 Feb 2016 01:36:26 -0800 (PST) Original-Received: from [192.168.1.190] ([178.252.127.222]) by smtp.googlemail.com with ESMTPSA id e92sm1440302lfi.48.2016.02.04.01.36.25 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 04 Feb 2016 01:36:25 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:44.0) Gecko/20100101 Thunderbird/44.0 In-Reply-To: <8337t9xhjc.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c04::231 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:199289 Archived-At: 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.