diff options
| author | Santos Gallegos <stsewd@protonmail.com> | 2022-04-30 20:10:55 -0500 |
|---|---|---|
| committer | Stephan Seitz <stephan.seitz@fau.de> | 2022-05-01 10:06:13 +0200 |
| commit | 132405f18fc85def8e5e2c5ad085a7f5fcb54880 (patch) | |
| tree | 3006e83742fa55c119397c620ff38fa580dfbed6 | |
| parent | c2b2fef3e404185faca51ffe36c3b8c30b4b7627 (diff) | |
Python: highlight raise from statement
| -rw-r--r-- | queries/python/highlights.scm | 2 | ||||
| -rw-r--r-- | tests/query/highlights/python/raise_from.py | 6 |
2 files changed, 8 insertions, 0 deletions
diff --git a/queries/python/highlights.scm b/queries/python/highlights.scm index ec419375..681b9e4d 100644 --- a/queries/python/highlights.scm +++ b/queries/python/highlights.scm @@ -240,6 +240,8 @@ "finally" ] @exception +(raise_statement "from" @exception) + (try_statement (else_clause "else" @exception)) diff --git a/tests/query/highlights/python/raise_from.py b/tests/query/highlights/python/raise_from.py new file mode 100644 index 00000000..8a48a222 --- /dev/null +++ b/tests/query/highlights/python/raise_from.py @@ -0,0 +1,6 @@ +try: + print(1 / 0) +except Exception: + raise RuntimeError from None + # ^ @exception + # ^ @exception |
