Skip to content

Commit

Permalink
Fix parsing of inline node children
Browse files Browse the repository at this point in the history
  • Loading branch information
stormshield-kg committed May 2, 2023
1 parent 9890dad commit 029810d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion kaydle-primitives/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,12 @@ impl<'i> NodeList<'i> for Children<'i, '_> {
)
}

self.run_parser(parse_node_start(char('}').value(())))
let child_terminator = char('}')
.value(())
.precedes(parse_node_space.opt())
.precedes(char(';').opt().value(()));

self.run_parser(parse_node_start(child_terminator))
.map(|opt_name| match opt_name {
// None here means that we successfully parsed the end-of-children. Inform the parent.
None => {
Expand Down Expand Up @@ -532,6 +537,7 @@ fn test_full_document_drain() {
items {
a /* An important note here */ "abc"
d "def"; g "ghi"
z { a; b { c; }; }
}
}
(annotated)node2
Expand Down

0 comments on commit 029810d

Please sign in to comment.