all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Vincenzo Pupillo <v.pupillo@gmail.com>
To: Yuan Fu <casouri@gmail.com>, Eli Zaretskii <eliz@gnu.org>
Cc: 71518@debbugs.gnu.org
Subject: bug#71518: 30.0.50; Errors during redisplay with c++-ts-mode
Date: Sat, 22 Jun 2024 16:42:09 +0200	[thread overview]
Message-ID: <4884041.OV4Wx5bFTl@fedora> (raw)
In-Reply-To: <86wmmhidrw.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 3029 bytes --]

Hi Eli,
fortunately, this time it was easier than usual!

Ciao.
Vincenzo

In data sabato 22 giugno 2024 10:26:43 CEST, Eli Zaretskii ha scritto:
> Ping!  Any progress with this bug?
> 
> > From: Yuan Fu <casouri@gmail.com>
> > Date: Wed, 12 Jun 2024 23:51:21 -0700
> > Cc: 71518@debbugs.gnu.org,
> > 
> >  Bug Report Emacs <bug-gnu-emacs@gnu.org>,
> >  Eli Zaretskii <eliz@gnu.org>
> >  
> > > On Jun 12, 2024, at 6:53 AM, Vincenzo Pupillo <vincenzo.pupillo@lpsd.it>
> > > wrote:> > 
> > > In data mercoledì 12 giugno 2024 14:33:17 CEST, Eli Zaretskii ha 
scritto:
> > >> To reproduce in "emacs -Q", visit some C++ source file (I used
> > >> breakpoint.c from the GDB sources), then turn on c++-ts-mode.  The
> > >> fontification is all incorrect, and *Messages* has these error
> > >> 
> > >> messages:
> > >>  Error during redisplay: (jit-lock-function 7286) signaled
> > >>  (treesit-query-error "Node type error at" 575 "[\"_Atomic\" \"break\"
> > >>  \"case\" \"const\" \"continue\" \"default\" \"do\" \"else\" \"enum\"
> > >>  \"extern\" \"for\" \"goto\" \"if\" \"inline\" \"register\"
> > >>  \"restrict\" \"return\" \"sizeof\" \"static\" \"struct\" \"switch\"
> > >>  \"typedef\" \"union\" \"volatile\" \"while\" \"and\" \"and_eq\"
> > >>  \"bitand\" \"bitor\" \"catch\" \"class\" \"co_await\" \"co_return\"
> > >>  \"co_yield\" \"compl\" \"concept\" \"consteval\" \"constexpr\"
> > >>  \"constinit\" \"decltype\" \"delete\" \"explicit\" \"final\"
> > >>  \"friend\" \"mutable\" \"namespace\" \"new\" \"noexcept\" \"not\"
> > >>  \"not_eq\" \"operator\" \"or\" \"or_eq\" \"override\" \"private\"
> > >>  \"protected\" \"public\" \"requires\" \"template\" \"throw\" \"try\"
> > >>  \"typename\" \"using\" \"virtual\" \"xor\" \"xor_eq\"]
> > >>  @font-lock-keyword-face (auto) @font-lock-keyword-face (this)
> > >>  @font-lock-keyword-face" "Debug the query with
> > >>  `treesit-query-validate'")> >> 
> > >> This happens with the latest C++ tree-sitter grammar library.  I guess
> > >> they made some incompatible change in the grammar or something?
> > > 
> > > Yes, they changed the grammar.
> > > https://github.com/tree-sitter/tree-sitter-cpp/issues/271
> > > 
> > > V.
> > 
> > So it seems “virtual” is now a named node rather than an anonymous node,
> > which is a little odd. I asked the author about it in the GitHub issue,
> > let me clear that up before fixing c-ts-mode.
> > 
> > And, Eli, we really really should pin tree-sitter grammars. As more people
> > start using tree-sitter modes, they will found out about the breakage
> > before we do and the tree-sitter major mode would be unusable for them
> > before they upgrade their grammar. Most of them will not know how to do
> > it and which commit to downgrade to. And I really don’t want to chase the
> > random changes these grammars make all the time. Fixing for these
> > breakages is arguably a heavier maintenance burden than pinning
> > tree-sitter grammars.
> > 
> > Yuan


[-- Attachment #2: 0001-Fix-for-grammar-change-of-keyword-virtual-in-tree-si.patch --]
[-- Type: text/x-patch, Size: 1446 bytes --]

From 84c0c0c821b82d59874996cb7bb78e8205fa1377 Mon Sep 17 00:00:00 2001
From: Vincenzo Pupillo <v.pupillo@gmail.com>
Date: Sat, 22 Jun 2024 16:22:16 +0200
Subject: [PATCH] Fix for grammar change of keyword "virtual" in
 tree-sitter-cpp

* lisp/progmodes/c-ts-mode.el (c-ts-mode--keywords):
  Removed the keyword "virtual".
* lisp/progmodes/c-ts-mode.el (c-ts-mode--font-lock-settings):
  New font lock rule.
---
 lisp/progmodes/c-ts-mode.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el
index f453392ff7f..7bfb84baecb 100644
--- a/lisp/progmodes/c-ts-mode.el
+++ b/lisp/progmodes/c-ts-mode.el
@@ -572,7 +572,7 @@ c-ts-mode--keywords
                   "not" "not_eq" "operator" "or"
                   "or_eq" "override" "private" "protected"
                   "public" "requires" "template" "throw"
-                  "try" "typename" "using" "virtual"
+                  "try" "typename" "using"
                   "xor" "xor_eq"))
       (append '("auto") c-keywords))))
 
@@ -632,7 +632,8 @@ c-ts-mode--font-lock-settings
 
    :language mode
    :feature 'keyword
-   `([,@(c-ts-mode--keywords mode)] @font-lock-keyword-face
+   `((virtual) @font-lock-keyword-face
+     [,@(c-ts-mode--keywords mode)] @font-lock-keyword-face
      ,@(when (eq mode 'cpp)
          '((auto) @font-lock-keyword-face
            (this) @font-lock-keyword-face)))
-- 
2.45.2


  reply	other threads:[~2024-06-22 14:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-12 12:33 bug#71518: 30.0.50; Errors during redisplay with c++-ts-mode Eli Zaretskii
2024-06-12 13:53 ` Vincenzo Pupillo
2024-06-13  6:51   ` Yuan Fu
2024-06-13  8:24     ` Eli Zaretskii
2024-06-13  8:57     ` Vincenzo Pupillo
2024-06-22  8:26     ` Eli Zaretskii
2024-06-22 14:42       ` Vincenzo Pupillo [this message]
2024-06-22 15:57         ` Eli Zaretskii
2024-06-22 16:14           ` Vincenzo Pupillo
2024-06-22 16:56             ` Eli Zaretskii
2024-06-22 17:03               ` Eli Zaretskii
2024-06-22 17:59                 ` Vincenzo Pupillo
2024-06-22 18:15                   ` Eli Zaretskii
2024-06-22 18:15                   ` Vincenzo Pupillo
2024-06-22 18:19                     ` Eli Zaretskii
2024-06-22 23:18                       ` Yuan Fu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4884041.OV4Wx5bFTl@fedora \
    --to=v.pupillo@gmail.com \
    --cc=71518@debbugs.gnu.org \
    --cc=casouri@gmail.com \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.