Allow node-space after slashdash and add a bunch more slashdash tests (#427)

Fixes: https://github.com/kdl-org/kdl/issues/426
This commit is contained in:
Kat Marchán 2024-12-10 20:43:58 -08:00 committed by GitHub
parent 75a0869a6c
commit 171bc71f42
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
19 changed files with 28 additions and 1 deletions

View File

@ -905,7 +905,7 @@ unicode-space := See Table (All White_Space unicode characters which are not `ne
single-line-comment := '//' ^newline* (newline | eof)
multi-line-comment := '/*' commented-block
commented-block := '*/' | (multi-line-comment | '*' | '/' | [^*/]+) commented-block
slashdash := '/-' line-space*
slashdash := '/-' (node-space | line-space)*
// Whitespace
ws := unicode-space | multi-line-comment

View File

@ -0,0 +1 @@
node arg2

View File

@ -0,0 +1 @@
node arg1

View File

@ -0,0 +1 @@
node2

View File

@ -0,0 +1 @@
node foo bar

View File

@ -0,0 +1 @@
node (ty)/-arg1 arg2

View File

@ -0,0 +1,2 @@
(ty)/-node
other-node

View File

@ -0,0 +1 @@
node key=(ty)/-val other-arg

View File

@ -0,0 +1,4 @@
node {
child1
/-
}

View File

@ -0,0 +1 @@
node foo /-

View File

@ -0,0 +1 @@
node key = /-val etc

View File

@ -0,0 +1 @@
node foo /-;

View File

@ -0,0 +1,2 @@
node /-\
(ty)arg1 arg2

View File

@ -0,0 +1,3 @@
node arg1 /-\
{
}

View File

@ -0,0 +1,3 @@
/-\
node1
node2

View File

@ -0,0 +1,2 @@
node foo /-
not-a-node bar

View File

@ -0,0 +1 @@
node (/-bad)nope

View File

@ -0,0 +1 @@
(/-ty)node