From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Simen =?UTF-8?Q?Heggest=C3=B8yl?= Newsgroups: gmane.emacs.bugs 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 Message-ID: <87mtfks8r2.fsf@runbox.com> References: <83r19d5c1i.fsf@gnu.org> <87wnj486il.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1060"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Eli Zaretskii , 53203@debbugs.gnu.org, Colin To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat May 14 12:35:45 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 1npp7g-000AZc-T7 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 14 May 2022 12:35:45 +0200 Original-Received: from localhost ([::1]:59856 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1npp7f-0006h8-Jc for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 14 May 2022 06:35:43 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40530) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npp72-0006bg-E7 for bug-gnu-emacs@gnu.org; Sat, 14 May 2022 06:35:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51894) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1npp70-00021K-An for bug-gnu-emacs@gnu.org; Sat, 14 May 2022 06:35:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1npp70-0007vn-8K for bug-gnu-emacs@gnu.org; Sat, 14 May 2022 06:35:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Simen =?UTF-8?Q?Heggest=C3=B8yl?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 May 2022 10:35:02 +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.165252447830444 (code B ref 53203); Sat, 14 May 2022 10:35:02 +0000 Original-Received: (at 53203) by debbugs.gnu.org; 14 May 2022 10:34:38 +0000 Original-Received: from localhost ([127.0.0.1]:45790 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npp6b-0007uw-S5 for submit@debbugs.gnu.org; Sat, 14 May 2022 06:34:38 -0400 Original-Received: from mailtransmit04.runbox.com ([185.226.149.37]:48150) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npp6Z-0007uW-HN for 53203@debbugs.gnu.org; Sat, 14 May 2022 06:34:36 -0400 Original-Received: from mailtransmit03.runbox ([10.9.9.163] helo=aibo.runbox.com) by mailtransmit04.runbox.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1npp6T-002thi-7k; Sat, 14 May 2022 12:34:29 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=runbox.com; s=selector2; h=Content-Transfer-Encoding:Content-Type:MIME-Version: Message-ID:In-Reply-To:Date:References:Subject:Cc:To:From; bh=cS8b94rkGzEXL0aBzh/1EwoEO4iDvGqKqfAk6rpf8Gw=; b=P+Y0+LoOtMoSesN+EQLGSz52hg NDN7Y9XOFsj5uY22P8Bnt0EuxuTxNR1jFNbPiCbjh/bJqTZYaCrxD7DxworfGTioUJHLK3ty0ymIW 4Bqa1h8ZW58dIW/rEUdvp0q4/bLMgwFjkjmXV1ItoqbOjNRbrtWRFYIBottOICcvMJw6QnypGFGuf TnOBqIIUtwW7xmkXsr1IvdFb6xV1Z+YTbquuzDqPugPdALnriFyzx5w1lbX2KDJcIF+HRAPbBpuAF 8r+PJ1SC21Mx7xw1Hp1SI/Cp/e2vtjh5U8Zxqq4Vq2W5xA+sTyRbUSLSi9cngW4b/1DT0ebX19JNh /DdGpwow==; Original-Received: from [10.9.9.74] (helo=submission03.runbox) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1npp6S-0006w9-Ld; Sat, 14 May 2022 12:34:28 +0200 Original-Received: by submission03.runbox with esmtpsa [Authenticated ID (963757)] (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) id 1npp6Q-0000PD-8k; Sat, 14 May 2022 12:34:26 +0200 In-Reply-To: <87wnj486il.fsf@gnus.org> (Lars Ingebrigtsen's message of "Thu, 13 Jan 2022 08:00:18 +0100") 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:232225 Archived-At: Lars Ingebrigtsen 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. =F0=9F= =98=95 > 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