From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jackson Ray Hamilton Newsgroups: gmane.emacs.bugs Subject: bug#45717: 27.1; Error with apostrophe in JSX comment Date: Fri, 19 Nov 2021 18:32:06 -0800 Message-ID: <154a42d8-0822-0896-2b02-499026c20346@jacksonrayhamilton.com> References: <92d3cf8f-22e9-0f82-3d6f-36cc6dfbfb56@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39597"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 Cc: 45717@debbugs.gnu.org To: Dmitry Gutov , Stefan Kangas , Jakobsson Mattias Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 20 03:33:15 2021 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 1moGBl-000A3f-3C for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 20 Nov 2021 03:33:13 +0100 Original-Received: from localhost ([::1]:38812 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1moGBj-0003ot-MC for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 19 Nov 2021 21:33:11 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:52830) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1moGBa-0003oL-Bi for bug-gnu-emacs@gnu.org; Fri, 19 Nov 2021 21:33:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57676) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1moGBa-0005Vm-29 for bug-gnu-emacs@gnu.org; Fri, 19 Nov 2021 21:33:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1moGBZ-0004Mt-Ov for bug-gnu-emacs@gnu.org; Fri, 19 Nov 2021 21:33:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Jackson Ray Hamilton Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 20 Nov 2021 02:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45717 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 45717-submit@debbugs.gnu.org id=B45717.163737554016737 (code B ref 45717); Sat, 20 Nov 2021 02:33:01 +0000 Original-Received: (at 45717) by debbugs.gnu.org; 20 Nov 2021 02:32:20 +0000 Original-Received: from localhost ([127.0.0.1]:40989 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1moGAu-0004Lr-DS for submit@debbugs.gnu.org; Fri, 19 Nov 2021 21:32:20 -0500 Original-Received: from mta-07-4.privateemail.com ([68.65.122.27]:35412) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1moGAr-0004Ld-My for 45717@debbugs.gnu.org; Fri, 19 Nov 2021 21:32:18 -0500 Original-Received: from mta-07.privateemail.com (localhost [127.0.0.1]) by mta-07.privateemail.com (Postfix) with ESMTP id 8A82218000B9; Fri, 19 Nov 2021 21:32:11 -0500 (EST) Original-Received: from [192.168.88.209] (unknown [10.20.151.200]) by mta-07.privateemail.com (Postfix) with ESMTPA id 2941818000A4; Fri, 19 Nov 2021 21:32:11 -0500 (EST) In-Reply-To: <92d3cf8f-22e9-0f82-3d6f-36cc6dfbfb56@yandex.ru> Content-Language: en-US X-Virus-Scanned: ClamAV using ClamSMTP 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:220443 Archived-At: Hi, thanks for bringing this to our attention. This code seems to throw js-jsx--syntax-propertize-extend-region into an infinite loop.  M-x toggle-debug-on-error and M-x eval-expression (js-jsx--syntax-propertize-extend-region 69 240) shows the stack trace; (backward-sexp) ultimately causes (syntax-propertize), thus the loop. Using M-x edebug-defun to debug js-jsx--syntax-propertize-extend-region, after pressing space a bunch of times to step through it, I see it’s trying to jump from “)}” to the “{” in “className={”.  The presence of the apostrophe somehow interrupts the intended logic. I tried adding parse-sexp-ignore-comments to the let and it suppressed the infinite loop but caused a scan-error (which is immediately caught) which seems wrong to me. I tried adding (parse-sexp-ignore-comments t) to the let and encountered another infinite loop. Tricky.  For now, I’ll leave the mailing list with my notes. On 11/2/21 6:34 PM, Dmitry Gutov wrote: > On 31.10.2021 05:41, Stefan Kangas wrote: >> tags 45717 + confirmed >> thanks >> >> Jakobsson Mattias  writes: >> >>> I get the errors in the Recent messages further below if I edit >>> (e.g., by inserting a newline) >>> a JSX file with the content between the ``` below. If I remove the >>> apostrophe from >>> "don't" in the comment the errors goes away. >>> >>> ``` >>> import React from "react"; >>> >>> const MyComponent = ({ someList }) => ( >>>   
>>      className={someList.filter( >>>        // don't include an apostrophe in this comment >>>        (cls) => cls !== "someclass" >>>      )} >>>    /> >>> ); >>> >>> export default MyComponent; >>> ``` >> I tried reproducing this on current master, but I don't see any message. >> However, I do see incorrect highlighting after the comment with the >> apostrophe, so something is clearly still not working as it should. > > I do see errors in this scenario, especially after trying to edit or > move around. Like: > > js-jsx--syntax-propertize-extend-region: Lisp nesting exceeds > ‘max-lisp-eval-depth’Error during redisplay: (jit-lock-function 1) > signaled (error "Lisp nesting exceeds ‘max-lisp-eval-depth’") > > Adding Jackson to Cc, perhaps he'll have time and inclination to > investigate this.