From 029810d089a6b575ac9e837d385f94f4cbd28942 Mon Sep 17 00:00:00 2001 From: Kevin GRONDIN Date: Thu, 9 Feb 2023 14:26:29 +0100 Subject: [PATCH] Fix parsing of inline node children --- kaydle-primitives/src/node.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/kaydle-primitives/src/node.rs b/kaydle-primitives/src/node.rs index d65797b..24c8e39 100644 --- a/kaydle-primitives/src/node.rs +++ b/kaydle-primitives/src/node.rs @@ -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 => { @@ -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