From 0ad21fd728a486535ebcc8667cf77675b3f9b337 Mon Sep 17 00:00:00 2001 From: nfnty Date: Wed, 2 Dec 2020 19:57:28 +0000 Subject: [PATCH] Highlight class variables inside f-strings Fixes #56 --- syntax/python.vim | 2 +- tests/test.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/syntax/python.vim b/syntax/python.vim index 3ff422f..80135a1 100644 --- a/syntax/python.vim +++ b/syntax/python.vim @@ -103,7 +103,7 @@ else syn match pythonStatement '\' nextgroup=pythonFunction skipwhite syn match pythonStatement '\' syn match pythonStatement '\' - syn cluster pythonExpression contains=pythonStatement,pythonRepeat,pythonConditional,pythonOperator,pythonNumber,pythonHexNumber,pythonOctNumber,pythonBinNumber,pythonFloat,pythonString,pythonFString,pythonRawString,pythonRawFString,pythonBytes,pythonBoolean,pythonNone,pythonSingleton,pythonBuiltinObj,pythonBuiltinFunc,pythonBuiltinType + syn cluster pythonExpression contains=pythonStatement,pythonRepeat,pythonConditional,pythonOperator,pythonNumber,pythonHexNumber,pythonOctNumber,pythonBinNumber,pythonFloat,pythonString,pythonFString,pythonRawString,pythonRawFString,pythonBytes,pythonBoolean,pythonNone,pythonSingleton,pythonBuiltinObj,pythonBuiltinFunc,pythonBuiltinType,pythonClassVar endif diff --git a/tests/test.py b/tests/test.py index 20555a4..2880a13 100644 --- a/tests/test.py +++ b/tests/test.py @@ -251,6 +251,7 @@ fr'this {that}' f"{f'{1+1}'}" '{{ }}' f"{"{test}"}" # FIXME: syntax error that should not be highlighted +f'{self.__name__} # Doctests.