From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: JD Smith Newsgroups: gmane.emacs.bugs Subject: bug#67262: python-ts-mode cannot identify triple-quoted-strings Date: Sat, 25 Nov 2023 09:42:23 -0500 Message-ID: <9B8C904A-3729-44AF-82F7-3BEA849F46D0@gmail.com> References: <66A741A1-38B8-40C9-BE84-AF99F74A079F@gmail.com> <838r6vm3dj.fsf@gnu.org> <9bfc5e6f-3612-115f-a59d-35ad629bdf9e@gutov.dev> <83v89qcfsb.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.200.91.1.1\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28974"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Dmitry Gutov , 67262@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 25 15:43:08 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r6tsB-0007KM-Ma for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 25 Nov 2023 15:43:07 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r6ts3-0006Dl-Jk; Sat, 25 Nov 2023 09:42:59 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r6ts1-0006DP-Mo for bug-gnu-emacs@gnu.org; Sat, 25 Nov 2023 09:42:57 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r6ts1-00007u-Ej for bug-gnu-emacs@gnu.org; Sat, 25 Nov 2023 09:42:57 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r6ts6-0001SP-Gb for bug-gnu-emacs@gnu.org; Sat, 25 Nov 2023 09:43:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: JD Smith Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 25 Nov 2023 14:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67262 X-GNU-PR-Package: emacs Original-Received: via spool by 67262-submit@debbugs.gnu.org id=B67262.17009233685578 (code B ref 67262); Sat, 25 Nov 2023 14:43:02 +0000 Original-Received: (at 67262) by debbugs.gnu.org; 25 Nov 2023 14:42:48 +0000 Original-Received: from localhost ([127.0.0.1]:38256 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r6trs-0001Rt-15 for submit@debbugs.gnu.org; Sat, 25 Nov 2023 09:42:48 -0500 Original-Received: from mail-qt1-x835.google.com ([2607:f8b0:4864:20::835]:44431) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r6trq-0001Rg-Bg for 67262@debbugs.gnu.org; Sat, 25 Nov 2023 09:42:46 -0500 Original-Received: by mail-qt1-x835.google.com with SMTP id d75a77b69052e-41cd4cc515fso15538461cf.1 for <67262@debbugs.gnu.org>; Sat, 25 Nov 2023 06:42:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700923355; x=1701528155; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=dIuoqavLS6ieFo+4s9nlUxcmHM+w60AtzPdwEBfo9QU=; b=jQu+KeR4CyLNcz/N2grL8GU46+5uZzbex32VL7DwGlaZN8dEDy5uS13nC10cAvBnL8 S1IVEV5YEcW9NTa7tC7ElFfEDJmzNYGJzAtayo43ahL6fW2B3THGku+XF3nE1PmPTQw+ UnsIngLhMv3x7jfwex5n7h1pxabVuSjQoYcu/lSDZNYgeyYQSQLlOyXaujFhCUO7SJVe M41g+MiB1jeCsfDdTQcFVtpTIMe+pLmDKnAgtDIwQacfEg/2pVv+nx8xJCw/zm9C9D7X DxtsTbnXNgIQa3BM+36CsDMXhht6lkd1bmOmdDe2eZ9bSrEebPDRPVYtJY0q4oan6Lzi xbtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700923355; x=1701528155; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dIuoqavLS6ieFo+4s9nlUxcmHM+w60AtzPdwEBfo9QU=; b=h07eFs2V8arOEPUE2/Fz+yyvYl5CL4o2QWcjAmGQ5sg8E4JePzi168wcet4+elDXWN yLy8swXtGcU3U168ShTCjGXd0dypr9k0G3R8x5/RPfC5Je4Sgv8KXH+ipe5uWQzLkxos LgNJbo0jaAfds5tWowtr+qdi73/pIUhD3+jMajZkG/qwJerXP/tMxgl8mOqkMjz03alz VpW7crKq6FtT/C6vzSqDXi+lXlyHuQhJ7usJ0jAuDTM4FMNot6eMYBxI7YcJNnAlykR8 AewlJTsDWJmdp8VGnqIeBPwxjnLhx9XhFO9FsmE9+Hsvy9C2ViPXIeo3Exyyc7HbTmii qAPQ== X-Gm-Message-State: AOJu0Yx7iTvhUY4Z+X7ez/e10CLMd2YmGI32nLfxQDJ+p8H5t9pwVz7Z MyqVxC5TrTtkb3qV2DhxTHU= X-Google-Smtp-Source: AGHT+IGUZjEzf+PHT6wGiZZ5rUE3O9A/9z4GDHK83VzOnyF7p+cIfF4lfHbaO19ZrBK8R5iDav1uIQ== X-Received: by 2002:a05:622a:514:b0:421:f47f:d758 with SMTP id l20-20020a05622a051400b00421f47fd758mr8362303qtx.8.1700923355608; Sat, 25 Nov 2023 06:42:35 -0800 (PST) Original-Received: from smtpclient.apple (cm-24-53-187-34.buckeyecom.net. [24.53.187.34]) by smtp.gmail.com with ESMTPSA id z25-20020ac86b99000000b003f6ac526568sm2216670qts.39.2023.11.25.06.42.34 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Nov 2023 06:42:34 -0800 (PST) In-Reply-To: <83v89qcfsb.fsf@gnu.org> X-Mailer: Apple Mail (2.3774.200.91.1.1) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:274985 Archived-At: Bridging emacs syntax to treesitter in a robust way seems like it could = be a subtle enterprise, so I=E2=80=99d 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=E2=80=99t 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. =20 Is moving all syntactification (beyond just font-lock) over to TS an = explicit goal for all the *-ts-mode=E2=80=99s? > On Nov 25, 2023, at 5:01=E2=80=AFAM, Eli Zaretskii = wrote: >=20 >> Date: Sun, 19 Nov 2023 00:52:06 +0200 >> Cc: 67262@debbugs.gnu.org >> From: Dmitry Gutov >>=20 >> On 18/11/2023 19:18, JD Smith wrote: >>> (setq-local syntax-propertize-function=20 >>> python-syntax-propertize-function) >>=20 >> This is not a bad choice, but even better would be to write a s-p-f=20= >> based on the tree-sitter parse tree. >>=20 >> There are examples in ruby-ts-mode and js-ts-mode. >=20 > JD, would you like to try writing such a syntax-propertize-function?