@@ -54,7 +54,8 @@ repository:
5454 name : meta.expression.python
5555 comment : All valid Python expressions
5656 patterns :
57- - include : ' #error'
57+ - include : ' #backticks'
58+ - include : ' #illegal-anno'
5859 - include : ' #comments'
5960 - include : ' #literal'
6061 - include : ' #string'
@@ -73,6 +74,7 @@ repository:
7374 - include : ' #magic-variable-names'
7475 - include : ' #member-access'
7576 - include : ' #special-names'
77+ - include : ' #invalid-chars'
7678
7779 special-names :
7880 name : constant.other.caps.python
@@ -144,7 +146,7 @@ repository:
144146 | != | == | >= | <= | << | >> | @=
145147 | && | \|\| | \*\* | //
146148 | > | < | \+ | - | \* | % | \| | & | \^
147- | ~ | \? | ! | / | @
149+ | ~ | / | @
148150
149151 literal :
150152 patterns :
@@ -566,9 +568,11 @@ repository:
566568 ' 2 ' : {name: punctuation.separator.parameters.python}
567569
568570 - include : ' #comments'
569- - include : ' #error'
571+ - include : ' #backticks'
572+ - include : ' #illegal-anno'
570573 - include : ' #lambda-parameter-with-default'
571574 - include : ' #line-continuation'
575+ - include : ' #invalid-chars'
572576
573577 lambda-incomplete :
574578 name : storage.type.function.lambda.python
@@ -949,15 +953,22 @@ repository:
949953 - include : ' #illegal-names'
950954 - include : ' #special-names'
951955
952- error :
956+ backticks :
957+ name : invalid.deprecated.backtick.python
958+ begin : \`
959+ end : (?:\`|(?<!\\)(\n))
960+ patterns :
961+ - include : ' #expression'
962+
963+ invalid-chars :
953964 patterns :
954965 - name : invalid.illegal.character.python
955966 match : ' [?$]'
956- - name : invalid.illegal.annotation .python
957- match : ' -> '
958- - name : invalid.deprecated.backtick.python
959- begin : \`
960- end : (?:\`|(?<!\\)(\n))
961- patterns :
962- - include : ' #expression '
967+ - name : invalid.illegal.character .python
968+ comment : We don't want `!` to flash when we're typing `!=`
969+ match : ' !\b '
970+
971+ illegal-anno :
972+ name : invalid.illegal.annotation.python
973+ match : ' -> '
963974...
0 commit comments