From 132405f18fc85def8e5e2c5ad085a7f5fcb54880 Mon Sep 17 00:00:00 2001 From: Santos Gallegos Date: Sat, 30 Apr 2022 20:10:55 -0500 Subject: Python: highlight raise from statement --- queries/python/highlights.scm | 2 ++ tests/query/highlights/python/raise_from.py | 6 ++++++ 2 files changed, 8 insertions(+) create mode 100644 tests/query/highlights/python/raise_from.py 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 -- cgit v1.2.3