From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Perry E. Metzger" Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Re: cc-mode fontification feels random Date: Mon, 30 Aug 2021 15:03:43 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4963"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:92.0) Gecko/20100101 Thunderbird/92.0 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Aug 30 21:05:18 2021 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 1mKmas-00012m-Jr for ged-emacs-devel@m.gmane-mx.org; Mon, 30 Aug 2021 21:05:18 +0200 Original-Received: from localhost ([::1]:60892 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mKmaq-00086R-IM for ged-emacs-devel@m.gmane-mx.org; Mon, 30 Aug 2021 15:05:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48504) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mKmZP-0006RP-Pa for emacs-devel@gnu.org; Mon, 30 Aug 2021 15:03:47 -0400 Original-Received: from hacklheber.piermont.com ([2001:470:30:84:e276:63ff:fe62:3400]:36026) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mKmZM-000554-BP for emacs-devel@gnu.org; Mon, 30 Aug 2021 15:03:47 -0400 Original-Received: from snark.cb.piermont.com (localhost [127.0.0.1]) by hacklheber.piermont.com (Postfix) with ESMTP id 85EB719E for ; Mon, 30 Aug 2021 15:03:43 -0400 (EDT) Original-Received: from [10.160.2.107] (jabberwock.cb.piermont.com [10.160.2.107]) by snark.cb.piermont.com (Postfix) with ESMTP id 552482DEC66 for ; Mon, 30 Aug 2021 15:03:43 -0400 (EDT) Content-Language: en-US In-Reply-To: Received-SPF: pass client-ip=2001:470:30:84:e276:63ff:fe62:3400; envelope-from=perry@piermont.com; helo=hacklheber.piermont.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, NICE_REPLY_A=-0.932, 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.23 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" Xref: news.gmane.io gmane.emacs.devel:273534 Archived-At: On 8/30/21 14:50, Alan Mackenzie wrote: >> For years and years now, I've been thinking we just need more >> deterministic parser-and-based mode support, and I still think that, but >> on a realistic level, that doesn't seem to be coming any time soon. I note that Tree Sitter integration is in active development now... > >> In the meantime, is there any general approach we might be able to use >> to get stuff like the attached to stop happening? > Here, "stuff like the attached" was having some types correctly > fontified, others not. This was due to the order, somewhat random, in > which a type is recognised as such and entered into a CC Mode table, and > its use being scanned in a jit-lock chunk. > > The following patch is an attempt to improve this situation. I think we are inevitably hitting the wall here, because it is not possible to parse a context free grammar with regular expressions. One can only move around the suck, one can't actually remove it without parsing the underlying language. Perry