bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#53203: Comment with lots of color codes crashes or hangs emacs in sc


From: Simen Heggestøyl
Subject: bug#53203: Comment with lots of color codes crashes or hangs emacs in scss-mode
Date: Sat, 14 May 2022 12:34:25 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Lars Ingebrigtsen <larsi@gnus.org> writes:

> But then we get:
>
>        "\\(?:([^)]+)\\)?"
>        (if (not sassy)
>            "[^:{}()\n]*"
>          (concat "[^:{}()\n#]*\\(?:" scss--hash-re "[^:{}()\n#]*\\)*"))
>        "\\)*"
>
> Which is a whole lot of backtracking, presumably exacerbated by the
> previous ids bit of the regexp.

By the ancient scientific method of commenting out code, it seems to me
that the culprit is rather the last group of the regexp starting on
line 955:

  (concat "\\(?:" scss--hash-re
          "\\|[^@/:{}() \t\n#]\\)"
          "[^:{}()#]*\\(?:" scss--hash-re "[^:{}()#]*\\)*"))

That is, this part:

  \\(?:" scss--hash-re "[^:{}()#]*\\)*

Though I'm rather clueless on how proceed debugging/optimizing it. 😕

> But I've repressed all I once knew about the scss language -- what is
> it really trying to match here?  Anybody?

It's supposed to match selectors like the one on line 39 in
test/manual/indent/scss-mode.scss:

  p.#{$name} var





reply via email to

[Prev in Thread] Current Thread [Next in Thread]