unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#67262: python-ts-mode cannot identify triple-quoted-strings
@ 2023-11-18 15:52 JD Smith
  2023-11-18 16:29 ` Eli Zaretskii
  0 siblings, 1 reply; 26+ messages in thread
From: JD Smith @ 2023-11-18 15:52 UTC (permalink / raw)
  To: 67262

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


Inside this triple-quoted string, in a python buffer:

a = """This is a test"""

python-mode yields (python-info-triple-quoted-string-p)=t, whereas python-ts-mode gives nil, defeating the fancy doc string folding both modes implement.

The reason seems to be that (syntax-ppss) returns something different in position 3 (which is "non-nil if inside a string”) between these modes: 

t for python-mode (which signals a triple quote)
 ?34=" in python-ts-mode 

If you first load python-mode, then load python-ts-mode, the syntax parse becomes equal between the modes, and this bug vanishes.  

python.el v0.28, Emacs v29.1

[-- Attachment #2: Type: text/html, Size: 1072 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2023-12-24  3:10 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-18 15:52 bug#67262: python-ts-mode cannot identify triple-quoted-strings JD Smith
2023-11-18 16:29 ` Eli Zaretskii
2023-11-18 17:18   ` JD Smith
2023-11-18 22:52     ` Dmitry Gutov
2023-11-25 10:01       ` Eli Zaretskii
2023-11-25 14:42         ` JD Smith
2023-11-26  2:04           ` Dmitry Gutov
2023-11-26 14:58             ` Dmitry Gutov
2023-11-26 23:43               ` Yuan Fu
2023-11-27  0:05                 ` Dmitry Gutov
2023-12-12  8:32                   ` Yuan Fu
2023-12-12 21:55                     ` Dmitry Gutov
2023-12-16 12:47                       ` Eli Zaretskii
2023-12-16 13:37                         ` Dmitry Gutov
2023-12-16 13:59                           ` Eli Zaretskii
2023-12-16 15:11                             ` JD Smith
2023-12-16 15:21                             ` Dmitry Gutov
2023-12-16 15:57                               ` Eli Zaretskii
2023-12-16 23:36                           ` Yuan Fu
2023-12-17 13:46                             ` Dmitry Gutov
2023-12-23  9:52                               ` Eli Zaretskii
2023-12-23 18:03                                 ` Yuan Fu
2023-12-23 21:01                                   ` Dmitry Gutov
2023-12-23 23:51                                     ` Yuan Fu
2023-12-24  0:45                                       ` Dmitry Gutov
2023-12-24  3:10                                         ` Yuan Fu

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).