mirror of https://github.com/kdl-org/kdl.git
Clarify how whitespace escapes work in multi-line strings
One example in the spec and two test cases appeared to contradict the language of the spec
This commit is contained in:
parent
6a77436e09
commit
cc6b7708c0
13
SPEC.md
13
SPEC.md
|
|
@ -386,8 +386,10 @@ such) are retained. For example, these strings are all semantically identical:
|
||||||
```kdl
|
```kdl
|
||||||
"Hello\ \nWorld"
|
"Hello\ \nWorld"
|
||||||
|
|
||||||
"Hello\n\
|
"
|
||||||
World"
|
Hello\n\
|
||||||
|
World
|
||||||
|
"
|
||||||
|
|
||||||
"Hello\nWorld"
|
"Hello\nWorld"
|
||||||
|
|
||||||
|
|
@ -437,10 +439,9 @@ The string contains the literal characters `hello\n\r\asd"#world`
|
||||||
|
|
||||||
### Multi-line Strings
|
### Multi-line Strings
|
||||||
|
|
||||||
When a Quoted or Raw String spans multiple lines with literal, non-escaped
|
When a Quoted or Raw String spans multiple lines with literal Newlines, it
|
||||||
Newlines, it follows a special multi-line syntax that automatically "dedents"
|
follows a special multi-line syntax that automatically "dedents" the string,
|
||||||
the string, allowing its value to be indented to a visually matching level if
|
allowing its value to be indented to a visually matching level if desired.
|
||||||
desired.
|
|
||||||
|
|
||||||
A Multi-line string _MUST_ start with a [Newline](#newline) immediately
|
A Multi-line string _MUST_ start with a [Newline](#newline) immediately
|
||||||
following its opening `"`. Its final line _MUST_ contain only whitespace,
|
following its opening `"`. Its final line _MUST_ contain only whitespace,
|
||||||
|
|
|
||||||
|
|
@ -6,10 +6,14 @@ node \
|
||||||
World
|
World
|
||||||
" \
|
" \
|
||||||
"Hello\n\ \tWorld" \
|
"Hello\n\ \tWorld" \
|
||||||
"Hello\n\
|
"
|
||||||
\tWorld" \
|
Hello\n\
|
||||||
"Hello\n\t\
|
\tWorld
|
||||||
World"
|
" \
|
||||||
|
"
|
||||||
|
Hello\n\t\
|
||||||
|
World
|
||||||
|
"
|
||||||
|
|
||||||
// Note that this file deliberately mixes space and newline indentation for
|
// Note that this file deliberately mixes space and newline indentation for
|
||||||
// test purposes
|
// test purposes
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,4 @@
|
||||||
node "Hello \
|
node "
|
||||||
World \ Stuff"
|
Hello \
|
||||||
|
World \ Stuff
|
||||||
|
"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue