From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#59468: 29.0.50; c-ts-mode cannot fontify after macros are encountered Date: Tue, 22 Nov 2022 17:27:30 -0800 Message-ID: <88869BE5-43B6-47AE-841E-A726119EDC5E@ucsd.edu> References: <87k03n4v0r.fsf@yahoo.com> Reply-To: Yuan Fu 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="30271"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 59468@debbugs.gnu.org To: Po Lu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 23 09:29:55 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 1oxl8l-0007gI-2X for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 23 Nov 2022 09:29:55 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oxl86-0000aa-0O; Wed, 23 Nov 2022 03:29:14 -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 1oxl81-0000ZB-7Q for bug-gnu-emacs@gnu.org; Wed, 23 Nov 2022 03:29:11 -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 1oxl7x-0001MK-1i for bug-gnu-emacs@gnu.org; Wed, 23 Nov 2022 03:29:07 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oxl7w-0007TJ-TZ for bug-gnu-emacs@gnu.org; Wed, 23 Nov 2022 03:29:04 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <87k03n4v0r.fsf@yahoo.com> Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 23 Nov 2022 08:29:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59468 X-GNU-PR-Package: emacs Original-Received: via spool by 59468-submit@debbugs.gnu.org id=B59468.166919211028608 (code B ref 59468); Wed, 23 Nov 2022 08:29:04 +0000 Original-Received: (at 59468) by debbugs.gnu.org; 23 Nov 2022 08:28:30 +0000 Original-Received: from localhost ([127.0.0.1]:53441 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oxl7N-0007RG-CZ for submit@debbugs.gnu.org; Wed, 23 Nov 2022 03:28:29 -0500 Original-Received: from mx0b-0016e101.pphosted.com ([148.163.141.31]:11762) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oxeY2-0005MF-9b for 59468@debbugs.gnu.org; Tue, 22 Nov 2022 20:27:35 -0500 Original-Received: from pps.filterd (m0151358.ppops.net [127.0.0.1]) by mx0b-0016e101.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2AN1PEpk016593 for <59468@debbugs.gnu.org>; Tue, 22 Nov 2022 17:27:33 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ucsd.edu; h=from : content-type : content-transfer-encoding : mime-version : subject : message-id : date : cc : to; s=campus; bh=sCV1XXSD8sbzxDLzSFOGnX5mLIAqNi8yMLTKD8y1udw=; b=EGof4xm7MGmXH5bw7MUGq5aIHBRAJr9zF58zr6p3IPcafoW5GkutQHyzeglW88mf3AwL 33hj39EHC/hghrO4NfITSDe2+sXq9LWAsE7JvEYGlD2WWthcKYOmjK/l5/pAiL43uAUv mNcXDRr1Rakn1QaRF5zecISn5tRmhT3GqW6y07VvtA6MS6/9NMD3Ql3tivRLBzbEIlur BUXn2a9xkhjmKKqX1L7CyVhFWkjjf11TgBFoK+MUq2vlv48w3rYeAGDCELjc+sZhfNcP FeEhZpvN7JBSS48duhIdpCo5TP8V7cLH9Lcq+2M70yY3q5VtnSLR039+jejJxJxvEMVv NA== Original-Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) by mx0b-0016e101.pphosted.com (PPS) with ESMTPS id 3kyfxykcgh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for <59468@debbugs.gnu.org>; Tue, 22 Nov 2022 17:27:33 -0800 Original-Received: by mail-pg1-f198.google.com with SMTP id f22-20020a635556000000b0046fd05d55cdso9262181pgm.1 for <59468@debbugs.gnu.org>; Tue, 22 Nov 2022 17:27:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ucsd.edu; s=google; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:from:to:cc:subject:date:message-id :reply-to; bh=sCV1XXSD8sbzxDLzSFOGnX5mLIAqNi8yMLTKD8y1udw=; b=X9J4J6ktuGofUK0jiKR7G+9rMcROKGPZUqZaodbvWqDqa06ZxNTqV2QCC36NTJKLk0 /9cXAj9RkWcYj/duvO6z68hjl73+/gxV+ppkX6WGbsU68i4Tyk96ophqB0aQbGMuHDVC coV6SOu1zghXuHhm/dIoW5+4c4530AMk43u5Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sCV1XXSD8sbzxDLzSFOGnX5mLIAqNi8yMLTKD8y1udw=; b=mKpXFx8/qFMn6OC4BhK4eoCd8faBSAhdy/J7RhkToG/zqeKg/iKw4QaEagSDmp+cl6 84brU6liVyqT0MEutbSIjdjR1ttkG604ajQHXv81ALJVZuikntjjRmmOfGpUdIuZqIUd fU2KUyuEhod/iBDPzPXnE/WMy6kFDHig+XZKOaq9SR+l2iv1MIVbnwDn62clt9onK7S3 S/FTbpHrKn/ogFuJfy3lrxW3kk8YGKc8trL56a1ibgz9Qh3ojEcMdgkce4y0wnWATNqf F1QK0z1cgQdB1D720g27JxNNDIBeZ0nCx7VDyPEQTWnj9e+ewgiyqBe+6UzwWaaq7GZp wIsA== X-Gm-Message-State: ANoB5plXF5vWLVSU1I9l1V3yS5cMYVdoTnvpbzjcY+cKcN0HX/YjesS5 vJmCUtvsOcV1mBt3zEi2RP2JshsiuCw2DFsB7b9fCweXhLL8nSaUmav62so8zNFG640cbEPhfMc hkWfDeKVilScpzA== X-Received: by 2002:a62:e80b:0:b0:56e:ad31:b98b with SMTP id c11-20020a62e80b000000b0056ead31b98bmr10886935pfi.40.1669166852238; Tue, 22 Nov 2022 17:27:32 -0800 (PST) X-Google-Smtp-Source: AA0mqf5Uvsv4X6jmlKWhLViZD+DLNnsChaCiEa/ScnH3f9YJ00+no8g3METviF6u4cEwRHSnQ9luyg== X-Received: by 2002:a62:e80b:0:b0:56e:ad31:b98b with SMTP id c11-20020a62e80b000000b0056ead31b98bmr10886918pfi.40.1669166851923; Tue, 22 Nov 2022 17:27:31 -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 t3-20020a625f03000000b0056c3d3f5a8dsm11282807pfb.56.2022.11.22.17.27.31 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Nov 2022 17:27:31 -0800 (PST) X-Mailer: Apple Mail (2.3696.120.41.1.1) X-campus_gsuite: gsuite_33445511 X-Proofpoint-ORIG-GUID: yMBCSb7ebxQXoPcNhBfqL_h7LbhHHs_Z X-Proofpoint-GUID: yMBCSb7ebxQXoPcNhBfqL_h7LbhHHs_Z pp_allow_relay: proofpoint_allowed X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-22_13,2022-11-18_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 lowpriorityscore=0 clxscore=1011 adultscore=0 priorityscore=1501 mlxlogscore=474 spamscore=0 malwarescore=0 impostorscore=0 bulkscore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211230009 X-Mailman-Approved-At: Wed, 23 Nov 2022 03:28:22 -0500 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:248717 Archived-At: Po Lu writes: > Yuan Fu writes: > >> Thanks for these reports! Buuuuut as we=E2=80=99ve seen, tree-sitter = really >> doesn=E2=80=99t handle macros that well. I=E2=80=99ll see what I can = do when I find the >> time, but there really isn=E2=80=99t any good solutions to this = (right now, that >> I can think of). I=E2=80=99m not even sure the author of = tree-sitter-c would > > Thanks, and too bad. However, one cannot help but wonder how he is > supposed to write only "post-processed" C. I think the idea is that most macros are defined like functions, so they are just parsed as function invocations. Other things can be handled by tree-sitter=E2=80=99s error recovery to some degree. Not saying this is = correct, but that=E2=80=99s probably the idea. >> accept changes that try to parse macros: he has made it clear that = the >> purpose of tree-sitter-c is to support post-processed C and leave = macros >> and preprocessor to error-recovery. > > I think that attitude of the > tree-sitter-c developer is extremely nasty. For the record, because I don=E2=80=99t want to put words into = tree-sitter=E2=80=99s author=E2=80=99s mouth, I came up with this observation from [1], and I = could be wrong. Also, I think it=E2=80=99s more about the limitation of = parser-base approach than about policy. [1]: https://github.com/tree-sitter/tree-sitter-c/issues/7 Yuan