From 46b08e99302ccd45a71b60cc1575dbf823dcc589 Mon Sep 17 00:00:00 2001 From: Dave Ostroske Date: Sat, 19 Dec 2020 03:22:08 -0500 Subject: [PATCH 1/2] Add \x00 notation to basic strings; update ABNF --- CHANGELOG.md | 1 + toml.abnf | 5 +++-- toml.md | 11 ++++++----- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b47c8172..f5024400 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## unreleased +* Add \x00 notation to basic strings. * Clarify and describe the top-level table. * Clarify that indentation before keys is ignored. * Clarify that indentation before table headers is ignored. diff --git a/toml.abnf b/toml.abnf index 2f05540d..8297ed2f 100644 --- a/toml.abnf +++ b/toml.abnf @@ -78,8 +78,9 @@ escape-seq-char =/ %x66 ; f form feed U+000C escape-seq-char =/ %x6E ; n line feed U+000A escape-seq-char =/ %x72 ; r carriage return U+000D escape-seq-char =/ %x74 ; t tab U+0009 -escape-seq-char =/ %x75 4HEXDIG ; uXXXX U+XXXX -escape-seq-char =/ %x55 8HEXDIG ; UXXXXXXXX U+XXXXXXXX +escape-seq-char =/ %x78 2HEXDIG ; xHH U+00HH +escape-seq-char =/ %x75 4HEXDIG ; uHHHH U+HHHH +escape-seq-char =/ %x55 8HEXDIG ; UHHHHHHHH U+HHHHHHHH ;; Multiline Basic String diff --git a/toml.md b/toml.md index f9effc11..3bdf9241 100644 --- a/toml.md +++ b/toml.md @@ -263,7 +263,7 @@ the control characters other than tab (U+0000 to U+0008, U+000A to U+001F, U+007F). ```toml -str = "I'm a string. \"You can quote me\". Name\tJos\u00E9\nLocation\tSF." +str = "I'm a string. \"You can quote me\". Name\tJos\xE9\nLocation\tSF." ``` For convenience, some popular characters have a compact escape sequence. @@ -276,12 +276,13 @@ For convenience, some popular characters have a compact escape sequence. \r - carriage return (U+000D) \" - quote (U+0022) \\ - backslash (U+005C) -\uXXXX - unicode (U+XXXX) -\UXXXXXXXX - unicode (U+XXXXXXXX) +\xHH - unicode (U+00HH) +\uHHHH - unicode (U+HHHH) +\UHHHHHHHH - unicode (U+HHHHHHHH) ``` -Any Unicode character may be escaped with the `\uXXXX` or `\UXXXXXXXX` forms. -The escape codes must be valid Unicode [scalar +Any Unicode character may be escaped with the `\xHH`, `\uHHHH`, or `\UHHHHHHHH` +forms. The escape codes must be valid Unicode [scalar values](https://unicode.org/glossary/#unicode_scalar_value). All other escape sequences not listed above are reserved; if they are used, TOML From 5deb952ea579e5b665012798688c97d6302ed887 Mon Sep 17 00:00:00 2001 From: Dave Ostroske Date: Wed, 4 May 2022 06:15:56 -0400 Subject: [PATCH 2/2] Revert unrelated change in CHANGELOG.md --- CHANGELOG.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 60fee589..b70c280d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,8 +21,7 @@ ## 1.0.0-rc.2 / 2020-08-09 -* Create [https://toml.io](https://toml.io) as the new primary location to read - the TOML spec. +* Create https://toml.io as the new primary location to read the TOML spec. * Clarify meaning of "quotation marks". * Clarify meaning of "expected" value ranges. * Clarify that EOF is allowed after key/value pair.