Parse token type and style string. :param token_name: str name of Pygments token. Example: "Token.String" :param style_object: pygments.style.Style instance to use as base :param style_dict: dict of token names and their styles, customized to this cli
(token_name, style_object, style_dict)
| 47 | |
| 48 | |
| 49 | def parse_pygments_style(token_name, style_object, style_dict): |
| 50 | """Parse token type and style string. |
| 51 | |
| 52 | :param token_name: str name of Pygments token. Example: "Token.String" |
| 53 | :param style_object: pygments.style.Style instance to use as base |
| 54 | :param style_dict: dict of token names and their styles, customized to this cli |
| 55 | |
| 56 | """ |
| 57 | token_type = string_to_tokentype(token_name) |
| 58 | try: |
| 59 | other_token_type = string_to_tokentype(style_dict[token_name]) |
| 60 | return token_type, style_object.styles[other_token_type] |
| 61 | except AttributeError: |
| 62 | return token_type, style_dict[token_name] |
| 63 | |
| 64 | |
| 65 | def style_factory(name, cli_style): |
no outgoing calls
no test coverage detected