From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Andreas_R=c3=b6hler?= Newsgroups: gmane.emacs.help Subject: Re: Python, syntax-ppss Date: Mon, 6 Feb 2023 14:43:22 +0100 Message-ID: <15736a52-9599-76d8-903d-4b9a7f101a31@easy-emacs.de> References: <3cd4eda0-a795-073a-81fd-b128d4871aee@easy-emacs.de> <86v8kfqabj.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18625"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Cc: help-gnu-emacs@gnu.org To: Arash Esbati Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Feb 06 14:44:16 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 1pP1n6-0004ea-M6 for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 06 Feb 2023 14:44:16 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pP1mN-0002eY-Au; Mon, 06 Feb 2023 08:43:31 -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 1pP1mM-0002eI-1L for help-gnu-emacs@gnu.org; Mon, 06 Feb 2023 08:43:30 -0500 Original-Received: from mout.kundenserver.de ([212.227.126.135]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pP1mK-0006AZ-BT; Mon, 06 Feb 2023 08:43:29 -0500 Original-Received: from [192.168.178.61] ([89.247.171.254]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1M6UqP-1pVNQb3Lr7-006vJk; Mon, 06 Feb 2023 14:43:24 +0100 Content-Language: en-US In-Reply-To: <86v8kfqabj.fsf@gnu.org> X-Provags-ID: V03:K1:eY5disWFjueKVctNzPf2Q5FQDfM5VrtSEJMR6E+JevJ34aywj+g yBqEyo3TAV5733/f4wDEGbXrxpZ/fWwWaYlAEhWMYhIP3mPWKUIUNeFsk4vA3mayNXg99tj ug3YtIM3gGiGmRwziJ0peM0DXqO/7QBgWALKCjHkSIUKNNJdQWtpEng28rs8Rc6Wx8OXSw/ 1b3xSCbrZl7E+A8wkD8BA== UI-OutboundReport: notjunk:1;M01:P0:obChTJ4V3Ww=;nH+JJo2Q4y/nZDY4ixaxrkKC0qc pilw8OCxA82d7IeStAh/WLh/nRqdky4d/USLUADNAkYsL52R2j9uGV4ENu8xyhVK5fZBRD6TA aNSoZynObL/ML5yn5TFtSMV8IL7SBC4xxlQZIrA6jljrXDKw8P7KszYP/C0UOt5yOsABGiCGx ro85AG+CQ1bPVMYmvVddR+nBLnvKDeFRJKIpia270zJV953g+M6Km7uZL8+5KcyolRqcm7g2P 6HPOks35hMv1TSn+uTu2PUiAKh1QM3vqJKvxV0Z+zzCyVHASbTQPeGeTT5lIzZV/oTeHELa2Y rgReoUBxNdeV94UgYYTB1MQFenrZK9rXeoVxYP0X3vr6MZM7xDxBbHwWdrZiqLwjY0mSfVUDq UuPKFU7nKctawElaWukTig5GtMGeL77cIMasKlvELgeFbGkNtZXWkJ2fa2cYO8ZorzKNoEzGe NcH4VvmB9ygBkQzrUaumqZ3b51qRVoTCoHZij90L8s2bVx+xtJFAROdURAeK71gppezfggAZG Mzo/hUCWdlJSiT30vz1mkDcJzbp/o8Ij8/g6Y+mwTqmqtM78qbmLZpNTOn9KbuOe90kI39EmY yTGNowP9sxbKisnXXlhI0hp9nhXewtQl/OphTl0wIu2f/X6fuJLDYc8lkNiEfn6eVTAh9wdSx r/pEjB4rh/y4XsVu5YOa1AfKq7MyYQDP2WIhQZqNfg== Received-SPF: none client-ip=212.227.126.135; envelope-from=andreas.roehler@easy-emacs.de; helo=mout.kundenserver.de X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, NICE_REPLY_A=-1.148, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:142622 Archived-At: Am 06.02.23 um 12:53 schrieb Arash Esbati: > Andreas Röhler writes: > >> when calling (syntax-ppss) at the end of the Python snippet below, it yields >> >> (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 Thanks. So I have to provide some extra checks for this case.