From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: trunk r114534: Get Ruby's SMIE code to pass the test suite. Date: Mon, 21 Oct 2013 12:46:17 -0400 Message-ID: References: <87eh7z1c8u.fsf@yandex.ru> <87d2nijcx8.fsf@yandex.ru> <5264C654.3010506@yandex.ru> <877gd6ogix.fsf@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1382373992 3719 80.91.229.3 (21 Oct 2013 16:46:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2013 16:46:32 +0000 (UTC) Cc: emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 21 18:46:35 2013 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 1VYIcl-0005VZ-97 for ged-emacs-devel@m.gmane.org; Mon, 21 Oct 2013 18:46:35 +0200 Original-Received: from localhost ([::1]:40823 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VYIck-0000nb-PS for ged-emacs-devel@m.gmane.org; Mon, 21 Oct 2013 12:46:34 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44194) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VYIcb-0000mZ-Q6 for emacs-devel@gnu.org; Mon, 21 Oct 2013 12:46:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VYIcU-00088J-46 for emacs-devel@gnu.org; Mon, 21 Oct 2013 12:46:25 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:40887) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VYIcT-00088F-WA for emacs-devel@gnu.org; Mon, 21 Oct 2013 12:46:18 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFFFxLCX/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYSFBgNJIgeBsEtkQoDpHqBXoMT X-IPAS-Result: Av4EABK/CFFFxLCX/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYSFBgNJIgeBsEtkQoDpHqBXoMT X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="35988450" Original-Received: from 69-196-176-151.dsl.teksavvy.com (HELO pastel.home) ([69.196.176.151]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 21 Oct 2013 12:46:17 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 2E1CA6001A; Mon, 21 Oct 2013 12:46:17 -0400 (EDT) In-Reply-To: <877gd6ogix.fsf@yandex.ru> (Dmitry Gutov's message of "Mon, 21 Oct 2013 18:16:54 +0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.182 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:164425 Archived-At: >> Maybe change the tokenizer so that a ".qux" *at smie-bolp* is tokenized >> as "." and "qux"? > That will probably break the following modified example: > class C > def foo > self > .end > D.new > .class > end > end Yes, the problem is that the set of desired indentation does not match the structure of a fixed parsing. So, some of the differences need to be handled in ad-hoc ways in the ruby-smie-rules function. E.g. for (:before . ".") we'd have to look at the previous token and if it's of the form "foo.bar", then manually align with the "." of "foo.bar". > But I guess we can make the tokenizer both return "." as a separate > token and include it in the token that goes after it. I'm not sure I understand exactly what you're suggesting, but I'd venture to say that you can't do that. Stefan