Skip to content

Commit

Permalink
Allow node-space after slashdash and add a bunch more slashdash tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed Dec 11, 2024
1 parent 75a0869 commit a340eea
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion SPEC.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node arg2
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node arg1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node2
4 changes: 4 additions & 0 deletions tests/test_cases/input/slashdash_before_children_end_fail.kdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node {
child1
/-
}
1 change: 1 addition & 0 deletions tests/test_cases/input/slashdash_before_eof_fail.kdl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node foo /-
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node key = /-val etc
2 changes: 2 additions & 0 deletions tests/test_cases/input/slashdash_escline_before_arg_type.kdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node /-\
(ty)arg1 arg2
3 changes: 3 additions & 0 deletions tests/test_cases/input/slashdash_escline_before_children.kdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node arg1 /-\
{
}
3 changes: 3 additions & 0 deletions tests/test_cases/input/slashdash_escline_before_node.kdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/-\
node1
node2
1 change: 1 addition & 0 deletions tests/test_cases/input/slashdash_inside_arg_type_fail.kdl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node (/-bad)nope
1 change: 1 addition & 0 deletions tests/test_cases/input/slashdash_inside_node_type_fail.kdl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(/-ty)node

0 comments on commit a340eea

Please sign in to comment.