From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#61403: 30.0.50; C tree-sitter bug? Date: Sun, 12 Feb 2023 16:36:10 +0800 Message-ID: <871qmv1ds5.fsf@yahoo.com> References: <97E6246E-51E7-4F41-BCD0-AF63834FF3BD@gmail.com> Reply-To: Po Lu Mime-Version: 1.0 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="3705"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 61403@debbugs.gnu.org To: Yuan Fu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Feb 12 09:39:28 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 1pR7tP-0000hU-Od for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 12 Feb 2023 09:39:27 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pR7t1-0008K6-L5; Sun, 12 Feb 2023 03:39:03 -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 1pR7t0-0008Jy-EX for bug-gnu-emacs@gnu.org; Sun, 12 Feb 2023 03:39: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 1pR7t0-0004J0-5L for bug-gnu-emacs@gnu.org; Sun, 12 Feb 2023 03:39:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pR7t0-0007xO-0F for bug-gnu-emacs@gnu.org; Sun, 12 Feb 2023 03:39:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 12 Feb 2023 08:39:01 +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.167619112630563 (code B ref 61403); Sun, 12 Feb 2023 08:39:01 +0000 Original-Received: (at 61403) by debbugs.gnu.org; 12 Feb 2023 08:38:46 +0000 Original-Received: from localhost ([127.0.0.1]:44001 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pR7sk-0007wt-Il for submit@debbugs.gnu.org; Sun, 12 Feb 2023 03:38:46 -0500 Original-Received: from sonic317-3.consmr.mail.ne1.yahoo.com ([66.163.184.230]:40371) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pR7sh-0007wY-4X for 61403@debbugs.gnu.org; Sun, 12 Feb 2023 03:38:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1676191115; bh=O9yighJ8mPzEd87SHVF6S80ReOWNx9Y0AcPrzxWBevc=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=XD1Te7fd8uLF3JHopfj4JfmYYIzqCsZ2gqqjD9+rwOzcx6Dq7imJUfBjOLvcHlJYKA7bOtsy1AwGLa4GQzH9WF1rSjjRmOacFm1iCEePjwriJO8F7NBX7qOEpipyUwwpDiG3YXkjIBfuUBzi8Y9pq5K8C4IBRE47yRE62TJe0Kn24WZOkdWfUyWyw697F0S1kW+RK2fU9rDmtcgPxJdnWVFbnHI0f+mHMT4fWlRFLq07mqXZLitS2wLDoY5FYUA9iov2+1vKJ7OIRFDmcCezLwak/F1DIV7BfwqcCFOjhTrMeRrsHFzbFcSqkSUPMtk3/7Phw7NV+rW18nNLIyMOSg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1676191115; bh=/lMGwYHStXF1ONJJSkNB6NyUhaMr6AWtK7USMby44L2=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=j+nIueOUNuLCs5Outsy0HfYttimhFSrsgBmwIlAUiTB773A8pYUGM+sjDIMR5S6idD/teM7j0ykXZ5fsVGd362Z/770VEserjn5HxzZY7TpvQbWQ5X1ESgGgIPz83f9fGeM48ScZQ7f28CepB2++kL02szmOnJEPJURMWF0o5auB88wPT8qbd70Ed8ajAOkBnDFBW7iFWkChI6Sxo33IT8wUBI9J4sPuV49y7wxLKrVgkGvRCZQwQYoSkgZQxNcVDi/WWKtIegcEqcotlzHUUaqO3oHpEgyWdQgmDY4DKMO0FSjzWQSVWHMIPBRFf0f8hABg3bmRtUeAe5HcmiFdzA== X-YMail-OSG: 5G1ae.8VM1l8b5RJhVmLrDLdW2td2AR5UNSD8Nb5LVAYoDl_lVQDKAIvpK_nBr8 0chNsCGN1N_oHiVkQkWtE.4f_0YW93_UvowyxqnMdzGN3Pvq64jDQV6YuGw0udsMkM5jkn0KCOdW VnAA0o_wo9_EtBXfT0AKAyjbmr648khchlaxIY7mbCZWCCB_ztLC07LzFbSYFg4D4PqZ_iHOzn5G vv8mHnBMdwIcd6TcxKCng4Z8JU.0xGCez1GRWa_5Wc3igdDDLoNMg_4TQqsY5_Yg5v8GNzijuTZg xk70l.bLHwa8Cyvx8o0fpd_r.r6hzc2NLsDVQm7F2dRT64EiLLOchp9KJwd7AhllnxxncayDo_KE w_qwjiAmeeHiIv0Zr.8k6tJmc03P0ztpGM7c6ELCTxcWwq95YofuIsT5QK.gTwWI3L_t.PiRrhV2 u.moqfnvNrw4ii0.Vo_NQIX3QEEd.zmZK9nMrbpnPHlYRb9M8hK35DQcAub5D6HD.DYT_Cv6.Zmo Ht8ba7f6WsYI3TDOiDOluaR3YAlEwKut5iX6ZRFjh0xG3Fg5IqpFbepsqeHAZejCay_7mxxPbVm4 KjsNaOvjqnzMRHFsintiiDCqM76rsYFR5hcxQ4hXbseFuwBnBVZeG57ByJhq.1bl4lLaGFvTKj0. jAhYzPW1PTsnzxpMQtTMaRvBIWJ1caVhWpeVP81Ats1kfDZqwLqEPC2YBWyIYOxPd0t.iD14UHA5 zB4eu6RM75SjDHu8oDFqPIRNESBbJEceTUQzTlNCIZsjiJ9u4CJE8Fl.enGWH0GHgt7AcZfa7Co7 BvR9qMMsKJV9bKZUtsfkOTyOmqH_jCaPwWOibr.mFr X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic317.consmr.mail.ne1.yahoo.com with HTTP; Sun, 12 Feb 2023 08:38:35 +0000 Original-Received: by hermes--production-sg3-9fc5746c8-z4gft (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 5e4f2efab8504a97215fd23ca7739581; Sun, 12 Feb 2023 08:36:33 +0000 (UTC) In-Reply-To: <97E6246E-51E7-4F41-BCD0-AF63834FF3BD@gmail.com> (Yuan Fu's message of "Sun, 12 Feb 2023 00:27:18 -0800") X-Mailer: WebService/1.1.21183 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo 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:255387 Archived-At: 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. >> >> Likewise for _Noreturn: >> >> _Noreturn static void >> sfnt_interpret_trap (struct sfnt_interpreter *interpreter, >> const char *reason) >> { >> >> _Noreturn is a keyword in 2011 Standard C. I think the tree-sitter >> parser definition files should be updated to understand it. > > Makes sense. I can file an issue on tree-sitter-c=E2=80=99s repo. Please do so, and thanks.