Skip to content

Repl syntax highlighting fails in pattern matching when the previous case spans across multiple lines #136801

Description

@olgarithms

Bug report

Bug description:

There is a bug in the new repl syntax highlighting when using pattern matching with cases spawning across new lines.

To reproduce:

def status(code):
    match code:
        case 0: return "OK"  # correct highlight
        case -1:                      # correct highlight
            return "Error"
        case -2:                     # no highlight
            return "Big Error"
        case _:                       # no highlight
            return "Unknown status"

CPython versions tested on:

CPython main branch

Operating systems tested on:

macOS

Linked PRs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytopic-replRelated to the interactive shelltype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions