0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00
Commit Graph

2 Commits

Author SHA1 Message Date
Doug Kearns
15070eee2f runtime(python): Update syntax, fix pythonEllipsis pattern
fixes: #18263
closes: #18264

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-09-11 13:54:51 -04:00
Jon Parise
77cfc49060 runtime(python): highlight ellipsis literals
The ellipsis literal (`...`) can be used in multiple contexts:

- Placeholders:     `class Foo: ...`
- Containers:       `Tuple[int, ...]`
- Assignments:      `x = ...`

This is a trickier pattern to match because we can't rely on keyword
boundaries, so we instead look for exactly three dots (`...`).

This does mean that we will match the `...` portion of `x...x`, which
isn't valid Python syntax, but I think that's an acceptable trade-off
that avoids making this pattern much more complex.

Reference:
- https://docs.python.org/3/library/constants.html#Ellipsis

closes: #18107

Signed-off-by: Jon Parise <jon@indelible.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-09-08 16:29:53 -04:00