Skip to content

Commit

Permalink
Remove mandatory node-space before slashdash and children block (#499)
Browse files Browse the repository at this point in the history
* Remove mandatory node-space before slashdash

Fix #495

* Add tests

* Fix more tests

* Fix tests again
  • Loading branch information
larsgw authored Jan 29, 2025
1 parent c54ebd9 commit 84911fe
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 4 deletions.
8 changes: 4 additions & 4 deletions draft-marchan-kdl2.md
Original file line number Diff line number Diff line change
Expand Up @@ -936,11 +936,11 @@ document := bom? version? nodes
nodes := (line-space* node)* line-space*

base-node := slashdash? type? node-space* string
(node-space+ slashdash? node-prop-or-arg)*
(node-space* (node-space | slashdash) node-prop-or-arg)*
// slashdashed node-children must always be after props and args.
(node-space+ slashdash node-children)*
(node-space+ node-children)?
(node-space+ slashdash node-children)*
(node-space* slashdash node-children)*
(node-space* node-children)?
(node-space* slashdash node-children)*
node-space*
node := base-node node-terminator
final-node := base-node node-terminator?
Expand Down
3 changes: 3 additions & 0 deletions tests/test_cases/expected_kdl/braces_in_bare_id.kdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
foo123 {
bar
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node string
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node string
node string
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node string
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node "string"/-{}
node "string" {}/-{}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node "string"/-foo=1

0 comments on commit 84911fe

Please sign in to comment.