From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#59426: 29.0.50; [tree-sitter] Some functions exceed maximum recursion limit Date: Wed, 23 Nov 2022 21:01:49 +0100 Message-ID: <6822E77F-3094-4E73-A7E7-EF5C096FC08F@acm.org> References: <87wn7o6c9c.fsf@yahoo.com> <701BF611-6506-403E-B70B-2D93F3339E0C@acm.org> <83v8n82yzl.fsf@gnu.org> <83fsec2qq3.fsf@gnu.org> <83edtw2pz3.fsf@gnu.org> <835yf82oc4.fsf@gnu.org> <942C72E7-3DA9-4E2B-8B40-137B8FB23473@acm.org> <04236EB0-122B-41D0-B696-CC2EFA4B6A93@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) 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="38405"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Po Lu , 59426@debbugs.gnu.org, Eli Zaretskii , Stefan Kangas To: Yuan Fu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 23 21:03:15 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 1oxvxj-0009iu-FV for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 23 Nov 2022 21:03:15 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oxvxY-00071p-8d; Wed, 23 Nov 2022 15:03:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oxvxX-00071Y-02 for bug-gnu-emacs@gnu.org; Wed, 23 Nov 2022 15:03:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oxvxW-0006ez-Jo for bug-gnu-emacs@gnu.org; Wed, 23 Nov 2022 15:03:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oxvxW-0006SM-1d for bug-gnu-emacs@gnu.org; Wed, 23 Nov 2022 15:03:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 23 Nov 2022 20:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59426 X-GNU-PR-Package: emacs Original-Received: via spool by 59426-submit@debbugs.gnu.org id=B59426.166923372824751 (code B ref 59426); Wed, 23 Nov 2022 20:03:02 +0000 Original-Received: (at 59426) by debbugs.gnu.org; 23 Nov 2022 20:02:08 +0000 Original-Received: from localhost ([127.0.0.1]:56328 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oxvwd-0006R8-24 for submit@debbugs.gnu.org; Wed, 23 Nov 2022 15:02:08 -0500 Original-Received: from mail1455c50.megamailservers.eu ([91.136.14.55]:42508 helo=mail266c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oxvwX-0006QS-Iq for 59426@debbugs.gnu.org; Wed, 23 Nov 2022 15:02:06 -0500 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1669233713; bh=6EnimGgpU6TExmU+z8yNHIfXOhP6rGgNQx8ZqFI12/8=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=DAoR22vDt4pMrbg+7RhqRso1ZVJmsteMAD9bQcLjUDb034CFEwpzEJ3J2lPA+QOmX x5MWFsvKZ1HA5vqh4J2CM8MdDJLzFa4iW1GKRF/sYsw9+ewZnSxtz56ACxMwsDTq8+ OxvTyqHDCGAc4nPDR5LuKrWpxh3cnMNTkhhg+AFU= Feedback-ID: mattiase@acm.or Original-Received: from smtpclient.apple (c188-150-171-209.bredband.tele2.se [188.150.171.209]) (authenticated bits=0) by mail266c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 2ANK1nis030093; Wed, 23 Nov 2022 20:01:51 +0000 In-Reply-To: <04236EB0-122B-41D0-B696-CC2EFA4B6A93@gmail.com> X-Mailer: Apple Mail (2.3654.120.0.1.13) X-CTCH-RefID: str=0001.0A782F21.637E7C31.002D, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-Origin-Country: SE 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:248780 Archived-At: 23 nov. 2022 kl. 19.46 skrev Yuan Fu : > It shouldn=E2=80=99t, but tree-sitter thinks some closing brackets are = erroneous and skips them when parsing (it skips erroneous tokens in the = hope to parse the rest of the file despite local errors). So a 10k wide = tree becomes 10k tall. >=20 > We can submit a bug repot to tree-sitter-c (=E2=80=9Cmaybe don=E2=80=99t= skip closing brackets even there is error, or somthing=E2=80=9D), but = that=E2=80=99s another story. Thanks for the explanation. In this case it seems that it's the #line = directive that throws a spanner in the works. You probably already = discovered that, but for the record, here is a cut-down example: static hf_register_info hf[] =3D { #line 1 "./asn1/rrc/packet-rrc-hfarr.c" { &hf_rrc_DL_DCCH_Message_PDU, { "DL-DCCH-Message", "rrc.DL_DCCH_Message_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_rrc_cellIdentity_c_id, {"Cell Identifier", "rrc.cellIdentity.c_id", FT_UINT32, BASE_DEC, NULL, 0, "The Cell Identifier (C-Id) part of the Cell Identity", HFILL }} }; Note how the warning colour of the curly brackets vanishes once the = #line line is removed. Even if this snag is corrected, there will always be cases where = preprocessor use causes trouble of this or a similar kind. It seems = quite convincing that we should void C recursion in favour of explicit = stacks where possible.