From: Lars Ingebrigtsen <larsi@gnus.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 53203@debbugs.gnu.org, Colin <my.old.email.sucked@gmail.com>
Subject: bug#53203: Comment with lots of color codes crashes or hangs emacs in scss-mode
Date: Thu, 13 Jan 2022 08:00:18 +0100 [thread overview]
Message-ID: <87wnj486il.fsf@gnus.org> (raw)
In-Reply-To: <83r19d5c1i.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 12 Jan 2022 15:16:57 +0200")
Eli Zaretskii <eliz@gnu.org> writes:
> It seems to infloop in JIT font-lock, and the culprit seems to be this
> part of font-lock-keywords:
>
> ;; Even though pseudo-elements should be prefixed by ::, a
> ;; single colon is accepted for backward compatibility.
> "\\(?:\\(:" (regexp-opt (append css-pseudo-class-ids
> css-pseudo-element-ids)
> t)
Trying to understand the regexp used for scss here, I think that bit is
somewhat innocuous -- it just matches those words.
;; Even though pseudo-elements should be prefixed by ::, a
;; single colon is accepted for backward compatibility.
"\\(?:\\(:" (regexp-opt (append css-pseudo-class-ids
css-pseudo-element-ids)
t)
"\\|::" (regexp-opt css-pseudo-element-ids t) "\\)"
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.
But I've repressed all I once knew about the scss language -- what is it
really trying to match here? Anybody?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
next prev parent reply other threads:[~2022-01-13 7:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-12 7:20 bug#53203: Comment with lots of color codes crashes or hangs emacs in scss-mode Colin
2022-01-12 13:16 ` Eli Zaretskii
2022-01-13 7:00 ` Lars Ingebrigtsen [this message]
2022-01-13 8:58 ` Eli Zaretskii
2022-05-14 10:34 ` Simen Heggestøyl
2022-05-14 12:02 ` Lars Ingebrigtsen
2022-05-14 12:38 ` Lars Ingebrigtsen
2022-05-14 13:30 ` Lars Ingebrigtsen
2022-05-14 15:33 ` Lars Ingebrigtsen
2022-05-15 10:45 ` Simen Heggestøyl
2022-05-15 12:14 ` Lars Ingebrigtsen
2022-05-15 14:46 ` Simen Heggestøyl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87wnj486il.fsf@gnus.org \
--to=larsi@gnus.org \
--cc=53203@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=my.old.email.sucked@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).