From c8488db13eeabe015af46830b0494226db8946f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kat=20March=C3=A1n?= Date: Tue, 12 Dec 2023 22:20:52 -0800 Subject: [PATCH] Make last semicolon optional for inline nodes Fixes: https://github.com/kdl-org/kdl/issues/341 --- CHANGELOG.md | 3 +++ SPEC.md | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 927a048..29904e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,9 @@ Values](https://unicode.org/glossary/#unicode_scalar_value) only, including values used in string escapes (`\u{}`). All KDL documents and string values should be valid UTF-8 now, as was intended. +* The last node in a child block no longer needs to be terminated with `;`, + even if the closing `}` is on the same line, so this is now a legal node: + `node {foo;bar;baz}` ### KQL diff --git a/SPEC.md b/SPEC.md index c0f665f..5067133 100644 --- a/SPEC.md +++ b/SPEC.md @@ -527,9 +527,11 @@ node-space := plain-node-space+ ('/-' plain-node-space* (node-prop-or-arg | node required-node-space := node-space* plain-node-space+ optional-node-space := node-space* -node := type? identifier (required-node-space node-prop-or-arg)* (required-node-space node-children)? optional-node-space node-terminator +base-node := type? identifier (required-node-space node-prop-or-arg)* (required-node-space node-children)? +node := base-node optional-node-space node-terminator +final-node := base-node optional-node-space node-terminator? node-prop-or-arg := prop | value -node-children := '{' nodes '}' +node-children := '{' nodes final-node? '}' node-terminator := single-line-comment | newline | ';' | eof identifier := string | bare-identifier