From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs 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 Message-ID: <87wnj486il.fsf@gnus.org> References: <83r19d5c1i.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40087"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 53203@debbugs.gnu.org, Colin To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 13 08:08:50 2022 Return-path: 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 ) id 1n7uE6-000AHd-M8 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 13 Jan 2022 08:08:50 +0100 Original-Received: from localhost ([::1]:48780 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7uE5-0003FC-3h for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 13 Jan 2022 02:08:49 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:36022) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7u6i-0005Mx-1a for bug-gnu-emacs@gnu.org; Thu, 13 Jan 2022 02:01:12 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38696) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n7u6X-0001v7-T2 for bug-gnu-emacs@gnu.org; Thu, 13 Jan 2022 02:01:11 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n7u6X-00073u-Nn for bug-gnu-emacs@gnu.org; Thu, 13 Jan 2022 02:01:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 13 Jan 2022 07:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53203 X-GNU-PR-Package: emacs Original-Received: via spool by 53203-submit@debbugs.gnu.org id=B53203.164205723427093 (code B ref 53203); Thu, 13 Jan 2022 07:01:01 +0000 Original-Received: (at 53203) by debbugs.gnu.org; 13 Jan 2022 07:00:34 +0000 Original-Received: from localhost ([127.0.0.1]:59831 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n7u65-00072v-MS for submit@debbugs.gnu.org; Thu, 13 Jan 2022 02:00:33 -0500 Original-Received: from quimby.gnus.org ([95.216.78.240]:50422) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n7u62-00072Y-8W for 53203@debbugs.gnu.org; Thu, 13 Jan 2022 02:00:32 -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=bhj5WB6lLwc38UO7dRtO2X2+uJRTFU2QuitKtoe+DHE=; b=oiSCMmnviskjJbHP5d1e3bj+GA x6cg+JycAQUo328mqUkwN6uWqanSmfgl6ion8F/zcMt5fqYgjVpi+uHMx4KkY5WWYsifiI6yba0bU cfB+8TI/M5CnlwA5vAmVjQjYy0D3o/5uZIgSb4ltIvG6IPAu6/e/ssDbGTYJSbMLB2dI=; Original-Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n7u5s-0008MY-9c; Thu, 13 Jan 2022 08:00:23 +0100 X-Now-Playing: Suicide Romeo's _Pictures_: "Modern Romance" In-Reply-To: <83r19d5c1i.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 12 Jan 2022 15:16:57 +0200") 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" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:224064 Archived-At: Eli Zaretskii 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