Correct description of the raw string format

This commit is contained in:
Hannah Kolbeck 2021-01-08 13:22:25 -08:00 committed by GitHub
parent 4b20446ace
commit 3563be437e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions

View File

@ -198,16 +198,17 @@ support `\`-escapes. They otherwise share the same properties as far as
literal [Newline](#newline) characters go, and the requirement of UTF-8
representation.
Raw String literals are represented as `r"`, followed by zero or more `#`
characters, followed by any number of UTF-8 literals. The string is then
Raw String literals are represented as `r`, followed by zero or more `#`
characters, followed by `"`, followed by any number of UTF-8 literals. The string is then
closed by a `"` followed by a _matching_ number of `#` characters. This means
that the string sequence `"` or `"#` and such must not match the closing `"`
with the same or more `#` characters as the opening `r"`.
with the same or more `#` characters as the opening `r`.
#### Example
```kdl
my-string r#"hello\n\r\asd"world"#
just-escapes r"\n will be literal"
quotes-and-escapes r#"hello\n\r\asd"world"#
```
### Number