From unknown Tue Sep 09 21:32:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#60122: 29.0.60; c-ts-mode breaks with '"' separated macros Resent-From: Mohammed Sadiq Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 Dec 2022 14:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 60122 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 60122@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.167120235825210 (code B ref -1); Fri, 16 Dec 2022 14:53:02 +0000 Received: (at submit) by debbugs.gnu.org; 16 Dec 2022 14:52:38 +0000 Received: from localhost ([127.0.0.1]:49813 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p6C4k-0006YY-DU for submit@debbugs.gnu.org; Fri, 16 Dec 2022 09:52:38 -0500 Received: from lists.gnu.org ([209.51.188.17]:58250) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p6C4i-0006YS-3y for submit@debbugs.gnu.org; Fri, 16 Dec 2022 09:52:36 -0500 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 1p6C4h-0007sR-Ta for bug-gnu-emacs@gnu.org; Fri, 16 Dec 2022 09:52:35 -0500 Received: from relay9-d.mail.gandi.net ([217.70.183.199]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p6C4f-0000RG-Is for bug-gnu-emacs@gnu.org; Fri, 16 Dec 2022 09:52:35 -0500 Received: (Authenticated sender: sadiq@sadiqpk.org) by mail.gandi.net (Postfix) with ESMTPA id E69F4FF80C for ; Fri, 16 Dec 2022 14:52:26 +0000 (UTC) MIME-Version: 1.0 Date: Fri, 16 Dec 2022 20:22:26 +0530 From: Mohammed Sadiq Message-ID: <84db9d18bd013acbff59890f895e26f0@sadiqpk.org> X-Sender: sadiq@sadiqpk.org Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=217.70.183.199; envelope-from=sadiq@sadiqpk.org; helo=relay9-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.6 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) The following code is parsed wrong with c-ts-mode: #include int main (void) { GFileInfo *info; GFile *file; file = g_file_new_for_path ("some/path"); info = g_file_query_info (file, G_FILE_ATTRIBUTE_THUMBNAIL_IS_VALID "," G_FILE_ATTRIBUTE_THUMBNAILING_FAILED "," G_FILE_ATTRIBUTE_TIME_MODIFIED "," G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE, G_FILE_QUERY_INFO_NONE, NULL, NULL); } c-ts-mode doesn't assume G_FILE_ATTRIBUTE_THUMBNAIL_IS_VALID (and others) to be a string (or some function/macro call that results in a string) resulting in broken font locking and tab indentation. The same code seems to work fine with c-mode In GNU Emacs 29.0.60 (build 5, x86_64-pc-linux-gnu, GTK+ Version 3.24.35, cairo version 1.16.0) of 2022-12-16 built on purism Repository revision: f04680e067b04ccc9c37e709172c42bf34977ec8 Repository branch: emacs-29 Windowing system distributor 'The X.Org Foundation', version 11.0.12101004 System Description: Debian GNU/Linux bookworm/sid Configured using: 'configure --prefix=/usr' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB Important settings: value of $LANG: en_IN.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix Major mode: C Minor modes in effect: tooltip-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message mailcap yank-media puny dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util text-property-search time-date subr-x mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils cl-extra help-mode c-ts-mode treesit cl-seq cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs cl-loaddefs cl-lib rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit xinput2 x multi-tty make-network-process emacs) Memory information: ((conses 16 62400 10766) (symbols 48 7256 0) (strings 32 21008 2056) (string-bytes 1 750175) (vectors 16 13107) (vector-slots 8 185233 12037) (floats 8 30 215) (intervals 56 408 1) (buffers 984 12)) From unknown Tue Sep 09 21:32:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#60122: 29.0.60; c-ts-mode breaks with '"' separated macros Resent-From: Theodor Thornhill Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 Dec 2022 19:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60122 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Mohammed Sadiq Cc: 60122@debbugs.gnu.org, casouri@gmail.com Received: via spool by 60122-submit@debbugs.gnu.org id=B60122.167121904722647 (code B ref 60122); Fri, 16 Dec 2022 19:31:02 +0000 Received: (at 60122) by debbugs.gnu.org; 16 Dec 2022 19:30:47 +0000 Received: from localhost ([127.0.0.1]:51163 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p6GPu-0005tD-St for submit@debbugs.gnu.org; Fri, 16 Dec 2022 14:30:47 -0500 Received: from out-6.mta0.migadu.com ([91.218.175.6]:12961) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p6GPs-0005t6-21 for 60122@debbugs.gnu.org; Fri, 16 Dec 2022 14:30:45 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1671219042; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gTHCZ1StjXETTilpCay3kzI4jq+rUrgETAp7SBf6jWk=; b=pwDhIqL5dEUZISfOexh/5hrmzfjZNtrMpY50q3q3QQ6UG1qWLdiBKlsdN214m2N8vDLxcd sNdm4ubSQ596XYxn/Dq4FKeyP2b8Nyg3r9H3r/ghPYRZ5YE5oQPs4jywhHzK8pVRu06Fxb UKpZ/CHUBrNo2W4TJ78zXQrg+6YV9sfhaf6vEAxm4Oewx9M2M++i0Pp8HQURIU4QkJXOqd F7h3xSNwW03oLhPjqYqUqgYPqk8mbLmnpsWCnY1Q1A09jMMnItd5nnbnggvLL2kfP/CylO VM1uOvBio0JsrX/6dy6gRb6x/5yoi9hyItq8kc40iRXGCnQVF32zUqt7JIYUHQ== From: Theodor Thornhill In-Reply-To: <84db9d18bd013acbff59890f895e26f0@sadiqpk.org> (Mohammed Sadiq's message of "Fri, 16 Dec 2022 20:22:26 +0530") References: <84db9d18bd013acbff59890f895e26f0@sadiqpk.org> Date: Fri, 16 Dec 2022 20:30:39 +0100 Message-ID: <87cz8jrvs0.fsf@thornhill.no> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Flow: FLOW_OUT X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Mohammed Sadiq writes: > The following code is parsed wrong with c-ts-mode: > > > #include > > int > main (void) > { > GFileInfo *info; > GFile *file; > > file = g_file_new_for_path ("some/path"); > info = g_file_query_info (file, > G_FILE_ATTRIBUTE_THUMBNAIL_IS_VALID "," > G_FILE_ATTRIBUTE_THUMBNAILING_FAILED "," > G_FILE_ATTRIBUTE_TIME_MODIFIED "," > G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE, > G_FILE_QUERY_INFO_NONE, > NULL, NULL); > } > > > c-ts-mode doesn't assume G_FILE_ATTRIBUTE_THUMBNAIL_IS_VALID (and > others) to be a string (or some function/macro call that results in a > string) resulting in broken font locking and tab indentation. > > The same code seems to work fine with c-mode > Hi! If you use treesit-explore-mode, you can see that the tree-sitter parser returns this ast: (expression_statement (assignment_expression left: (identifier) operator: = right: (call_expression function: (identifier) arguments: (argument_list ( (identifier) , (identifier) (ERROR ") , (string_literal " (ERROR (identifier)) ") , (string_literal " (ERROR (identifier)) ") , (ERROR ") (identifier) , (identifier) , (null) , (null) )))) ;) Because tree-sitter fails to parse this there's only so much we can do. I think you should file this as a bug at the parser issue tracker over at github[0]. Maybe it's a known problem already? Theo [0]: https://github.com/tree-sitter/tree-sitter-c/issues From unknown Tue Sep 09 21:32:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#60122: 29.0.60; c-ts-mode breaks with '"' separated macros Resent-From: Mohammed Sadiq Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 17 Dec 2022 07:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60122 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Theodor Thornhill Cc: 60122@debbugs.gnu.org, casouri@gmail.com Received: via spool by 60122-submit@debbugs.gnu.org id=B60122.167126166914847 (code B ref 60122); Sat, 17 Dec 2022 07:22:01 +0000 Received: (at 60122) by debbugs.gnu.org; 17 Dec 2022 07:21:09 +0000 Received: from localhost ([127.0.0.1]:54322 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p6RVM-0003rP-Ny for submit@debbugs.gnu.org; Sat, 17 Dec 2022 02:21:08 -0500 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:56271) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p6RVG-0003qe-01 for 60122@debbugs.gnu.org; Sat, 17 Dec 2022 02:21:06 -0500 Received: (Authenticated sender: sadiq@sadiqpk.org) by mail.gandi.net (Postfix) with ESMTPA id D70FC60003; Sat, 17 Dec 2022 07:20:54 +0000 (UTC) MIME-Version: 1.0 Date: Sat, 17 Dec 2022 12:50:54 +0530 From: Mohammed Sadiq In-Reply-To: <87cz8jrvs0.fsf@thornhill.no> References: <84db9d18bd013acbff59890f895e26f0@sadiqpk.org> <87cz8jrvs0.fsf@thornhill.no> Message-ID: X-Sender: sadiq@sadiqpk.org Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On 2022-12-17 01:00, Theodor Thornhill wrote: > Mohammed Sadiq writes: > >> The following code is parsed wrong with c-ts-mode: >> >> >> #include >> >> int >> main (void) >> { >> GFileInfo *info; >> GFile *file; >> >> file = g_file_new_for_path ("some/path"); >> info = g_file_query_info (file, >> G_FILE_ATTRIBUTE_THUMBNAIL_IS_VALID "," >> G_FILE_ATTRIBUTE_THUMBNAILING_FAILED "," >> G_FILE_ATTRIBUTE_TIME_MODIFIED "," >> >> G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE, >> G_FILE_QUERY_INFO_NONE, >> NULL, NULL); >> } >> >> >> c-ts-mode doesn't assume G_FILE_ATTRIBUTE_THUMBNAIL_IS_VALID (and >> others) to be a string (or some function/macro call that results in a >> string) resulting in broken font locking and tab indentation. >> >> The same code seems to work fine with c-mode >> > > Hi! > > If you use treesit-explore-mode, you can see that the tree-sitter > parser > returns this ast: > > (expression_statement > (assignment_expression left: (identifier) operator: = > right: > (call_expression function: (identifier) > arguments: > (argument_list ( (identifier) , (identifier) > (ERROR ") > , > (string_literal " > (ERROR (identifier)) > ") > , > (string_literal " > (ERROR (identifier)) > ") > , > (ERROR ") > (identifier) , (identifier) , (null) , (null) )))) > ;) > > > Because tree-sitter fails to parse this there's only so much we can do. > > I think you should file this as a bug at the parser issue tracker over > at github[0]. Maybe it's a known problem already? > > Theo > > > [0]: https://github.com/tree-sitter/tree-sitter-c/issues I did notice that later and filed an issue: https://github.com/tree-sitter/tree-sitter-c/issues/120 cheers, Mohammed Sadiq From unknown Tue Sep 09 21:32:55 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Mohammed Sadiq Subject: bug#60122: closed (Re: bug#60122: 29.0.60; c-ts-mode breaks with '"' separated macros) Message-ID: References: <0F8DDD5B-F2B1-46D2-A0F1-8D938A574CB8@gmail.com> <84db9d18bd013acbff59890f895e26f0@sadiqpk.org> X-Gnu-PR-Message: they-closed 60122 X-Gnu-PR-Package: emacs Reply-To: 60122@debbugs.gnu.org Date: Sat, 07 Jan 2023 23:18:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1673133482-5750-1" This is a multi-part message in MIME format... ------------=_1673133482-5750-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #60122: 29.0.60; c-ts-mode breaks with '"' separated macros which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 60122@debbugs.gnu.org. --=20 60122: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D60122 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1673133482-5750-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 60122-done) by debbugs.gnu.org; 7 Jan 2023 23:17:27 +0000 Received: from localhost ([127.0.0.1]:59255 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEIRL-0001TT-3O for submit@debbugs.gnu.org; Sat, 07 Jan 2023 18:17:27 -0500 Received: from mail-pl1-f174.google.com ([209.85.214.174]:42589) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEIRJ-0001TD-4P for 60122-done@debbugs.gnu.org; Sat, 07 Jan 2023 18:17:25 -0500 Received: by mail-pl1-f174.google.com with SMTP id d9so5579898pll.9 for <60122-done@debbugs.gnu.org>; Sat, 07 Jan 2023 15:17:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:from:to:cc:subject:date:message-id :reply-to; bh=ygeA/8qb+zsKeICtSWvmbQ7AnTz/WHzMegoDXK2eGLA=; b=H82oYVcrj/pjHTYIO0D7A/y81l7guwnrTioifnJ3YFm7MB5N3hDUlKbGlSdbvZSxgb eVk61OmeBsL7nvdWS9fDbfvVsPscsesna5bVayG5/bYNnE9wgtQO5piEIG66DCTxudIx ix3wsIfv/aiFzpvJWspV3NQiBhdtkgI3SFi+xBsT5ZnelJFm/ON/jIYYiGt49OxeNbmH YTmw4QJgJMxnM08dHslbUg0vok9GX/ZoRGZbwi+XlLSo0skivUCkXTGBj9XfPadvwAY6 1RgKex/gTSeIn2D2rjihvtrfc7BrLse/beCv/qyyQdz1ugxZO81nYSjhc1DniWP6J6HX wkhw== 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=ygeA/8qb+zsKeICtSWvmbQ7AnTz/WHzMegoDXK2eGLA=; b=J1/JTU97m/zWQV7rITq+M0RrksXhZQhYwsZ+nxqyC9rlkAZl+9WK+vRaFOKa1X+OuP J7CaQ9AuaDq0o+GWkhcK05aGIaa/BoR6kSS9OLVL14A5sqsziCiDBLfT65DNYOdSb3en aMWT8sQnylQjtbEIunLk7GUyauTxPblkkm5zar3E4BYFJInfgzrFGzKsFf2Eqvm3Mlmn 5xtqPc73czfGxuLakDzOWXcAFdpUuxUIkkRWO+Q6Xcp1ny+kmZmwfTXPPs9Eo4/9YYJi sxI+AxCVD24WG8Jfbkn+QsAwCir07W3wZk/3k/H8nJnCeNqi66uEs+3VfRdOilNbKjW5 /31w== X-Gm-Message-State: AFqh2kp0/zJLgZweXem/19q8/zpJctwsYWFuW7B/0jL0qTuxjgbuTFuG j7P+nG8Bv22Njz2oFFA+eM9zWHI+PRWykQ== X-Google-Smtp-Source: AMrXdXtFrLhRGr7StkSXHb3gQ7M+dt6QrPuYwVNimgdWy8sIsUyUVm7oDqRgp6Yp/1SxqhXXQCjlbw== X-Received: by 2002:a17:90a:5891:b0:226:620b:6ae5 with SMTP id j17-20020a17090a589100b00226620b6ae5mr25775358pji.22.1673133439532; Sat, 07 Jan 2023 15:17:19 -0800 (PST) Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id az7-20020a17090b028700b00225e670e4c7sm2946254pjb.35.2023.01.07.15.17.18 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 Jan 2023 15:17:19 -0800 (PST) From: Yuan Fu Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: bug#60122: 29.0.60; c-ts-mode breaks with '"' separated macros Message-Id: <0F8DDD5B-F2B1-46D2-A0F1-8D938A574CB8@gmail.com> Date: Sat, 7 Jan 2023 15:17:18 -0800 To: Mohammed Sadiq X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60122-done Cc: 60122-done@debbugs.gnu.org, Theodor Thornhill X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Mohammed Sadiq writes: > On 2022-12-17 01:00, Theodor Thornhill wrote: >> Mohammed Sadiq writes: >>=20 >>> The following code is parsed wrong with c-ts-mode: >>> #include >>> int >>> main (void) >>> { >>> GFileInfo *info; >>> GFile *file; >>> file =3D g_file_new_for_path ("some/path"); >>> info =3D g_file_query_info (file, >>> G_FILE_ATTRIBUTE_THUMBNAIL_IS_VALID "," >>> G_FILE_ATTRIBUTE_THUMBNAILING_FAILED "," >>> G_FILE_ATTRIBUTE_TIME_MODIFIED "," >>> = G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE, >>> G_FILE_QUERY_INFO_NONE, >>> NULL, NULL); >>> } >>> c-ts-mode doesn't assume G_FILE_ATTRIBUTE_THUMBNAIL_IS_VALID (and >>> others) to be a string (or some function/macro call that results in = a >>> string) resulting in broken font locking and tab indentation. >>> The same code seems to work fine with c-mode >>>=20 >> Hi! >> If you use treesit-explore-mode, you can see that the tree-sitter >> parser >> returns this ast: >> (expression_statement >> (assignment_expression left: (identifier) operator: =3D >> right: >> (call_expression function: (identifier) >> arguments: >> (argument_list ( (identifier) , (identifier) >> (ERROR ") >> , >> (string_literal " >> (ERROR (identifier)) >> ") >> , >> (string_literal " >> (ERROR (identifier)) >> ") >> , >> (ERROR ") >> (identifier) , (identifier) , (null) , (null) )))) >> ;) >> Because tree-sitter fails to parse this there's only so much we can >> do. >> I think you should file this as a bug at the parser issue tracker >> over >> at github[0]. Maybe it's a known problem already? >> Theo >> [0]: https://github.com/tree-sitter/tree-sitter-c/issues > > > I did notice that later and filed an issue: > https://github.com/tree-sitter/tree-sitter-c/issues/120 Thanks. I=E2=80=99m closing this then. Yuan ------------=_1673133482-5750-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 16 Dec 2022 14:52:38 +0000 Received: from localhost ([127.0.0.1]:49813 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p6C4k-0006YY-DU for submit@debbugs.gnu.org; Fri, 16 Dec 2022 09:52:38 -0500 Received: from lists.gnu.org ([209.51.188.17]:58250) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p6C4i-0006YS-3y for submit@debbugs.gnu.org; Fri, 16 Dec 2022 09:52:36 -0500 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 1p6C4h-0007sR-Ta for bug-gnu-emacs@gnu.org; Fri, 16 Dec 2022 09:52:35 -0500 Received: from relay9-d.mail.gandi.net ([217.70.183.199]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p6C4f-0000RG-Is for bug-gnu-emacs@gnu.org; Fri, 16 Dec 2022 09:52:35 -0500 Received: (Authenticated sender: sadiq@sadiqpk.org) by mail.gandi.net (Postfix) with ESMTPA id E69F4FF80C for ; Fri, 16 Dec 2022 14:52:26 +0000 (UTC) MIME-Version: 1.0 Date: Fri, 16 Dec 2022 20:22:26 +0530 From: Mohammed Sadiq To: bug-gnu-emacs@gnu.org Subject: 29.0.60; c-ts-mode breaks with '"' separated macros Message-ID: <84db9d18bd013acbff59890f895e26f0@sadiqpk.org> X-Sender: sadiq@sadiqpk.org Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=217.70.183.199; envelope-from=sadiq@sadiqpk.org; helo=relay9-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.6 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) The following code is parsed wrong with c-ts-mode: #include int main (void) { GFileInfo *info; GFile *file; file = g_file_new_for_path ("some/path"); info = g_file_query_info (file, G_FILE_ATTRIBUTE_THUMBNAIL_IS_VALID "," G_FILE_ATTRIBUTE_THUMBNAILING_FAILED "," G_FILE_ATTRIBUTE_TIME_MODIFIED "," G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE, G_FILE_QUERY_INFO_NONE, NULL, NULL); } c-ts-mode doesn't assume G_FILE_ATTRIBUTE_THUMBNAIL_IS_VALID (and others) to be a string (or some function/macro call that results in a string) resulting in broken font locking and tab indentation. The same code seems to work fine with c-mode In GNU Emacs 29.0.60 (build 5, x86_64-pc-linux-gnu, GTK+ Version 3.24.35, cairo version 1.16.0) of 2022-12-16 built on purism Repository revision: f04680e067b04ccc9c37e709172c42bf34977ec8 Repository branch: emacs-29 Windowing system distributor 'The X.Org Foundation', version 11.0.12101004 System Description: Debian GNU/Linux bookworm/sid Configured using: 'configure --prefix=/usr' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB Important settings: value of $LANG: en_IN.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix Major mode: C Minor modes in effect: tooltip-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message mailcap yank-media puny dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util text-property-search time-date subr-x mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils cl-extra help-mode c-ts-mode treesit cl-seq cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs cl-loaddefs cl-lib rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit xinput2 x multi-tty make-network-process emacs) Memory information: ((conses 16 62400 10766) (symbols 48 7256 0) (strings 32 21008 2056) (string-bytes 1 750175) (vectors 16 13107) (vector-slots 8 185233 12037) (floats 8 30 215) (intervals 56 408 1) (buffers 984 12)) ------------=_1673133482-5750-1--