From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Arash Esbati Newsgroups: gmane.emacs.help Subject: Re: Python, syntax-ppss Date: Mon, 06 Feb 2023 12:53:36 +0100 Message-ID: <86v8kfqabj.fsf@gnu.org> References: <3cd4eda0-a795-073a-81fd-b128d4871aee@easy-emacs.de> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21431"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: help-gnu-emacs@gnu.org To: Andreas =?iso-8859-1?Q?R=F6hler?= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Feb 06 12:54:31 2023 Return-path: Envelope-to: geh-help-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 1pP04s-0005OM-Jm for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 06 Feb 2023 12:54:30 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pP04M-00008x-Mx; Mon, 06 Feb 2023 06:53:58 -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 1pP04I-00008K-Lg for help-gnu-emacs@gnu.org; Mon, 06 Feb 2023 06:53:56 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pP04H-0000wG-3K; Mon, 06 Feb 2023 06:53:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=cnm3PWVQBpqFlAYkWraxj8vnOWLMCarOQs1LeLvS/xE=; b=lAnbqYQ8VE1HxO8p6wkr 5C4mWCpmsjESdXJcwy832AQh0chsiq89FKxCFsNOt+3wEv1UKFSc6O6ukCkedNUZtRwI4zAyloBG8 UuovLhxzv2PB89I882XX/egeuIduGwZxIZZxo/TH6N+6o+Zo+1SRPS6AkHAwi1TSk7P7CTNK5xql8 FOuLReo6muXJzW9U234GEithCEO8oHg1IYhM6gevK/gmU7rLGA1xo2F88Y5+z5ibubHZXzmaZd04l UpeMX4AQzgycHNwq6iiZwoqnDKIKh1wRc8AAe0RQK3vJoF60GRqxljEknIt54NnZfEzVi1DoChY0L Xw4abcZ/BiCVCw==; Original-Received: from p5b326467.dip0.t-ipconnect.de ([91.50.100.103] helo=MUTANT) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pP04G-00051v-5h; Mon, 06 Feb 2023 06:53:52 -0500 In-Reply-To: <3cd4eda0-a795-073a-81fd-b128d4871aee@easy-emacs.de> ("Andreas =?iso-8859-1?Q?R=F6hler=22's?= message of "Mon, 6 Feb 2023 11:54:34 +0100") X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:142618 Archived-At: Andreas R=F6hler writes: > when calling (syntax-ppss) at the end of the Python snippet below, it yie= lds > > (1 6 7 34 nil nil 0 nil 8 (6) nil) > > whereas nth 1 --depth in parens--, should tell "2", as the opening > curly bracket should count too: > > --- > print(f"Addition: {m1 + m2 > --- The 34 says that the point is inside a string, more precisely, this is the character that will terminate the string[1] -- in this case " which has the codepoint 34. The parser doesn't count the depth in parens inside strings. Emacs sees only one open parentheses, and that in buffer position 6. Best, Arash Footnotes: [1] https://www.gnu.org/software/emacs/manual/html_node/elisp/Parser-State= .html