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: ruby-mide, SMIE and token priority Date: Thu, 07 Nov 2013 05:18:51 +0200 Message-ID: <527B069B.6020400@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1383794352 26595 80.91.229.3 (7 Nov 2013 03:19:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 7 Nov 2013 03:19:12 +0000 (UTC) Cc: emacs-devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 07 04:19:17 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 1VeG7o-0004Ix-Lc for ged-emacs-devel@m.gmane.org; Thu, 07 Nov 2013 04:19:16 +0100 Original-Received: from localhost ([::1]:37471 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VeG7o-00044y-31 for ged-emacs-devel@m.gmane.org; Wed, 06 Nov 2013 22:19:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34192) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VeG7d-00041D-Bq for emacs-devel@gnu.org; Wed, 06 Nov 2013 22:19:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VeG7U-0002V5-8Y for emacs-devel@gnu.org; Wed, 06 Nov 2013 22:19:05 -0500 Original-Received: from mail-ee0-x234.google.com ([2a00:1450:4013:c00::234]:43717) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VeG7U-0002Uw-1e for emacs-devel@gnu.org; Wed, 06 Nov 2013 22:18:56 -0500 Original-Received: by mail-ee0-f52.google.com with SMTP id e49so146130eek.39 for ; Wed, 06 Nov 2013 19:18:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; bh=1K305pFknXyyy73qwXHyUgbXTkU7MhgzXE8M3QTLFKE=; b=Htptv+QixwnvlUHkc8ZiuKhvBl5pO0/bzdN0AwwIrfmWbYYxMZPp7F76BlzKnnAT3q 80ACFSUTZWp/G+ndkiHPecRxXREMYfJdw13c5oztH+cYb8RdgsH2CFtWSU7uy3nwNyns K3lNrPSw1PO5RkBSKm+1dnRIc79c/BS5vLVznxCi9sOJ4XaASY5ACrm9kK+oVJlOSOi+ 4f24GqeUuRAZ4CvmrXoLsCEkNtz/MFfH1pX7gmhHzpROWZLT4HSxfYCNAY6mr3VvQ9Sw DUZ7orwIGqphBdpR9ecEko0eBWJr0FtshjDaHW/J01Hzu32/4fpjDCp2pUxmxn98kQno l76A== X-Received: by 10.14.42.6 with SMTP id i6mr6663978eeb.65.1383794335175; Wed, 06 Nov 2013 19:18:55 -0800 (PST) Original-Received: from [192.168.10.2] (87-236-188.netrun.cytanet.com.cy. [87.228.236.188]) by mx.google.com with ESMTPSA id h8sm3328685eew.16.2013.11.06.19.18.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 06 Nov 2013 19:18:54 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c00::234 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:165022 Archived-At: Stefan, There's one example in indent/ruby.rb I don't know what to do about: bar.foo(tee) do bar end The problem seems to be that "." is considered the parent token of "do". Probably because the left priority of "do" is not a number. It would be more natural if the parent of "do" was ";" on the preceding line, instead. Is it at all possible to change the grammar this way? Or should we just handle this as a special case in the `ruby-smie-rules', and in case of "do", instead of delegating to the parent, skip the parents until we find ";"? P.S. And here's a similar example with a curly block: bar.foo(tee) { bar }