# Path: coconut/constants.py
# def fixpath(path):
# def str_to_bool(boolstr, default=False):
# WINDOWS = os.name == "nt"
# PYPY = platform.python_implementation() == "PyPy"
# CPYTHON = platform.python_implementation() == "CPython"
# PY32 = sys.version_info >= (3, 2)
# PY33 = sys.version_info >= (3, 3)
# PY34 = sys.version_info >= (3, 4)
# PY35 = sys.version_info >= (3, 5)
# PY36 = sys.version_info >= (3, 6)
# PY38 = sys.version_info >= (3, 8)
# PY310 = sys.version_info >= (3, 10)
# IPY = (
#     ((PY2 and not PY26) or PY35)
#     and not (PYPY and WINDOWS)
#     # necessary until jupyter-console fixes https://github.com/jupyter/jupyter_console/issues/245
#     and not PY310
# )
# MYPY = (
#     PY34
#     and not WINDOWS
#     and not PYPY
# )
# PURE_PYTHON = str_to_bool(os.environ.get(pure_python_env_var, ""))


from coconut.root import *  # NOQA
from pygments.lexers import Python3Lexer, PythonConsoleLexer
from pygments.token import Text, Operator, Keyword, Name, Number
from pygments.lexer import words, bygroups
from pygments.util import shebang_matches
from coconut.constants import (
    coconut_specific_builtins,
    new_operators,
    tabideal,
    default_encoding,
    code_exts,
    reserved_vars,
    shebang_regex,
    magic_methods,
    template_ext,
    exceptions,
)
    name = "coconut"
    aliases = ["coconut", "coco", "coc"]
    filenames = ["*" + ext for ext in code_exts]

    tokens = Python3Lexer.tokens.copy()
    tokens["root"] = [
        (r"|".join(new_operators), Operator),
        (
            r'(?<!\\)(:?match)?((?:\s|\\\s)+)(:?data)((?:\s|\\\s)+)',
            bygroups(Keyword, Text, Keyword, Text), py_str("classname"),
        ),
        (r'def(?=\s*\()', Keyword),
    ] + tokens["root"]
    tokens["keywords"] += [
        (words(reserved_vars, prefix=r"(?<!\\):?", suffix=r"\b"), Keyword),
    ]
    tokens["builtins"] += [
        (words(coconut_specific_builtins, suffix=r"\b"), Name.Builtin),
        (words(exceptions, suffix=r"\b"), Name.Exception),
    ]
    tokens["numbers"] = [
        (r"0b[01_]+", Number.Integer),
        (r"0o[0-7_]+", Number.Integer),
        (r"0x[\da-fA-F_]+", Number.Integer),
        (r"\d[\d_]*(\.\d[\d_]*)?((e|E)[\d_]+)?(j|J|i|I)?", Number.Integer),
    ] + tokens["numbers"]
    tokens["magicfuncs"] += [
        (words(magic_methods, suffix=r"\b"), Name.Function.Magic),
    ]


# Path: coconut/constants.py
# def fixpath(path):
# def str_to_bool(boolstr, default=False):
# WINDOWS = os.name == "nt"
# PYPY = platform.python_implementation() == "PyPy"
# CPYTHON = platform.python_implementation() == "CPython"
# PY32 = sys.version_info >= (3, 2)
# PY33 = sys.version_info >= (3, 3)
# PY34 = sys.version_info >= (3, 4)
# PY35 = sys.version_info >= (3, 5)
# PY36 = sys.version_info >= (3, 6)
# PY38 = sys.version_info >= (3, 8)
# PY310 = sys.version_info >= (3, 10)
# IPY = (
#     ((PY2 and not PY26) or PY35)
#     and not (PYPY and WINDOWS)
#     # necessary until jupyter-console fixes https://github.com/jupyter/jupyter_console/issues/245
#     and not PY310
# )
# MYPY = (
#     PY34
#     and not WINDOWS
#     and not PYPY
# )
# PURE_PYTHON = str_to_bool(os.environ.get(pure_python_env_var, ""))


# Path: coconut/highlighter.py
from coconut.root import *  # NOQA
from pygments.lexers import Python3Lexer, PythonConsoleLexer
from pygments.token import Text, Operator, Keyword, Name, Number
from pygments.lexer import words, bygroups
from pygments.util import shebang_matches
from coconut.constants import (
    coconut_specific_builtins,
    new_operators,
    tabideal,
    default_encoding,
    code_exts,
    reserved_vars,
    shebang_regex,
    magic_methods,
    template_ext,
    exceptions,
)

    name = "coconut"
    aliases = ["coconut", "coco", "coc"]
    filenames = ["*" + ext for ext in code_exts]

    tokens = Python3Lexer.tokens.copy()
    tokens["root"] = [
        (r"|".join(new_operators), Operator),
        (
            r'(?<!\\)(:?match)?((?:\s|\\\s)+)(:?data)((?:\s|\\\s)+)',
            bygroups(Keyword, Text, Keyword, Text), py_str("classname"),
        ),
        (r'def(?=\s*\()', Keyword),
    ] + tokens["root"]
    tokens["keywords"] += [
        (words(reserved_vars, prefix=r"(?<!\\):?", suffix=r"\b"), Keyword),
    ]
    tokens["builtins"] += [
        (words(coconut_specific_builtins, suffix=r"\b"), Name.Builtin),
        (words(exceptions, suffix=r"\b"), Name.Exception),
    ]
    tokens["numbers"] = [
        (r"0b[01_]+", Number.Integer),
        (r"0o[0-7_]+", Number.Integer),
        (r"0x[\da-fA-F_]+", Number.Integer),
        (r"\d[\d_]*(\.\d[\d_]*)?((e|E)[\d_]+)?(j|J|i|I)?", Number.Integer),
    ] + tokens["numbers"]
    tokens["magicfuncs"] += [
        (words(magic_methods, suffix=r"\b"), Name.Function.Magic),
    ]


    def __init__(self, stripnl=False, stripall=False, ensurenl=True, tabsize=tabideal, encoding=default_encoding):