Skip to content

Commit

Permalink
Add docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick91 committed Dec 31, 2021
1 parent a8ae7b5 commit de7ed16
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions rich/syntax.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,11 @@ def _get_token_color(self, token_type: TokenType) -> Optional[Color]:

@property
def lexer(self) -> Optional[Lexer]:
"""The lexer for this syntax, or None if no lexer was found.
Tries to find the lexer by name if a string was passed to the constructor.
"""

if isinstance(self._lexer, Lexer):
return self._lexer
try:
Expand Down

0 comments on commit de7ed16

Please sign in to comment.