Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disable highlighting of some escape codes for python bytes literals (#…
…2204) Disable highlighting of unicode escape codes in python bytes literals, as described in https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals. So escape codes of the form "\N{name}", "\uxxxx" and "\Uxxxxxxxx" will no longer be highlighted within bytes literals. Add tests for escape code highlighting in string and bytes literals.
- Loading branch information
1 parent
581f7ee
commit 78efbf0
Showing
3 changed files
with
64 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
---input--- | ||
b'\\ \n \x12 \777 \u1234 \U00010348 \N{Plus-Minus Sign}' | ||
|
||
---tokens--- | ||
'b' Literal.String.Affix | ||
"'" Literal.String.Single | ||
'\\\\' Literal.String.Escape | ||
' ' Literal.String.Single | ||
'\\n' Literal.String.Escape | ||
' ' Literal.String.Single | ||
'\\x12' Literal.String.Escape | ||
' ' Literal.String.Single | ||
'\\777' Literal.String.Escape | ||
' ' Literal.String.Single | ||
'\\' Literal.String.Single | ||
'u1234 ' Literal.String.Single | ||
'\\' Literal.String.Single | ||
'U00010348 ' Literal.String.Single | ||
'\\' Literal.String.Single | ||
'N' Literal.String.Single | ||
'{' Literal.String.Single | ||
'Plus-Minus Sign}' Literal.String.Single | ||
"'" Literal.String.Single | ||
'\n' Text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
---input--- | ||
'\\ \n \x12 \777 \u1234 \U00010348 \N{Plus-Minus Sign}' | ||
|
||
---tokens--- | ||
"'" Literal.String.Single | ||
'\\\\' Literal.String.Escape | ||
' ' Literal.String.Single | ||
'\\n' Literal.String.Escape | ||
' ' Literal.String.Single | ||
'\\x12' Literal.String.Escape | ||
' ' Literal.String.Single | ||
'\\777' Literal.String.Escape | ||
' ' Literal.String.Single | ||
'\\u1234' Literal.String.Escape | ||
' ' Literal.String.Single | ||
'\\U00010348' Literal.String.Escape | ||
' ' Literal.String.Single | ||
'\\N{Plus-Minus Sign}' Literal.String.Escape | ||
"'" Literal.String.Single | ||
'\n' Text |