From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Lars Ingebrigtsen <larsi@gnus.org>
Newsgroups: gmane.emacs.bugs
Subject: bug#21896: 24.5; Inconsistent handling of braces in smie
Date: Thu, 03 Dec 2020 11:44:26 +0100
Message-ID: <87blfbuq2d.fsf@gnus.org>
References: <87bnayzjbg.fsf@home.i-did-not-set--mail-host-address--so-tickle-me>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
	logging-data="13153"; mail-complaints-to="usenet@ciao.gmane.io"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
Cc: 21896@debbugs.gnu.org
To: mail@ap4y.me
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 03 11:45:26 2020
Return-path: <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>
Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org
Original-Received: from lists.gnu.org ([209.51.188.17])
	by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
	(Exim 4.92)
	(envelope-from <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>)
	id 1kkm73-0003IT-9H
	for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 03 Dec 2020 11:45:25 +0100
Original-Received: from localhost ([::1]:42030 helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>)
	id 1kkm72-0008KQ-3A
	for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 03 Dec 2020 05:45:24 -0500
Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44156)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1kkm6g-0008K0-IE
 for bug-gnu-emacs@gnu.org; Thu, 03 Dec 2020 05:45:02 -0500
Original-Received: from debbugs.gnu.org ([209.51.188.43]:55235)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1kkm6g-0006zW-A4
 for bug-gnu-emacs@gnu.org; Thu, 03 Dec 2020 05:45:02 -0500
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1kkm6g-00031P-7f
 for bug-gnu-emacs@gnu.org; Thu, 03 Dec 2020 05:45:02 -0500
X-Loop: help-debbugs@gnu.org
Resent-From: Lars Ingebrigtsen <larsi@gnus.org>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Thu, 03 Dec 2020 10:45:02 +0000
Resent-Message-ID: <handler.21896.B21896.160699227811554@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 21896
X-GNU-PR-Package: emacs
Original-Received: via spool by 21896-submit@debbugs.gnu.org id=B21896.160699227811554
 (code B ref 21896); Thu, 03 Dec 2020 10:45:02 +0000
Original-Received: (at 21896) by debbugs.gnu.org; 3 Dec 2020 10:44:38 +0000
Original-Received: from localhost ([127.0.0.1]:38545 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1kkm6H-00030H-MR
 for submit@debbugs.gnu.org; Thu, 03 Dec 2020 05:44:37 -0500
Original-Received: from quimby.gnus.org ([95.216.78.240]:44452)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@gnus.org>) id 1kkm6G-000300-GY
 for 21896@debbugs.gnu.org; Thu, 03 Dec 2020 05:44:36 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=YuHcy1MIKwWZGJUcKDDUlTtuQ9uMxChNQGtXM2w5mGs=; b=U7zKizripDSmb+bIOJO9tASAMF
 TtXULA53eq1rm66aHAS7hqnQvup9Kfs7cBcsreHNzporfUmHMXtX2JEjO4ByaVTE79rw05oCUJ188
 LlSDGwdWWPT98kuxPo1minS1/erOzsajKTQpfSiH8+eVWIHmo4gEln+aVCa+tvL+pq6Q=;
Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@gnus.org>)
 id 1kkm67-0002Ro-HB; Thu, 03 Dec 2020 11:44:30 +0100
X-Now-Playing: I-O's _Firecamp Stories Remixes_: "Desert Like Tundra"
In-Reply-To: <87bnayzjbg.fsf@home.i-did-not-set--mail-host-address--so-tickle-me>
 (mail@ap4y.me's message of "Fri, 13 Nov 2015 16:09:39 +1300")
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
X-BeenThere: bug-gnu-emacs@gnu.org
List-Id: "Bug reports for GNU Emacs,
 the Swiss army knife of text editors" <bug-gnu-emacs.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/bug-gnu-emacs>
List-Post: <mailto:bug-gnu-emacs@gnu.org>
List-Help: <mailto:bug-gnu-emacs-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=subscribe>
Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org
Original-Sender: "bug-gnu-emacs"
 <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>
Xref: news.gmane.io gmane.emacs.bugs:194870
Archived-At: <http://permalink.gmane.org/gmane.emacs.bugs/194870>

mail@ap4y.me writes:

> Using 2 possible ways of hanling braces tokens:
>
> 1. Using default lexer rules for braces (as per documentation).
> 2. Manually tokenizing braces in lexer (uncomment lines 196-197 and
> 213-214 in provided source file)
>
> I'm getting different indentation results. For the case number 1,
> indentation of the consutriction:
>
> if true {
>     |foo
> }
>
> is invalid and from the logs it seems like smie doesn't parse this
> constructor correctly.
>
> For the case number 2 indentation works as expected, but for the
> construction like this (which is a simple sexp):
>
> {
> }|
>
> I'm getting "Mismatching parenthesis" error when I'm calling
> blink-matching-open.

(This bug report unfortunately got no response at the time.)

I tried reproducing this bug in Emacs 28 by loading the supplied Swift
mode, and then indenting the the example, and I got this:

if true {
           foo
       }

Which I assume isn't correct?

For the second problem, blink-matching-open seemed to do the correct
thing.

Before debugging further -- are you still seeing these problems with a
more recent Emacs/swift mode?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no