mirror of
https://github.com/python/cpython.git
synced 2025-11-09 10:01:42 +00:00
[3.14] gh-134953: Expand theming for True/False/None (GH-135000) (#138928)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl>
This commit is contained in:
parent
19a8670d7a
commit
dc4d016e7e
3 changed files with 6 additions and 0 deletions
|
|
@ -176,6 +176,7 @@ class Argparse(ThemeSection):
|
|||
class Syntax(ThemeSection):
|
||||
prompt: str = ANSIColors.BOLD_MAGENTA
|
||||
keyword: str = ANSIColors.BOLD_BLUE
|
||||
keyword_constant: str = ANSIColors.BOLD_BLUE
|
||||
builtin: str = ANSIColors.CYAN
|
||||
comment: str = ANSIColors.RED
|
||||
string: str = ANSIColors.GREEN
|
||||
|
|
|
|||
|
|
@ -196,6 +196,9 @@ def gen_colors_from_token_stream(
|
|||
is_def_name = False
|
||||
span = Span.from_token(token, line_lengths)
|
||||
yield ColorSpan(span, "definition")
|
||||
elif token.string in ("True", "False", "None"):
|
||||
span = Span.from_token(token, line_lengths)
|
||||
yield ColorSpan(span, "keyword_constant")
|
||||
elif keyword.iskeyword(token.string):
|
||||
span = Span.from_token(token, line_lengths)
|
||||
yield ColorSpan(span, "keyword")
|
||||
|
|
|
|||
|
|
@ -0,0 +1,2 @@
|
|||
Expand ``_colorize`` theme with ``keyword_constant`` and implement in
|
||||
:term:`repl`.
|
||||
Loading…
Add table
Add a link
Reference in a new issue