From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Tree sitter support for C-like languages Date: Tue, 15 Nov 2022 11:01:24 -0500 Message-ID: References: <87tu36em9t.fsf@thornhill.no> <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> <186915C1-1C47-43DC-A386-B447A2E7528D@gmail.com> <83h6z1k6z8.fsf@gnu.org> <52D18BA8-C9A8-4E9A-9DDA-76E48744DDC9@gmail.com> <837czxjrxu.fsf@gnu.org> <8BEF109A-A5B3-4CF4-AE07-AEB9388B0A07@gmail.com> <83zgcti9gh.fsf@gnu.org> <83y1scj3s8.fsf@gnu.org> <7082237A-2BD6-4A1C-8BEC-4D470B0D204F@gmail.com> <83a64si7jo.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8020"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Yuan Fu , theo@thornhill.no, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Nov 15 17:02:35 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 1ouyOQ-0001ua-Ue for ged-emacs-devel@m.gmane-mx.org; Tue, 15 Nov 2022 17:02:35 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ouyNd-00005Q-L9; Tue, 15 Nov 2022 11:01:46 -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 1ouyNX-00004t-NE for emacs-devel@gnu.org; Tue, 15 Nov 2022 11:01:41 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ouyNV-0004kN-L6; Tue, 15 Nov 2022 11:01:39 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 94488100197; Tue, 15 Nov 2022 11:01:34 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id AF1571000FC; Tue, 15 Nov 2022 11:01:32 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1668528092; bh=2c4vxEWh58nSjRkv2QKs+FnInEYl2nWPYfyReJsqdDg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=CzBRktKAbE6/Yo9gu0kJ7JHDrZSwffgQuO03dlIrjbJ05GIjQGQ9DElfWFgj3tkG3 qD3BYYkLtWEsfy4PdipgTniRGjMbpjQQayChfNi+CS+AveW0juRTHIAlLiW5v3Y7E1 0aFU8pipLuD8D0C2zH1XGTxKxyles1QHNjm3rxi4T7TuklxwGp0ew/CTEAbcB+cOc5 8ZcsOVJmwS4/uEBiZymKtnNXJDuGlSkc4v/SP+2MpiVDntjsXVe88tmmIGUOKgdyqB qfJMF3rpLOxtG6Vi7kjNDTWdmL4eiMQIozoLtRx+NyVZf8hNtkqA+YNfdVBZceFBqD IRoKeazmqoqkg== Original-Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 5941A120F36; Tue, 15 Nov 2022 11:01:32 -0500 (EST) In-Reply-To: <83a64si7jo.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 15 Nov 2022 17:03:39 +0200") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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:299855 Archived-At: > I guess we need to report these to the developers of the Tree-sitter's > C parser? Is there anything else we could do until they fix > the parser? AFAIK the tree-sitter parser parses basically already-preprocessed C. It's wickedly hard to parse meaningfully notyet-preprocessed C with something based on a BNF grammar. So my guess is that this is going to be a "wont fix". There might be a way to handle it (basically by using the CPP definitions to extend the BNF grammar on the fly), but it seems difficult to include it into a parser based on compiling the BNF to a state machine :-( Stefan