Skip to content

Commit

Permalink
Add shorthand for escape character
Browse files Browse the repository at this point in the history
  • Loading branch information
hukkin committed Aug 5, 2022
1 parent 7e563ee commit a644252
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/tomli/_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"\\n": "\u000A", # linefeed
"\\f": "\u000C", # form feed
"\\r": "\u000D", # carriage return
"\\e": "\u001B", # escape
'\\"': "\u0022", # quote
"\\\\": "\u005C", # backslash
}
Expand Down
2 changes: 2 additions & 0 deletions tests/data/valid/multiline-basic-str/replacements.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{"escape":
{"type":"string","value":"\u001B"}}
1 change: 1 addition & 0 deletions tests/data/valid/multiline-basic-str/replacements.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
escape = "\e"

0 comments on commit a644252

Please sign in to comment.