# Path: coconut/_pyparsing.py
#     PYPARSING_PACKAGE = "cPyparsing"
#     PYPARSING_INFO = "Cython cPyparsing v" + __version__
#         PYPARSING_PACKAGE = "pyparsing"
#         PYPARSING_INFO = "Python pyparsing v" + __version__
#         PYPARSING_PACKAGE = "cPyparsing"
#         PYPARSING_INFO = None
#     MODERN_PYPARSING = True
#     MODERN_PYPARSING = False
# USE_COMPUTATION_GRAPH = (
#     not MODERN_PYPARSING  # not yet supported
#     and not PYPY  # experimentally determined
# )
#     def fast_repr(cls):
# def set_fast_pyparsing_reprs():
# def unset_fast_pyparsing_reprs():
# def add_timing_to_method(cls, method_name, method):
# def collect_timing_info():
# def print_timing_info():
# class _timing_sentinel(object):
# 
# 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 coconut._pyparsing import lineno
from coconut.constants import (
    openindent,
    closeindent,
    taberrfmt,
    default_encoding,
    report_this_text,
)
import sys
            repr(arg) for arg in self.args if arg is not None
        ) + ")"


class CoconutSyntaxError(CoconutException):
    """Coconut SyntaxError."""

    def __init__(self, message, source=None, point=None, ln=None, extra=None):
        """Creates the Coconut SyntaxError."""
        self.args = (message, source, point, ln, extra)

    def message(self, message, source, point, ln, extra=None):
        """Creates a SyntaxError-like message."""
        if message is None:
            message = "parsing failed"
        if extra is not None:
            message += " (" + str(extra) + ")"
        if ln is not None:
            message += " (line " + str(ln) + ")"
        if source:
            if point is None:
                message += "\n" + " " * taberrfmt + clean(source)
            else:
                part = clean(source.splitlines()[lineno(point, source) - 1], False).lstrip()
                point -= len(source) - len(part)  # adjust all points based on lstrip
                part = part.rstrip()  # adjust only points that are too large based on rstrip
                message += "\n" + " " * taberrfmt + part
                if point > 0:
                    if point >= len(part):
                        point = len(part) - 1

# Path: coconut/_pyparsing.py
#     PYPARSING_PACKAGE = "cPyparsing"
#     PYPARSING_INFO = "Cython cPyparsing v" + __version__
#         PYPARSING_PACKAGE = "pyparsing"
#         PYPARSING_INFO = "Python pyparsing v" + __version__
#         PYPARSING_PACKAGE = "cPyparsing"
#         PYPARSING_INFO = None
#     MODERN_PYPARSING = True
#     MODERN_PYPARSING = False
# USE_COMPUTATION_GRAPH = (
#     not MODERN_PYPARSING  # not yet supported
#     and not PYPY  # experimentally determined
# )
#     def fast_repr(cls):
# def set_fast_pyparsing_reprs():
# def unset_fast_pyparsing_reprs():
# def add_timing_to_method(cls, method_name, method):
# def collect_timing_info():
# def print_timing_info():
# class _timing_sentinel(object):
# 
# 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/exceptions.py
from coconut.root import *  # NOQA
from coconut._pyparsing import lineno
from coconut.constants import (
    openindent,
    closeindent,
    taberrfmt,
    default_encoding,
    report_this_text,
)
import sys

            repr(arg) for arg in self.args if arg is not None
        ) + ")"


class CoconutSyntaxError(CoconutException):
    """Coconut SyntaxError."""

    def __init__(self, message, source=None, point=None, ln=None, extra=None):
        """Creates the Coconut SyntaxError."""
        self.args = (message, source, point, ln, extra)

    def message(self, message, source, point, ln, extra=None):
        """Creates a SyntaxError-like message."""
        if message is None:
            message = "parsing failed"
        if extra is not None:
            message += " (" + str(extra) + ")"
        if ln is not None:
            message += " (line " + str(ln) + ")"
        if source:
            if point is None:
                message += "\n" + " " * taberrfmt + clean(source)
            else:
                part = clean(source.splitlines()[lineno(point, source) - 1], False).lstrip()
                point -= len(source) - len(part)  # adjust all points based on lstrip
                part = part.rstrip()  # adjust only points that are too large based on rstrip
                message += "\n" + " " * taberrfmt + part
                if point > 0:
                    if point >= len(part):
                        point = len(part) - 1

                    message += "\n" + " " * (taberrfmt + point) + "^"