diff --git a/lib/rouge/lexers/python.rb b/lib/rouge/lexers/python.rb index b47b64aa76..09d2041a6d 100644 --- a/lib/rouge/lexers/python.rb +++ b/lib/rouge/lexers/python.rb @@ -21,7 +21,7 @@ def self.keywords assert break continue del elif else except exec finally for global if lambda pass print raise return try while yield as with from import yield - async await nonlocal + async await nonlocal match case ) end diff --git a/spec/visual/samples/python b/spec/visual/samples/python index b9fbf4e818..0c3456f670 100644 --- a/spec/visual/samples/python +++ b/spec/visual/samples/python @@ -218,3 +218,10 @@ def do_nothing(): app = FastAPI() FastAPIInstrumentor.instrument_app(app) + +# Structural pattern matching (PEP634) +match point: + case Point(x, y) if x == y: + print(f"The point is located on the diagonal Y=X at {x}.") + case Point(x, y): + print(f"Point is not on the diagonal.")