Skip to content

Commit f8275d4

Browse files
committed
tomllib: Add shorthand for escape character (TOML 1.1)
1 parent ee4e14a commit f8275d4

3 files changed

Lines changed: 5 additions & 0 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"escape": {"type":"string","value":"\u001B"}
3+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
escape = "\e"

Lib/tomllib/_parser.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
"\\n": "\u000A", # linefeed
5050
"\\f": "\u000C", # form feed
5151
"\\r": "\u000D", # carriage return
52+
"\\e": "\u001b", # escape
5253
'\\"': "\u0022", # quote
5354
"\\\\": "\u005C", # backslash
5455
}

0 commit comments

Comments
 (0)