diff options
| author | Stephan Seitz <stephan.seitz@fau.de> | 2022-04-01 16:50:57 +0200 |
|---|---|---|
| committer | Stephan Seitz <stephan.seitz@fau.de> | 2022-04-01 17:00:21 +0200 |
| commit | b8d1c2445a1f8799ed1320ab59d121f78150ad6d (patch) | |
| tree | 0160ddf041200dec35e3ac058ec7c021455ad2c7 | |
| parent | 4b9aec69bdca88707631614ba30a1ed052ff7369 (diff) | |
highlights(python): "from" in yield should be `@keyword.return`
Fixes #2712
| -rw-r--r-- | queries/python/highlights.scm | 5 | ||||
| -rw-r--r-- | tests/query/highlights/python/yield_from.py | 7 |
2 files changed, 11 insertions, 1 deletions
diff --git a/queries/python/highlights.scm b/queries/python/highlights.scm index ccbb2e79..e7b59caf 100644 --- a/queries/python/highlights.scm +++ b/queries/python/highlights.scm @@ -226,8 +226,11 @@ "return" "yield" ] @keyword.return +(yield "from" @keyword.return) + +(import_from_statement "from" @include) +"import" @include -["from" "import"] @include (aliased_import "as" @include) ["if" "elif" "else" "match" "case"] @conditional diff --git a/tests/query/highlights/python/yield_from.py b/tests/query/highlights/python/yield_from.py new file mode 100644 index 00000000..2f323837 --- /dev/null +++ b/tests/query/highlights/python/yield_from.py @@ -0,0 +1,7 @@ +from foo import bar +# ^ @include +# ^ @include +def generator(): + yield from bar(42) + # ^ @keyword.return + # ^ @keyword.return |
