Erotemic / xdoctest

A rewrite of Python's builtin doctest module (with pytest plugin integration) with AST instead of REGEX.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Parsing Failure Case

Erotemic opened this issue · comments

I've found an odd failure case of the doctest parser. This last comment seems to break things, removing it allows for proper parsing.

def foo():
    """
    CommandLine:
        xdoctest -m ~/foo.py foo

    Example:
        >>> _, o = 0, 1
        >>> A = B = C = D = 1
        >>> cc_mask = [        # Y
        >>>     [ _, _, _, o, _, _, ],  # 0
        >>>     [ _, _, o, o, o, _, ],  # 1
        >>>     [ _, o, o, o, o, o, ],  # 2
        >>>     [ o, o, o, o, o, _, ],  # 3
        >>>     [ _, o, o, o, _, _, ],  # 4
        >>>     [ _, _, o, o, _, _, ],  # 5
        >>> # X:  0  1  2  3  4  5  6
        >>> ]
        >>> print(cc_mask)
    """
    pass

This syntax seems valid, so its probably a bug in xdoctest.

This issue may be fixed. Need to re-test.

This was fixed.