Subject: Re: bug#21896: 24.5; Inconsistent handling of braces in smie

From: Lars Ingebrigtsen <[email-masked]>
Date: Thu, 03 Dec 2020 11:44:26 +0100

[email-masked] 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