From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#61403: 30.0.50; C tree-sitter bug? Date: Sun, 12 Feb 2023 10:56:30 +0200 Message-ID: <835yc7i7nl.fsf@gnu.org> References: <97E6246E-51E7-4F41-BCD0-AF63834FF3BD@gmail.com> <871qmv1ds5.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33407"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 61403@debbugs.gnu.org, casouri@gmail.com To: Po Lu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Feb 12 09:58:25 2023 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 1pR8Bk-0008KD-Sc for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 12 Feb 2023 09:58:25 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pR8BQ-00026F-2c; Sun, 12 Feb 2023 03:58: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 1pR8BO-00025y-EZ for bug-gnu-emacs@gnu.org; Sun, 12 Feb 2023 03:58:02 -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 1pR8BO-0007hW-6B for bug-gnu-emacs@gnu.org; Sun, 12 Feb 2023 03:58:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pR8BO-0008UY-1w for bug-gnu-emacs@gnu.org; Sun, 12 Feb 2023 03:58:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 12 Feb 2023 08:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61403 X-GNU-PR-Package: emacs Original-Received: via spool by 61403-submit@debbugs.gnu.org id=B61403.167619222832560 (code B ref 61403); Sun, 12 Feb 2023 08:58:02 +0000 Original-Received: (at 61403) by debbugs.gnu.org; 12 Feb 2023 08:57:08 +0000 Original-Received: from localhost ([127.0.0.1]:44022 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pR8AV-0008T6-Ih for submit@debbugs.gnu.org; Sun, 12 Feb 2023 03:57:07 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:50452) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pR8AR-0008SZ-LI for 61403@debbugs.gnu.org; Sun, 12 Feb 2023 03:57:06 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pR8AM-0007cC-E4; Sun, 12 Feb 2023 03:56:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=kf812SMAE3YSpWAQ0XNBta0slSt9Xzb+en9oqwrDB/s=; b=WzVvtmHOMYSL UhWUL/DK6tVmP4mRxfZH+oQe7S3h3PSMhWXBW5JE8iBtA7UTKeTpfEdMjDV7572QWFmiDZO9cRBgD 3TWf3j8RhTNoeizSVvhBFCY5iu/prpxHrHjQ7/6rcZR1FJz+X1oPt/XJxfXUw7aAWJ2sdMDlx2SON gdK1+3YCuhMtI6YF10n/BBFS/l59C+PIpYck6pauyLPkTKywVif6RorkzQvIhNkiFIQDm0OoI7Huv TxOZ9RcG3ufoRzsNAPiD+q6/L495rR8sVeXzum2w/smMf5wtiepa2Q/haWpL1h1Z0a4xcwWYJa3lZ YYIbxP5fHsT/rbdM7hSy8A==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pR8AL-0008L0-LG; Sun, 12 Feb 2023 03:56:57 -0500 In-Reply-To: <871qmv1ds5.fsf@yahoo.com> (bug-gnu-emacs@gnu.org) 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:255389 Archived-At: > Cc: 61403@debbugs.gnu.org > Date: Sun, 12 Feb 2023 16:36:10 +0800 > From: Po Lu via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > Yuan Fu writes: > > > Po Lu writes: > > > >> Go to sfnt.c in the feature/android branch, and turn on c-ts-mode. > >> > >> Then, go to line 10754, around which should be the function definition: > >> > >> /* Load the simple glyph GLYPH into the specified INTERPRETER, scaling > >> it up by INTERPRETER's scale, and run its glyph program if > >> present. Use the unscaled metrics specified in METRICS. > >> > >> Upon success, return NULL and the resulting points and contours in > >> *VALUE. Else, value is the reason interpretation failed. */ > >> > >> TEST_STATIC const char * > >> sfnt_interpret_simple_glyph (struct sfnt_glyph *glyph, > >> struct sfnt_interpreter *interpreter, > >> struct sfnt_glyph_metrics *metrics, > >> struct sfnt_instructed_outline **value) > >> { > >> size_t zone_size, temp, outline_size, i; > >> struct sfnt_interpreter_zone *zone; > >> struct sfnt_interpreter_zone *volatile preserved_zone; > >> sfnt_f26dot6 phantom_point_1_x; > >> > >> `TEST_STATIC' is fontified as a type. Perhaps tree-sitter needs > >> something along the lines of `c-noise-macros'? > > > > Would it be reasonable to assume that all caps "type" are almost always > > macros? If it is, we can optionally defontify these kind of "types". > > Not really, because an extremely common type is: > > PTR_T *ptr; > > where ``PTR_T'' is used to represent pointers on systems that may lack > properly working pointers to void. > > The standard library FILE * is also one such type with a capitalized > name. I admit I don't understand the problem that is the subject of this bug. Why is it wrong to fontify TEST_STATIC as a type? CC mode also fontifies it as a type, btw. The only problem I see in what c-ts-mode does is that it does NOT fontify 'char', whereas CC mode does. So if anything needs to be done here, we need to look into why 'char' is not fontified by c-ts-mode. Or what am I missing?