From c4e3564ea31183ddcd00d6192efb2879977b420e Mon Sep 17 00:00:00 2001 From: Stephan Seitz Date: Fri, 3 Dec 2021 19:10:11 +0100 Subject: highlights(python): add support for pattern matching Fixes #2080 Depends on https://github.com/tree-sitter/tree-sitter-python/pull/140 --- queries/python/highlights.scm | 2 +- queries/python/locals.scm | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'queries/python') diff --git a/queries/python/highlights.scm b/queries/python/highlights.scm index 0813c960..ccbb2e79 100644 --- a/queries/python/highlights.scm +++ b/queries/python/highlights.scm @@ -230,7 +230,7 @@ ["from" "import"] @include (aliased_import "as" @include) -["if" "elif" "else"] @conditional +["if" "elif" "else" "match" "case"] @conditional ["for" "while" "break" "continue"] @repeat diff --git a/queries/python/locals.scm b/queries/python/locals.scm index 5cfd3543..7699a512 100644 --- a/queries/python/locals.scm +++ b/queries/python/locals.scm @@ -34,11 +34,6 @@ (typed_default_parameter (identifier) @definition.parameter) -(with_statement - (with_clause - (with_item - alias: (identifier) @definition.var))) - ; *args parameter (parameters (list_splat_pattern @@ -113,6 +108,8 @@ (named_expression (identifier) @definition.var) +(as_pattern + alias: (identifier) @definition.var) ;;; REFERENCES (identifier) @reference -- cgit v1.2.3