mirror of https://github.com/kdl-org/kdl.git
Support empty multiline strings (#483)
* Support empty multiline strings Per <https://github.com/kdl-org/kdl/discussions/481>, the grammar doesn't actually allow the first and last newline in a multiline string to be the same (indicating an empty string). This looks like the minimal fix for it. * Add tests for empty multilines * remove accidental newline
This commit is contained in:
parent
20375a187e
commit
0c2dde6d3c
4
SPEC.md
4
SPEC.md
|
|
@ -889,7 +889,7 @@ disallowed-keyword-identifiers :=
|
|||
quoted-string :=
|
||||
'"' single-line-string-body '"' |
|
||||
'"""' newline
|
||||
multi-line-string-body newline
|
||||
(multi-line-string-body newline)?
|
||||
(unicode-space | ws-escape)* '"""'
|
||||
single-line-string-body := (string-character - newline)*
|
||||
multi-line-string-body := (('"' | '""')? string-character)*
|
||||
|
|
@ -909,7 +909,7 @@ raw-string := '#' raw-string-quotes '#' | '#' raw-string '#'
|
|||
raw-string-quotes :=
|
||||
'"' single-line-raw-string-body '"' |
|
||||
'"""' newline
|
||||
multi-line-raw-string-body newline
|
||||
(multi-line-raw-string-body newline)?
|
||||
unicode-space* '"""'
|
||||
single-line-raw-string-body :=
|
||||
'' |
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
node ""
|
||||
|
|
@ -0,0 +1 @@
|
|||
node ""
|
||||
|
|
@ -0,0 +1 @@
|
|||
node ""
|
||||
|
|
@ -0,0 +1 @@
|
|||
node ""
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
node #"""
|
||||
"""#
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
node #"""
|
||||
"""#
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
node """
|
||||
"""
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
node """
|
||||
"""
|
||||
Loading…
Reference in New Issue