Skip to content

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

@olgarithms

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibPython modules in the Lib dirtopic-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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy