Skip to content

Commit b9ddb52

Browse files
authored
reword interaction multiline + whitespace escape (#439)
1 parent 813a44b commit b9ddb52

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

SPEC.md

+9-5
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,6 @@ such) are retained. For example, these strings are all semantically identical:
423423
Except as described in the escapes table, above, `\` *MUST NOT* precede any
424424
other characters in a string.
425425

426-
427426
### Multi-line String
428427

429428
Multi-Line Strings support multiple lines with literal, non-escaped
@@ -582,18 +581,23 @@ Strings.
582581

583582
When processing a Multi-line String, implementations MUST dedent the string
584583
_after_ resolving all whitespace escapes, but _before_ resolving other backslash
585-
escapes. Furthermore, a whitespace escape that attempts to escape the final
586-
line's newline and/or whitespace prefix is invalid since the multi-line string
587-
has to still be valid with the escaped whitespace removed.
584+
escapes. This means a whitespace escape that attempts to escape the final line's
585+
newline and/or whitespace prefix can be invalid: if removing escaped whitespace
586+
places the closing `"""` on a line with non-whitespace characters, this escape
587+
is invalid.
588588

589589
For example, the following example is illegal:
590590

591591
```kdl
592-
// Equivalent to trying to write a string containing `foo\nbar\`.
593592
"""
594593
foo
595594
bar\
596595
"""
596+
597+
// equivalent to
598+
"""
599+
foo
600+
bar"""
597601
```
598602

599603
while the following example is allowed

0 commit comments

Comments
 (0)