diff --git a/CHANGELOG.md b/CHANGELOG.md index 24f0ddfe..0ebebabd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [10.1.1] - Unreleased + +### Added + +- Added syntax for call, i.e. "Foo(bar)" will highlight Foo.pyth + ## [10.1.0] - 2020-04-03 ### Fixed diff --git a/rich/default_styles.py b/rich/default_styles.py index 1e87d6ae..4cdc3cb0 100644 --- a/rich/default_styles.py +++ b/rich/default_styles.py @@ -82,6 +82,9 @@ DEFAULT_STYLES: Dict[str, Style] = { "repr.none": Style(color="magenta", italic=True), "repr.url": Style(underline=True, color="bright_blue", italic=False, bold=False), "repr.uuid": Style(color="bright_yellow", bold=False), + "repr.call": Style(color="bright_magenta"), + "repr.path": Style(color="magenta"), + "repr.filename": Style(color="bright_magenta"), "rule.line": Style(color="bright_green"), "rule.text": Style.null(), "prompt": Style.null(), @@ -94,8 +97,6 @@ DEFAULT_STYLES: Dict[str, Style] = { "scope.key": Style(color="yellow", italic=True), "scope.key.special": Style(color="yellow", italic=True, dim=True), "scope.equals": Style(color="red"), - "repr.path": Style(color="magenta"), - "repr.filename": Style(color="bright_magenta"), "table.header": Style(bold=True), "table.footer": Style(bold=True), "table.cell": Style.null(), diff --git a/rich/highlighter.py b/rich/highlighter.py index c2ee7cc7..9a050db8 100644 --- a/rich/highlighter.py +++ b/rich/highlighter.py @@ -83,12 +83,13 @@ class ReprHighlighter(RegexHighlighter): highlights = [ r"(?P\<)(?P[\w\-\.\:]*)(?P.*?)(?P\>)", r"(?P[\w_]{1,50})=(?P\"?[\w_]+\"?)?", + r"(?P[\{\[\(\)\]\}])", _combine_regex( r"(?P[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})", r"(?P([A-Fa-f0-9]{1,4}::?){1,7}[A-Fa-f0-9]{1,4})", r"(?P(?:[0-9A-Fa-f]{1,2}-){7}[0-9A-Fa-f]{1,2}|(?:[0-9A-Fa-f]{1,2}:){7}[0-9A-Fa-f]{1,2}|(?:[0-9A-Fa-f]{4}\.){3}[0-9A-Fa-f]{4})", r"(?P(?:[0-9A-Fa-f]{1,2}-){5}[0-9A-Fa-f]{1,2}|(?:[0-9A-Fa-f]{1,2}:){5}[0-9A-Fa-f]{1,2}|(?:[0-9A-Fa-f]{4}\.){2}[0-9A-Fa-f]{4})", - r"(?P[\{\[\(\)\]\}])", + r"(?P[\w\.]*?)\(", r"(?PTrue)|(?PFalse)|(?PNone)", r"(?P\.\.\.)", r"(?P(?