[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#59816: [PATCH]: bug#59816: 29.0.60; c++-ts-mode handles one-line com
From: |
Theodor Thornhill |
Subject: |
bug#59816: [PATCH]: bug#59816: 29.0.60; c++-ts-mode handles one-line comments badly |
Date: |
Mon, 05 Dec 2022 13:44:49 +0100 |
Herman, Géza <geza.herman@gmail.com> writes:
> With the following simple program, emacs reports that "int a;" is in a
> comment:
>
> ---------------------
> void foo() {
> // c
> int a;
> }
> ---------------------
>
> Repro steps:
> - install tree-sitter-cpp available at
> https://github.com/tree-sitter/tree-sitter-cpp
> - copy the program above into a buffer
> - switch to c++-ts-mode
> - at the line "int a;", put the cursor at the 'i' (or anywhere in the line,
> exact position doesn't seem to matter)
> - M-: (nth 4 (syntax-ppss (point)))
>
> For me, this incorrectly returns "t". In c++-mode (without tree sitter), this
> correctly returns "nil".
>
You're right. This is my bad. This patch addresses it. What do you
think, Eli? BTW - I see that many modes in general don't refer to their
syntax-tables in their define-derived-mode form. Is that intentional?
Theo
0001-Fix-syntax-table-for-tree-sitter-modes.patch
Description: Text Data
bug#59816: 29.0.60; c++-ts-mode handles one-line comments badly, Alan Mackenzie, 2022/12/05
bug#59816: 29.0.60; c++-ts-mode handles one-line comments badly, Yuan Fu, 2022/12/07