"""
This type stub file was generated by pyright.
"""

import os
from IPython.utils.coloransi import TermColors
from .colorable import Colorable

"""
Class and program to colorize python source code for ANSI terminals.

Based on an HTML code highlighter by Jurgen Hermann found at:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52298

Modifications by Fernando Perez (fperez@colorado.edu).

Information on the original HTML highlighter follows:

MoinMoin - Python Source Parser

Title: Colorize Python source using the built-in tokenizer

Submitter: Jurgen Hermann
Last Updated:2001/04/06

Version no:1.2

Description:

This code is part of MoinMoin (http://moin.sourceforge.net/) and converts
Python source code to HTML markup, rendering comments, keywords,
operators, numeric and string literals in different colors.

It shows how to use the built-in keyword, token and tokenize modules to
scan Python source code and re-emit it with no changes to its original
formatting (which is the hard part).
"""
__all__ = ['ANSICodeColors', 'Parser']
_scheme_default = ...
generate_tokens = ...
_KEYWORD = ...
_TEXT = ...
Colors = TermColors
NoColor = ...
LinuxColors = ...
NeutralColors = ...
if os.name == 'nt':
    NeutralColors = ...
LightBGColors = ...
ANSICodeColors = ...
Undefined = ...
class Parser(Colorable):
    """ Format colored Python source.
    """
    def __init__(self, color_table=..., out=..., parent=..., style=...) -> None:
        """ Create a parser with a specified color table and output channel.

        Call format() to process code.
        """
        ...
    
    def format(self, raw, out=..., scheme=...):
        ...
    
    def format2(self, raw, out=...):
        """ Parse and send the colored source.

        If out and scheme are not specified, the defaults (given to
        constructor) are used.

        out should be a file-type object. Optionally, out can be given as the
        string 'str' and the parser will automatically return the output in a
        string."""
        ...
    
    def __call__(self, toktype, toktext, start_pos, end_pos, line): # -> None:
        """ Token handler, with syntax highlighting."""
        ...
    


