From 272b13f9e9205128d7ec9088f3dff5c23bd01829 Mon Sep 17 00:00:00 2001 From: Grisha <33952698+GrishaVar@users.noreply.github.com> Date: Wed, 16 Mar 2022 15:30:03 +0100 Subject: [PATCH 1/4] Add upper bound to hashes in raw string literals --- src/tokens.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/tokens.md b/src/tokens.md index fb27052da..0a96f7abf 100644 --- a/src/tokens.md +++ b/src/tokens.md @@ -28,14 +28,14 @@ evaluated (primarily) at compile time. #### Characters and strings -| | Example | `#` sets | Characters | Escapes | -|----------------------------------------------|-----------------|-------------|-------------|---------------------| -| [Character](#character-literals) | `'H'` | 0 | All Unicode | [Quote](#quote-escapes) & [ASCII](#ascii-escapes) & [Unicode](#unicode-escapes) | -| [String](#string-literals) | `"hello"` | 0 | All Unicode | [Quote](#quote-escapes) & [ASCII](#ascii-escapes) & [Unicode](#unicode-escapes) | -| [Raw string](#raw-string-literals) | `r#"hello"#` | 0 or more\* | All Unicode | `N/A` | -| [Byte](#byte-literals) | `b'H'` | 0 | All ASCII | [Quote](#quote-escapes) & [Byte](#byte-escapes) | -| [Byte string](#byte-string-literals) | `b"hello"` | 0 | All ASCII | [Quote](#quote-escapes) & [Byte](#byte-escapes) | -| [Raw byte string](#raw-byte-string-literals) | `br#"hello"#` | 0 or more\* | All ASCII | `N/A` | +| | Example | `#` sets | Characters | Escapes | +|----------------------------------------------|-----------------|-------------------|-------------|---------------------| +| [Character](#character-literals) | `'H'` | 0 | All Unicode | [Quote](#quote-escapes) & [ASCII](#ascii-escapes) & [Unicode](#unicode-escapes) | +| [String](#string-literals) | `"hello"` | 0 | All Unicode | [Quote](#quote-escapes) & [ASCII](#ascii-escapes) & [Unicode](#unicode-escapes) | +| [Raw string](#raw-string-literals) | `r#"hello"#` | <216\* | All Unicode | `N/A` | +| [Byte](#byte-literals) | `b'H'` | 0 | All ASCII | [Quote](#quote-escapes) & [Byte](#byte-escapes) | +| [Byte string](#byte-string-literals) | `b"hello"` | 0 | All ASCII | [Quote](#quote-escapes) & [Byte](#byte-escapes) | +| [Raw byte string](#raw-byte-string-literals) | `br#"hello"#` | <216\* | All ASCII | `N/A` | \* The number of `#`s on each side of the same literal must be equivalent From a082aa14e29ee6afd1d2ae8d316c44995723b8e5 Mon Sep 17 00:00:00 2001 From: Grisha <33952698+GrishaVar@users.noreply.github.com> Date: Wed, 16 Mar 2022 15:46:21 +0100 Subject: [PATCH 2/4] Raw string token style change --- src/tokens.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/tokens.md b/src/tokens.md index 0a96f7abf..3661ee7d4 100644 --- a/src/tokens.md +++ b/src/tokens.md @@ -28,16 +28,16 @@ evaluated (primarily) at compile time. #### Characters and strings -| | Example | `#` sets | Characters | Escapes | -|----------------------------------------------|-----------------|-------------------|-------------|---------------------| -| [Character](#character-literals) | `'H'` | 0 | All Unicode | [Quote](#quote-escapes) & [ASCII](#ascii-escapes) & [Unicode](#unicode-escapes) | -| [String](#string-literals) | `"hello"` | 0 | All Unicode | [Quote](#quote-escapes) & [ASCII](#ascii-escapes) & [Unicode](#unicode-escapes) | -| [Raw string](#raw-string-literals) | `r#"hello"#` | <216\* | All Unicode | `N/A` | -| [Byte](#byte-literals) | `b'H'` | 0 | All ASCII | [Quote](#quote-escapes) & [Byte](#byte-escapes) | -| [Byte string](#byte-string-literals) | `b"hello"` | 0 | All ASCII | [Quote](#quote-escapes) & [Byte](#byte-escapes) | -| [Raw byte string](#raw-byte-string-literals) | `br#"hello"#` | <216\* | All ASCII | `N/A` | - -\* The number of `#`s on each side of the same literal must be equivalent +| | Example | `#` sets\* | Characters | Escapes | +|----------------------------------------------|-----------------|-----------------|-------------|---------------------| +| [Character](#character-literals) | `'H'` | 0 | All Unicode | [Quote](#quote-escapes) & [ASCII](#ascii-escapes) & [Unicode](#unicode-escapes) | +| [String](#string-literals) | `"hello"` | 0 | All Unicode | [Quote](#quote-escapes) & [ASCII](#ascii-escapes) & [Unicode](#unicode-escapes) | +| [Raw string](#raw-string-literals) | `r#"hello"#` | <216 | All Unicode | `N/A` | +| [Byte](#byte-literals) | `b'H'` | 0 | All ASCII | [Quote](#quote-escapes) & [Byte](#byte-escapes) | +| [Byte string](#byte-string-literals) | `b"hello"` | 0 | All ASCII | [Quote](#quote-escapes) & [Byte](#byte-escapes) | +| [Raw byte string](#raw-byte-string-literals) | `br#"hello"#` | <216 | All ASCII | `N/A` | + +\* The number of `#`s on each side of the same literal must be equivalent. #### ASCII escapes From beb82ca40116b088fcb5ca4ae32ac695170f6084 Mon Sep 17 00:00:00 2001 From: Grisha <33952698+GrishaVar@users.noreply.github.com> Date: Thu, 31 Mar 2022 13:30:40 +0200 Subject: [PATCH 3/4] Update 2^16 to 2^8 --- src/tokens.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/tokens.md b/src/tokens.md index 3661ee7d4..d036c0d70 100644 --- a/src/tokens.md +++ b/src/tokens.md @@ -28,14 +28,14 @@ evaluated (primarily) at compile time. #### Characters and strings -| | Example | `#` sets\* | Characters | Escapes | -|----------------------------------------------|-----------------|-----------------|-------------|---------------------| -| [Character](#character-literals) | `'H'` | 0 | All Unicode | [Quote](#quote-escapes) & [ASCII](#ascii-escapes) & [Unicode](#unicode-escapes) | -| [String](#string-literals) | `"hello"` | 0 | All Unicode | [Quote](#quote-escapes) & [ASCII](#ascii-escapes) & [Unicode](#unicode-escapes) | -| [Raw string](#raw-string-literals) | `r#"hello"#` | <216 | All Unicode | `N/A` | -| [Byte](#byte-literals) | `b'H'` | 0 | All ASCII | [Quote](#quote-escapes) & [Byte](#byte-escapes) | -| [Byte string](#byte-string-literals) | `b"hello"` | 0 | All ASCII | [Quote](#quote-escapes) & [Byte](#byte-escapes) | -| [Raw byte string](#raw-byte-string-literals) | `br#"hello"#` | <216 | All ASCII | `N/A` | +| | Example | `#` sets\* | Characters | Escapes | +|----------------------------------------------|-----------------|------------|-------------|---------------------| +| [Character](#character-literals) | `'H'` | 0 | All Unicode | [Quote](#quote-escapes) & [ASCII](#ascii-escapes) & [Unicode](#unicode-escapes) | +| [String](#string-literals) | `"hello"` | 0 | All Unicode | [Quote](#quote-escapes) & [ASCII](#ascii-escapes) & [Unicode](#unicode-escapes) | +| [Raw string](#raw-string-literals) | `r#"hello"#` | <256 | All Unicode | `N/A` | +| [Byte](#byte-literals) | `b'H'` | 0 | All ASCII | [Quote](#quote-escapes) & [Byte](#byte-escapes) | +| [Byte string](#byte-string-literals) | `b"hello"` | 0 | All ASCII | [Quote](#quote-escapes) & [Byte](#byte-escapes) | +| [Raw byte string](#raw-byte-string-literals) | `br#"hello"#` | <256 | All ASCII | `N/A` | \* The number of `#`s on each side of the same literal must be equivalent. From 76c534c31c6d2ded779f9546666c89821d206ca6 Mon Sep 17 00:00:00 2001 From: Grisha <33952698+GrishaVar@users.noreply.github.com> Date: Fri, 1 Apr 2022 07:02:52 +0200 Subject: [PATCH 4/4] Update formal raw string literal token definition --- src/tokens.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tokens.md b/src/tokens.md index d036c0d70..ecd3b5a49 100644 --- a/src/tokens.md +++ b/src/tokens.md @@ -197,7 +197,7 @@ following forms: >    | `#` RAW_STRING_CONTENT `#` Raw string literals do not process any escapes. They start with the character -`U+0072` (`r`), followed by zero or more of the character `U+0023` (`#`) and a +`U+0072` (`r`), followed by fewer than 256 of the character `U+0023` (`#`) and a `U+0022` (double-quote) character. The _raw string body_ can contain any sequence of Unicode characters and is terminated only by another `U+0022` (double-quote) character, followed by the same number of `U+0023` (`#`) characters that preceded @@ -288,7 +288,7 @@ following forms: >    _any ASCII (i.e. 0x00 to 0x7F)_ Raw byte string literals do not process any escapes. They start with the -character `U+0062` (`b`), followed by `U+0072` (`r`), followed by zero or more +character `U+0062` (`b`), followed by `U+0072` (`r`), followed by fewer than 256 of the character `U+0023` (`#`), and a `U+0022` (double-quote) character. The _raw string body_ can contain any sequence of ASCII characters and is terminated only by another `U+0022` (double-quote) character, followed by the same number of