unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#67529: 29.1; Python: syntax category of code in f-strings marked as string
@ 2023-11-29 16:10 Daniel Fleischer
  0 siblings, 0 replies; only message in thread
From: Daniel Fleischer @ 2023-11-29 16:10 UTC (permalink / raw)
  To: 67529


Hi, in python f-strings can have python code inside them:

f"Two plus two is {2+2}"
f"The value of a is {a}"
f"The first item in arr is {arr[0]}"

The function `python--font-lock-f-strings` correctly fontify 
what's inside the
{} as code.  

However syntax analysis show the content inside {} as string; run
`(syntax-ppss-context (syntax-ppss (point)))` to see. 

This has semantic implications, for example the package 
`smart-scan` can jump
between occurrences of a symbol but it won't identify the symbol 
in a
string/comment. Maybe there are other packages which use this 
syntax
information. 

Daniel





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-11-29 16:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-29 16:10 bug#67529: 29.1; Python: syntax category of code in f-strings marked as string Daniel Fleischer

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).