all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: JD Smith <jdtsmith@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Dmitry Gutov <dmitry@gutov.dev>, 67262@debbugs.gnu.org
Subject: bug#67262: python-ts-mode cannot identify triple-quoted-strings
Date: Sat, 25 Nov 2023 09:42:23 -0500	[thread overview]
Message-ID: <9B8C904A-3729-44AF-82F7-3BEA849F46D0@gmail.com> (raw)
In-Reply-To: <83v89qcfsb.fsf@gnu.org>

Bridging emacs syntax to treesitter in a robust way seems like it could be a subtle enterprise, so I’d prefer to leave that to one of the experts.  Right now the syntax-propertize-function in python-mode does one simple thing: ensure triple quotes are properly marked as strings.  Since the treesitter grammar doesn’t distinguish between different flavors of strings, something similar would still be needed, if we want to continue to treat various string flavors distinctly using syntax.  

Is moving all syntactification (beyond just font-lock) over to TS an explicit goal for all the *-ts-mode’s?

> On Nov 25, 2023, at 5:01 AM, Eli Zaretskii <eliz@gnu.org> wrote:
> 
>> Date: Sun, 19 Nov 2023 00:52:06 +0200
>> Cc: 67262@debbugs.gnu.org
>> From: Dmitry Gutov <dmitry@gutov.dev>
>> 
>> On 18/11/2023 19:18, JD Smith wrote:
>>>   (setq-local syntax-propertize-function 
>>> python-syntax-propertize-function)
>> 
>> This is not a bad choice, but even better would be to write a s-p-f 
>> based on the tree-sitter parse tree.
>> 
>> There are examples in ruby-ts-mode and js-ts-mode.
> 
> JD, would you like to try writing such a syntax-propertize-function?






  reply	other threads:[~2023-11-25 14:42 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=9B8C904A-3729-44AF-82F7-3BEA849F46D0@gmail.com \
    --to=jdtsmith@gmail.com \
    --cc=67262@debbugs.gnu.org \
    --cc=dmitry@gutov.dev \
    --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.