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

Line continuation indent for triple-strings #45

Merged
merged 1 commit into from
Aug 16, 2024

Commits on Aug 16, 2024

  1. Line continuation indent for triple-strings

    This patch introduces line continuation based indent for triple strings,
    which typically span multiple lines without any explicit newlines in the
    syntax tree (since they are hidden inside the string).
    
    This result in the following changes, some of which are clearly
    bugfixes:
    
    Operator chains:
    ```diff
     """
     abc
     """ * """
    -def
    -"""
    +    def
    +    """
    ```
    
    Operator chain as assignment right hand side:
    ```diff
     x = """
    -abc
    -""" * """
    -def
    -"""
    +    abc
    +    """ * """
    +    def
    +    """
    ```
    
    Implicit tuples:
    ```diff
     """
     abc
     """,
       """
    -def
    -"""
    +    def
    +    """
    ```
    
    Note that single triple strings as a right hand side is excluded from
    the indent rule, similar to having `if/try/let/...` blocks as a right
    hand side.
    fredrikekre committed Aug 16, 2024
    Configuration menu
    Copy the full SHA
    90abf5c View commit details
    Browse the repository at this point in the history