Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python lexer not working as expected on docstrings #1999

Open
nicoa opened this issue Oct 9, 2023 · 0 comments
Open

python lexer not working as expected on docstrings #1999

nicoa opened this issue Oct 9, 2023 · 0 comments
Labels
bugfix-request A request for a bugfix to be developed.

Comments

@nicoa
Copy link

nicoa commented Oct 9, 2023

Hey everybody, we observed the below problem in python lexing on gitlab:

Name of the lexer
python

Code sample

def foo(
    bar,
    optional=None,
):
    """Docstring.

    Parameters
    ----------
    foo : str
        FOO.
    bar : str
        BAR!

    Example
    -------
    >>> import foo as bar
    >>>
    >>> asdf = '''
    >>> 
    >>> '''
    >>> bar()

    """
    # foobar
    print(foo)

Link to sample parsed: code sample.

Additional context
The last two lines shouldn't be formatted as a comment, but rather as actual code. As seems as if either the ------ lines or the multiline comment using ' within the multiline comment using " seems to cause problems.

@nicoa nicoa added the bugfix-request A request for a bugfix to be developed. label Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix-request A request for a bugfix to be developed.
Projects
None yet
Development

No branches or pull requests

1 participant