From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.devel Subject: Re: Tree sitter support for C-like languages Date: Mon, 14 Nov 2022 10:31:15 -0800 Message-ID: References: <87tu36em9t.fsf@thornhill.no> <45FD2F78-F15B-488B-9348-A8E298D8AD35@gmail.com> <87v8nmyqqp.fsf@thornhill.no> <834jv4nz2g.fsf@gnu.org> <871qq8hsj1.fsf@thornhill.no> <83iljklzmo.fsf@gnu.org> <87v8nkgcqj.fsf@thornhill.no> <87sfiogcbm.fsf@thornhill.no> <83pmdrkyj7.fsf@gnu.org> <87v8njw5th.fsf@thornhill.no> <83leofkwjm.fsf@gnu.org> <9E9244D3-2EFB-4621-91E0-FC8B8C1C2D52@gmail.com> <09869DDB-2C3D-4064-81B0-0E6902C46396@gmail.com> <83fselk6tr.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) 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="21024"; mail-complaints-to="usenet@ciao.gmane.io" Cc: dgutov@yandex.ru, theo@thornhill.no, emacs-devel@gnu.org, monnier@iro.umontreal.ca To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Nov 15 00:57:51 2022 Return-path: Envelope-to: ged-emacs-devel@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 1oujKo-0005AX-Ci for ged-emacs-devel@m.gmane-mx.org; Tue, 15 Nov 2022 00:57:50 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ouijZ-0003pY-RN; Mon, 14 Nov 2022 18:19:21 -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 1ouieU-0001eb-I8 for emacs-devel@gnu.org; Mon, 14 Nov 2022 18:14:06 -0500 Original-Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oueEp-0003tY-HX; Mon, 14 Nov 2022 13:31:20 -0500 Original-Received: by mail-pl1-x62b.google.com with SMTP id p21so10829671plr.7; Mon, 14 Nov 2022 10:31:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=B/wNY8LW9JXR5aNrazAZ25jsg2mqbn15gjlFTqhTSXs=; b=Ervxc2lpnffjBecUN/pHwLSQYb8OuJ3DN7HYxJS3eEo0uBZOhTXvJxLUwK1zNTwUEj qwMbnh28DL6MZprB0s3Hb1RE2rAHSrT3LbaPWjME6A7ZF/De0vJGw+JrLUtggIIMmU9E o5IJk+Lm/O4JNFW2KVgCBJQJyHrP4gUiuAP1C3NvKE2lQ/Bi57NmG/QJVWC5CiIdrpCZ dxaIqT09SgubeMLEXyqxfGGR17aVumiASQFVbNPz8JLWeWrjYaHyiQT0JAeL1kxL5FMS pJP3/6lqsEfjaQpSYDnfRDCMhO0aF7WE7RAo/2ouXxR3DonnUcWCjawUXHMBxmS4yacN C19g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=B/wNY8LW9JXR5aNrazAZ25jsg2mqbn15gjlFTqhTSXs=; b=XAPky/V9OP+Z15rGg9izwPzvByAvDzYrTPBRb8dH1Lah1YapOxO4OxlP45k2cl7TTX oifwbybWYLDN+VskZLAIWSxjmzugfAGHroI5SinEemGm/Mstz7v/D0IBTYpGVmRaOXq8 gxpcFNuNJqtyvrxp8v5pDzZm+wfhMw6glVzNQEIfBINiJsdhXC+PvlJtqw8mPjNsYs/Y hbQdWIn1yeyQ1pMt9Q9qUnZwEZUYC0YK/yNfQecHzlNMpx/lw4PwUYenH6xN1baBnqL0 4PCfwSQS9g2hK0O/oOl8jzbfqq1+8UUrjMlzAgUwFZh1xt7+ocUQGJbcyLwZ8B2hTeJp xAOg== X-Gm-Message-State: ANoB5pmUbqlARQDv0MTAv8K6T+JrLCI1nsgZHX2bIfUd+H4NbkcxhUUz aSU2mIz2hhtn6KaXCwVQxJbTGPzptqDsIg== X-Google-Smtp-Source: AA0mqf6E0IAM9G5VpJd0fWkJ73m7+GaU5Akmwbu8LclPcgzScRZnhscNBtAXjiGRHGH1+ZeXLjaiMw== X-Received: by 2002:a17:902:c412:b0:188:584d:b6d4 with SMTP id k18-20020a170902c41200b00188584db6d4mr373437plk.170.1668450677592; Mon, 14 Nov 2022 10:31:17 -0800 (PST) Original-Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id e7-20020aa798c7000000b0056b8181861esm7309935pfm.19.2022.11.14.10.31.16 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Nov 2022 10:31:16 -0800 (PST) In-Reply-To: <83fselk6tr.fsf@gnu.org> X-Mailer: Apple Mail (2.3696.120.41.1.1) Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=casouri@gmail.com; helo=mail-pl1-x62b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:299780 Archived-At: > On Nov 14, 2022, at 5:24 AM, Eli Zaretskii wrote: >=20 >> From: Yuan Fu >> Date: Mon, 14 Nov 2022 00:35:47 -0800 >> Cc: Eli Zaretskii , >> Theodor Thornhill , >> emacs-devel , >> monnier@iro.umontreal.ca >>=20 >> That=E2=80=99s a good perspective. But from what I see I think it=E2=80= =99s best not to fontify these =E2=80=9Cerrors=E2=80=9D, at least for C = and C++. Because a lot of things could be marked =E2=80=9Cerror=E2=80=9D = in a C file, like stuff around macros. And in extreme cases the whole = file is marked =E2=80=9Cerror=E2=80=9D, even though if we ignore the = error everything is parsed fine. I guess tree-sitter isn=E2=80=99t happy = about some tiny thing in that file but never the less can parse = everything correctly. I attached that file below. >=20 > If these false positives happen frequently, it could be a user option; > some users will prefer false positives to false negatives. But I > definitely think that the warning face can be a valuable feature in > some use cases, so flatly dismissing it is probably not the best > alternative. Right. And I expect false positives to be low in any language that=E2=80=99= s not C/C++ (because macros). Let=E2=80=99s see what can we do. Yuan=