mirror of https://github.com/kdl-org/kdl.git
Fix multi-line-string-body grammar (#552)
* Make multi-line-string-body non-greedy * Don't require string-character after quotes in multiline strings * Prevent accidentally consuming triple quotes in multi-line-string-body * Add test cases
This commit is contained in:
parent
568d103308
commit
4e4c0af933
|
|
@ -991,7 +991,7 @@ quoted-string :=
|
|||
(multi-line-string-body newline)?
|
||||
(unicode-space | ws-escape)* '"""'
|
||||
single-line-string-body := (string-character - newline)*
|
||||
multi-line-string-body := (('"' | '""')? string-character)*
|
||||
multi-line-string-body := ('"' ^'"' | '""' ^'"' | string-character)*?
|
||||
string-character :=
|
||||
'\\' (["\\bfnrts] |
|
||||
'u{' hex-unicode '}') |
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
node "\""
|
||||
|
|
@ -0,0 +1 @@
|
|||
node "\"\""
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
node """
|
||||
"
|
||||
"""
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
node """
|
||||
""
|
||||
"""
|
||||
Loading…
Reference in New Issue