bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#67262: python-ts-mode cannot identify triple-quoted-strings


From: JD Smith
Subject: bug#67262: python-ts-mode cannot identify triple-quoted-strings
Date: Sat, 18 Nov 2023 10:52:05 -0500


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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]