From 99d9168a4aa64fdf83233b191551e4af7c81b0f4 Mon Sep 17 00:00:00 2001 From: Devasta Date: Sat, 25 Sep 2021 18:27:32 +0100 Subject: [PATCH 01/26] Added xml2kdl to the list of implementations. (#201) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 739142c..9326c4f 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,7 @@ free to jump in and give us your 2 cents! * PHP: [kdl-php](https://github.com/kdl-org/kdl-php) * Python: [kdl-py](https://github.com/daeken/kdl-py) * Elixir: [kuddle](https://github.com/IceDragon200/kuddle) +* XSLT: [xml2kdl](https://github.com/Devasta/XML2KDL) ## Compatibility Test Suite From 296fe129e19ac6febd352b2921f37acbe4327b76 Mon Sep 17 00:00:00 2001 From: Christopher Durham Date: Mon, 27 Sep 2021 00:47:08 -0500 Subject: [PATCH 02/26] argument/property ordering clarification (#206) --- SPEC.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SPEC.md b/SPEC.md index 816bab2..96cad16 100644 --- a/SPEC.md +++ b/SPEC.md @@ -57,8 +57,8 @@ slash-escaped line continuation](#line-continuation). Arguments and Properties may be interspersed in any order, much like is common with positional arguments vs options in command line tools. -Arguments are ordered relative to each other and that order must be preserved -in order to maintain the semantics. +Arguments are ordered relative to each other (but not relative to Properties) +and that order must be preserved in order to maintain the semantics. By contrast, Property order _SHOULD NOT_ matter to implementations. [Children](#children-block) should be used if an order-sensitive key/value From 05af2fb6578fe8315b83ce96deddce2d938b49ad Mon Sep 17 00:00:00 2001 From: Danielle Smith Date: Tue, 28 Sep 2021 02:42:30 +0200 Subject: [PATCH 03/26] fix: do not escape solidus (forwardslash) in test (#198) --- tests/test_cases/expected_kdl/all_escapes.kdl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_cases/expected_kdl/all_escapes.kdl b/tests/test_cases/expected_kdl/all_escapes.kdl index 5bb1dc3..c25f434 100644 --- a/tests/test_cases/expected_kdl/all_escapes.kdl +++ b/tests/test_cases/expected_kdl/all_escapes.kdl @@ -1 +1 @@ -node "\"\\\/\b\f\n\r\t" +node "\"\\/\b\f\n\r\t" From 5a2f4969feabbf4bd350642a154ae5b11f768f32 Mon Sep 17 00:00:00 2001 From: Danielle Smith Date: Tue, 28 Sep 2021 02:44:21 +0200 Subject: [PATCH 04/26] fix: non-decimal test output according to docs (#196) --- tests/test_cases/expected_kdl/arg_hex_type.kdl | 2 +- tests/test_cases/expected_kdl/binary.kdl | 2 +- tests/test_cases/expected_kdl/binary_trailing_underscore.kdl | 2 +- tests/test_cases/expected_kdl/binary_underscore.kdl | 2 +- tests/test_cases/expected_kdl/hex.kdl | 2 +- tests/test_cases/expected_kdl/hex_int.kdl | 2 +- tests/test_cases/expected_kdl/hex_int_underscores.kdl | 2 +- tests/test_cases/expected_kdl/hex_leading_zero.kdl | 2 +- tests/test_cases/expected_kdl/leading_zero_binary.kdl | 2 +- tests/test_cases/expected_kdl/leading_zero_oct.kdl | 2 +- tests/test_cases/expected_kdl/octal.kdl | 2 +- tests/test_cases/expected_kdl/parse_all_arg_types.kdl | 2 +- tests/test_cases/expected_kdl/prop_hex_type.kdl~ | 1 - tests/test_cases/expected_kdl/trailing_underscore_hex.kdl | 2 +- tests/test_cases/expected_kdl/trailing_underscore_octal.kdl | 2 +- tests/test_cases/expected_kdl/underscore_in_octal.kdl | 2 +- 16 files changed, 15 insertions(+), 16 deletions(-) delete mode 100644 tests/test_cases/expected_kdl/prop_hex_type.kdl~ diff --git a/tests/test_cases/expected_kdl/arg_hex_type.kdl b/tests/test_cases/expected_kdl/arg_hex_type.kdl index ec44f6c..b1a494a 100644 --- a/tests/test_cases/expected_kdl/arg_hex_type.kdl +++ b/tests/test_cases/expected_kdl/arg_hex_type.kdl @@ -1 +1 @@ -node (type)0x10 +node (type)16 diff --git a/tests/test_cases/expected_kdl/binary.kdl b/tests/test_cases/expected_kdl/binary.kdl index 5d111b9..d14213e 100644 --- a/tests/test_cases/expected_kdl/binary.kdl +++ b/tests/test_cases/expected_kdl/binary.kdl @@ -1 +1 @@ -node 0b10 +node 2 diff --git a/tests/test_cases/expected_kdl/binary_trailing_underscore.kdl b/tests/test_cases/expected_kdl/binary_trailing_underscore.kdl index 5d111b9..d14213e 100644 --- a/tests/test_cases/expected_kdl/binary_trailing_underscore.kdl +++ b/tests/test_cases/expected_kdl/binary_trailing_underscore.kdl @@ -1 +1 @@ -node 0b10 +node 2 diff --git a/tests/test_cases/expected_kdl/binary_underscore.kdl b/tests/test_cases/expected_kdl/binary_underscore.kdl index 5d111b9..d14213e 100644 --- a/tests/test_cases/expected_kdl/binary_underscore.kdl +++ b/tests/test_cases/expected_kdl/binary_underscore.kdl @@ -1 +1 @@ -node 0b10 +node 2 diff --git a/tests/test_cases/expected_kdl/hex.kdl b/tests/test_cases/expected_kdl/hex.kdl index 6d1eba2..bcbc7ff 100644 --- a/tests/test_cases/expected_kdl/hex.kdl +++ b/tests/test_cases/expected_kdl/hex.kdl @@ -1 +1 @@ -node 0xabcdef1234567890 +node 12379813812177893520 diff --git a/tests/test_cases/expected_kdl/hex_int.kdl b/tests/test_cases/expected_kdl/hex_int.kdl index b552b7b..f8dcee1 100644 --- a/tests/test_cases/expected_kdl/hex_int.kdl +++ b/tests/test_cases/expected_kdl/hex_int.kdl @@ -1 +1 @@ -node 0xabcdef0123456789abcdef +node 207698809136909011942886895 diff --git a/tests/test_cases/expected_kdl/hex_int_underscores.kdl b/tests/test_cases/expected_kdl/hex_int_underscores.kdl index b18a9c3..78f3ce0 100644 --- a/tests/test_cases/expected_kdl/hex_int_underscores.kdl +++ b/tests/test_cases/expected_kdl/hex_int_underscores.kdl @@ -1 +1 @@ -node 0xabcdef0123 +node 737894400291 diff --git a/tests/test_cases/expected_kdl/hex_leading_zero.kdl b/tests/test_cases/expected_kdl/hex_leading_zero.kdl index c05ae7c..d20bd7d 100644 --- a/tests/test_cases/expected_kdl/hex_leading_zero.kdl +++ b/tests/test_cases/expected_kdl/hex_leading_zero.kdl @@ -1 +1 @@ -node 0x1 +node 1 diff --git a/tests/test_cases/expected_kdl/leading_zero_binary.kdl b/tests/test_cases/expected_kdl/leading_zero_binary.kdl index 2a38fed..d20bd7d 100644 --- a/tests/test_cases/expected_kdl/leading_zero_binary.kdl +++ b/tests/test_cases/expected_kdl/leading_zero_binary.kdl @@ -1 +1 @@ -node 0b1 +node 1 diff --git a/tests/test_cases/expected_kdl/leading_zero_oct.kdl b/tests/test_cases/expected_kdl/leading_zero_oct.kdl index 9585c83..d20bd7d 100644 --- a/tests/test_cases/expected_kdl/leading_zero_oct.kdl +++ b/tests/test_cases/expected_kdl/leading_zero_oct.kdl @@ -1 +1 @@ -node 0o1 +node 1 diff --git a/tests/test_cases/expected_kdl/octal.kdl b/tests/test_cases/expected_kdl/octal.kdl index 68bc955..225217b 100644 --- a/tests/test_cases/expected_kdl/octal.kdl +++ b/tests/test_cases/expected_kdl/octal.kdl @@ -1 +1 @@ -node 0o76543210 +node 16434824 diff --git a/tests/test_cases/expected_kdl/parse_all_arg_types.kdl b/tests/test_cases/expected_kdl/parse_all_arg_types.kdl index 3d1f3f7..2e8552c 100644 --- a/tests/test_cases/expected_kdl/parse_all_arg_types.kdl +++ b/tests/test_cases/expected_kdl/parse_all_arg_types.kdl @@ -1 +1 @@ -node 1 1.0 1.0E+10 1.0E-10 0x1 0o7 0b10 "arg" "arg\\\\" true false null +node 1 1.0 1.0E+10 1.0E-10 1 7 2 "arg" "arg\\\\" true false null diff --git a/tests/test_cases/expected_kdl/prop_hex_type.kdl~ b/tests/test_cases/expected_kdl/prop_hex_type.kdl~ deleted file mode 100644 index d819d6a..0000000 --- a/tests/test_cases/expected_kdl/prop_hex_type.kdl~ +++ /dev/null @@ -1 +0,0 @@ -node key=(type)0x10 diff --git a/tests/test_cases/expected_kdl/trailing_underscore_hex.kdl b/tests/test_cases/expected_kdl/trailing_underscore_hex.kdl index 5d6cf28..f426d4d 100644 --- a/tests/test_cases/expected_kdl/trailing_underscore_hex.kdl +++ b/tests/test_cases/expected_kdl/trailing_underscore_hex.kdl @@ -1 +1 @@ -node 0x123abc +node 1194684 diff --git a/tests/test_cases/expected_kdl/trailing_underscore_octal.kdl b/tests/test_cases/expected_kdl/trailing_underscore_octal.kdl index 0e653f9..9152a92 100644 --- a/tests/test_cases/expected_kdl/trailing_underscore_octal.kdl +++ b/tests/test_cases/expected_kdl/trailing_underscore_octal.kdl @@ -1 +1 @@ -node 0o123 +node 83 diff --git a/tests/test_cases/expected_kdl/underscore_in_octal.kdl b/tests/test_cases/expected_kdl/underscore_in_octal.kdl index 94f0c85..f4f6039 100644 --- a/tests/test_cases/expected_kdl/underscore_in_octal.kdl +++ b/tests/test_cases/expected_kdl/underscore_in_octal.kdl @@ -1 +1 @@ -node 0o1234567 +node 342391 From b22ed4b1b062089d4f383ce1e8c9570d5522ad6a Mon Sep 17 00:00:00 2001 From: Tab Atkins Jr Date: Mon, 4 Oct 2021 17:47:24 -0700 Subject: [PATCH 05/26] Add missing expected file (#217) Per the grammar (`decimal := integer ('.' [0-9] [0-9_]*)? exponent?`), underscores in the fraction part should be allowed (as in `node 1.0_2`, the contents of the corresponding input file), but there was no expected_kdl file for this test case, indicating it's supposed to be a parse failure. I'm assuming this was a mistake, since underscores in the fraction part make complete sense (and are allowed in the other two parts of a decimal number). --- tests/test_cases/expected_kdl/underscore_in_fraction.kdl | 1 + 1 file changed, 1 insertion(+) create mode 100644 tests/test_cases/expected_kdl/underscore_in_fraction.kdl diff --git a/tests/test_cases/expected_kdl/underscore_in_fraction.kdl b/tests/test_cases/expected_kdl/underscore_in_fraction.kdl new file mode 100644 index 0000000..29bb938 --- /dev/null +++ b/tests/test_cases/expected_kdl/underscore_in_fraction.kdl @@ -0,0 +1 @@ +node 1.02 From 3f293ff01d7106fab7fcfab1b993e1cf9938c446 Mon Sep 17 00:00:00 2001 From: Tab Atkins Jr Date: Tue, 5 Oct 2021 20:27:28 -0700 Subject: [PATCH 06/26] Empty children aren't reflected in the data model. (#219) Fixes: https://github.com/kdl-org/kdl/issues/218 --- tests/test_cases/expected_kdl/empty_child.kdl | 3 +-- tests/test_cases/expected_kdl/empty_child_different_lines.kdl | 3 +-- tests/test_cases/expected_kdl/empty_child_same_line.kdl | 3 +-- tests/test_cases/expected_kdl/empty_child_whitespace.kdl | 3 +-- tests/test_cases/expected_kdl/slashdash_node_in_child.kdl | 3 +-- 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/tests/test_cases/expected_kdl/empty_child.kdl b/tests/test_cases/expected_kdl/empty_child.kdl index a166b33..64f5a0a 100644 --- a/tests/test_cases/expected_kdl/empty_child.kdl +++ b/tests/test_cases/expected_kdl/empty_child.kdl @@ -1,2 +1 @@ -node { -} +node diff --git a/tests/test_cases/expected_kdl/empty_child_different_lines.kdl b/tests/test_cases/expected_kdl/empty_child_different_lines.kdl index a166b33..64f5a0a 100644 --- a/tests/test_cases/expected_kdl/empty_child_different_lines.kdl +++ b/tests/test_cases/expected_kdl/empty_child_different_lines.kdl @@ -1,2 +1 @@ -node { -} +node diff --git a/tests/test_cases/expected_kdl/empty_child_same_line.kdl b/tests/test_cases/expected_kdl/empty_child_same_line.kdl index a166b33..64f5a0a 100644 --- a/tests/test_cases/expected_kdl/empty_child_same_line.kdl +++ b/tests/test_cases/expected_kdl/empty_child_same_line.kdl @@ -1,2 +1 @@ -node { -} +node diff --git a/tests/test_cases/expected_kdl/empty_child_whitespace.kdl b/tests/test_cases/expected_kdl/empty_child_whitespace.kdl index a166b33..64f5a0a 100644 --- a/tests/test_cases/expected_kdl/empty_child_whitespace.kdl +++ b/tests/test_cases/expected_kdl/empty_child_whitespace.kdl @@ -1,2 +1 @@ -node { -} +node diff --git a/tests/test_cases/expected_kdl/slashdash_node_in_child.kdl b/tests/test_cases/expected_kdl/slashdash_node_in_child.kdl index 56e0831..f50c4f2 100644 --- a/tests/test_cases/expected_kdl/slashdash_node_in_child.kdl +++ b/tests/test_cases/expected_kdl/slashdash_node_in_child.kdl @@ -1,2 +1 @@ -node1 { -} +node1 From 93cc6724f2c45a658485862f7603791339a2a34d Mon Sep 17 00:00:00 2001 From: Tab Atkins Jr Date: Wed, 6 Oct 2021 15:01:49 -0700 Subject: [PATCH 07/26] Verify that a slash-dashed prop doesn't shadow a previous prop of the same name (#227) --- tests/test_cases/expected_kdl/slashdash_repeated_prop.kdl | 1 + tests/test_cases/input/slashdash_repeated_prop.kdl | 1 + 2 files changed, 2 insertions(+) create mode 100644 tests/test_cases/expected_kdl/slashdash_repeated_prop.kdl create mode 100644 tests/test_cases/input/slashdash_repeated_prop.kdl diff --git a/tests/test_cases/expected_kdl/slashdash_repeated_prop.kdl b/tests/test_cases/expected_kdl/slashdash_repeated_prop.kdl new file mode 100644 index 0000000..82c6972 --- /dev/null +++ b/tests/test_cases/expected_kdl/slashdash_repeated_prop.kdl @@ -0,0 +1 @@ +node arg="correct" diff --git a/tests/test_cases/input/slashdash_repeated_prop.kdl b/tests/test_cases/input/slashdash_repeated_prop.kdl new file mode 100644 index 0000000..b427175 --- /dev/null +++ b/tests/test_cases/input/slashdash_repeated_prop.kdl @@ -0,0 +1 @@ +node arg="correct" /- arg="wrong" From 05d16e0597214c911f2941b9074b752236bd1f51 Mon Sep 17 00:00:00 2001 From: Tab Atkins Jr Date: Thu, 7 Oct 2021 08:01:18 -0700 Subject: [PATCH 08/26] Per #223 discussion, this *should* be a parse error. (#226) Fixes: #223 --- tests/test_cases/expected_kdl/escline_comment_node.kdl | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 tests/test_cases/expected_kdl/escline_comment_node.kdl diff --git a/tests/test_cases/expected_kdl/escline_comment_node.kdl b/tests/test_cases/expected_kdl/escline_comment_node.kdl deleted file mode 100644 index 1c5b5f3..0000000 --- a/tests/test_cases/expected_kdl/escline_comment_node.kdl +++ /dev/null @@ -1,2 +0,0 @@ -node1 -node2 From e5e131920ffee70d5ed44fdc323c8654700e3c52 Mon Sep 17 00:00:00 2001 From: Tab Atkins Jr Date: Fri, 8 Oct 2021 12:09:09 -0700 Subject: [PATCH 09/26] Link to new python impl previous one is (currently, at least) dead --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9326c4f..9ced72c 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ free to jump in and give us your 2 cents! * Dart: [kdl-dart](https://github.com/danini-the-panini/kdl-dart) * Java: [kdl4j](https://github.com/hkolbeck/kdl4j) * PHP: [kdl-php](https://github.com/kdl-org/kdl-php) -* Python: [kdl-py](https://github.com/daeken/kdl-py) +* Python: [kdl-py](https://github.com/tabatkins/kdlpy) * Elixir: [kuddle](https://github.com/IceDragon200/kuddle) * XSLT: [xml2kdl](https://github.com/Devasta/XML2KDL) From 617ab86e5ef6e2534841043ea27b3cb6c5b88a1c Mon Sep 17 00:00:00 2001 From: Matthew Gamble Date: Mon, 18 Oct 2021 02:03:59 +1100 Subject: [PATCH 10/26] Add link to additional python implementation (#239) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9ced72c..ef7b5e6 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ free to jump in and give us your 2 cents! * Dart: [kdl-dart](https://github.com/danini-the-panini/kdl-dart) * Java: [kdl4j](https://github.com/hkolbeck/kdl4j) * PHP: [kdl-php](https://github.com/kdl-org/kdl-php) -* Python: [kdl-py](https://github.com/tabatkins/kdlpy) +* Python: [kdl-py](https://github.com/tabatkins/kdlpy), [cuddle](https://github.com/djmattyg007/python-cuddle) * Elixir: [kuddle](https://github.com/IceDragon200/kuddle) * XSLT: [xml2kdl](https://github.com/Devasta/XML2KDL) From a1d85e9fe1ff34b83b9d2f476e195686648b8407 Mon Sep 17 00:00:00 2001 From: Tab Atkins Jr Date: Sun, 17 Oct 2021 08:46:34 -0700 Subject: [PATCH 11/26] [editorial] tweak node-props-and-args grammar (#240) * replaces a `foo foo*` with a `foo+` * switches the name of the production to singular, since it only represents one prop/arg at a time No normative changes intended. --- SPEC.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SPEC.md b/SPEC.md index 96cad16..08df1f4 100644 --- a/SPEC.md +++ b/SPEC.md @@ -420,8 +420,8 @@ Note that for the purpose of new lines, CRLF is considered _a single newline_. ``` nodes := linespace* (node nodes?)? linespace* -node := ('/-' node-space*)? type? identifier (node-space node-space* node-props-and-args)* (node-space* node-children ws*)? node-space* node-terminator -node-props-and-args := ('/-' node-space*)? (prop | value) +node := ('/-' node-space*)? type? identifier (node-space+ node-prop-or-arg)* (node-space* node-children ws*)? node-space* node-terminator +node-prop-or-arg := ('/-' node-space*)? (prop | value) node-children := ('/-' node-space*)? '{' nodes '}' node-space := ws* escline ws* | ws+ node-terminator := single-line-comment | newline | ';' | eof From f82a1068145ecc6d9ff44265754b175c8eb95534 Mon Sep 17 00:00:00 2001 From: Mahmoud Mazouz Date: Mon, 25 Oct 2021 02:59:50 +0200 Subject: [PATCH 12/26] Add link to Haskell implementation. (#243) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ef7b5e6..ba3d8a0 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,7 @@ free to jump in and give us your 2 cents! * Python: [kdl-py](https://github.com/tabatkins/kdlpy), [cuddle](https://github.com/djmattyg007/python-cuddle) * Elixir: [kuddle](https://github.com/IceDragon200/kuddle) * XSLT: [xml2kdl](https://github.com/Devasta/XML2KDL) +* Haskell: [Hustle](https://github.com/fuzzypixelz/Hustle) ## Compatibility Test Suite From 23bbe1ebec889a37e4efe303e3b576676dface5a Mon Sep 17 00:00:00 2001 From: Paul Colomiets Date: Tue, 8 Feb 2022 01:50:39 +0200 Subject: [PATCH 13/26] Add `knuffel` to the list of implementations (#256) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ba3d8a0..212fdc1 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ free to jump in and give us your 2 cents! ## Implementations -* Rust: [kdl-rs](https://github.com/kdl-org/kdl-rs) +* Rust: [kdl-rs](https://github.com/kdl-org/kdl-rs) and [knuffel](https://crates.io/crates/knuffel/) (latter includes derive macro) * JavaScript: [kdljs](https://github.com/kdl-org/kdljs) * Ruby: [kdl-rb](https://github.com/danini-the-panini/kdl-rb) * Dart: [kdl-dart](https://github.com/danini-the-panini/kdl-dart) From 5a566ea5e382572db74b0c0de603f07ae6046df0 Mon Sep 17 00:00:00 2001 From: Tab Atkins Jr Date: Sat, 19 Feb 2022 02:04:38 -0800 Subject: [PATCH 14/26] Fix #212 by clarifying left/right (#249) --- SPEC.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/SPEC.md b/SPEC.md index 08df1f4..859eb51 100644 --- a/SPEC.md +++ b/SPEC.md @@ -18,6 +18,12 @@ rules, with some semantic exceptions involving the data model. KDL is designed to be easy to read _and_ easy to implement. +In this document, references to "left" or "right" refer to directions in the +*data stream* towards the beginning or end, respectively; in other words, +the directions if the data stream were only ASCII text. They do not refer +to the writing direction of text, which can flow in either direction, +depending on the characters used. + ## Components ### Document From 8976e2da68f0196ed1d34707cc8267ac5cf29169 Mon Sep 17 00:00:00 2001 From: Christopher Durham Date: Sat, 19 Feb 2022 04:06:17 -0600 Subject: [PATCH 15/26] Define `digit` in formal grammar (#236) `digit` is used as a subtraction in bare-identifier, but never defined. --- SPEC.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/SPEC.md b/SPEC.md index 859eb51..8a6e4d7 100644 --- a/SPEC.md +++ b/SPEC.md @@ -452,9 +452,10 @@ raw-string-quotes := '"' .* '"' number := decimal | hex | octal | binary -decimal := integer ('.' [0-9] [0-9_]*)? exponent? -exponent := ('e' | 'E') integer -integer := sign? [0-9] [0-9_]* +decimal := sign? integer ('.' integer)? exponent? +exponent := ('e' | 'E') sign? integer +integer := digit (digit | '_')* +digit := [0-9] sign := '+' | '-' hex := sign? '0x' hex-digit (hex-digit | '_')* From 3e915b5be37dbc483c5276edf6b0f1cbbe3a6b38 Mon Sep 17 00:00:00 2001 From: Tab Atkins Jr Date: Sat, 19 Feb 2022 02:06:54 -0800 Subject: [PATCH 16/26] Clarify the parsing of hostname and idl-hostname (#248) Ref: #247 --- SPEC.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SPEC.md b/SPEC.md index 8a6e4d7..3a782ee 100644 --- a/SPEC.md +++ b/SPEC.md @@ -266,8 +266,8 @@ IEEE 754-2008 decimal floating point numbers * `country-subdivision`: ISO 3166-2 country subdivision code. * `email`: RFC5302 email address. * `idn-email`: RFC6531 internationalized email address. -* `hostname`: RFC1132 internet hostname. -* `idn-hostname`: RFC5890 internationalized internet hostname. +* `hostname`: RFC1132 internet hostname (only ASCII segments) +* `idn-hostname`: RFC5890 internationalized internet hostname (only `xn--`-prefixed ASCII "punycode" segments, or non-ASCII segments) * `ipv4`: RFC2673 dotted-quad IPv4 address. * `ipv6`: RFC2373 IPv6 address. * `url`: RFC3986 URI. From 168fd6abdcacc4550bf056db46c3b3a25e3fae1d Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Sun, 27 Mar 2022 12:58:39 -0600 Subject: [PATCH 17/26] fix `kdl-schema.kdl` well-formedness (#259) --- examples/kdl-schema.kdl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/kdl-schema.kdl b/examples/kdl-schema.kdl index 667c9fd..4315199 100644 --- a/examples/kdl-schema.kdl +++ b/examples/kdl-schema.kdl @@ -228,7 +228,7 @@ document { children id="validations" description="General value validations." { node "tag" id="value-tag-node" description="The tags associated with this value" { max 1 - children ref="[id="validations"]" + children ref=r#"[id="validations"]"# } node "type" description="The type for this prop's value." { max 1 @@ -269,7 +269,7 @@ document { min 1 type "string" // https://json-schema.org/understanding-json-schema/reference/string.html#format - enum "date-time" "date" "time" "duration" "decimal" "currency" "country-2" "country-3" "country-subdivision" "email" "idn-email" "hostname" "idn-hostname" "ipv4" "ipv6" "url" "url-reference" "irl", "irl-reference" "url-template" "regex" "uuid" "kdl-query" "i8" "i16" "i32" "i64" "u8" "u16" "u32" "u64" "isize" "usize" "f32" "f64" "decimal64" "decimal128" + enum "date-time" "date" "time" "duration" "decimal" "currency" "country-2" "country-3" "country-subdivision" "email" "idn-email" "hostname" "idn-hostname" "ipv4" "ipv6" "url" "url-reference" "irl" "irl-reference" "url-template" "regex" "uuid" "kdl-query" "i8" "i16" "i32" "i64" "u8" "u16" "u32" "u64" "isize" "usize" "f32" "f64" "decimal64" "decimal128" } } node "%" description="Only used for numeric values. Constrains them to be multiples of the given number(s)" { From cc1da35435abbe2f7d0138310f89b18c55a292e7 Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Sun, 27 Mar 2022 23:12:32 -0600 Subject: [PATCH 18/26] allow contributor link in `kdl-schema.kdl` (#260) --- examples/kdl-schema.kdl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/kdl-schema.kdl b/examples/kdl-schema.kdl index 4315199..76a1080 100644 --- a/examples/kdl-schema.kdl +++ b/examples/kdl-schema.kdl @@ -78,6 +78,9 @@ document { node "contributor" description="Contributor to the schema" { value ref=r#"[id="info-person-name"]"# prop ref=r#"[id="info-orcid"]"# + children { + node ref=r#"[id="info-link"]"# + } } node "link" id="info-link" description="Links to itself, and to sources describing it" { value description="A URL that the link points to" { From 81a58e64ee3edf4b67c9a74a11b0fabacb6f920d Mon Sep 17 00:00:00 2001 From: Sebastian Paarmann Date: Tue, 29 Mar 2022 22:00:29 +0200 Subject: [PATCH 19/26] Mention multi-line comments in spec prose (#263) --- SPEC.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/SPEC.md b/SPEC.md index 3a782ee..b6e3711 100644 --- a/SPEC.md +++ b/SPEC.md @@ -404,6 +404,13 @@ space](https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt): | Medium Mathematical Space | `U+205F` | | Ideographic Space | `U+3000` | +#### Multi-line comments + +In addition to single-line comments using `//`, comments can also be started +with `/*` and ended with `*/`. These comments can span multiple lines. They +are allowed in all positions where [Whitespace](#whitespace) is allowed and +can be nested. + ### Newline The following characters [should be treated as new From fcd489afa6c126b22060942a9667d5f3901ce2da Mon Sep 17 00:00:00 2001 From: Jelle Besseling Date: Mon, 25 Apr 2022 19:04:28 +0200 Subject: [PATCH 20/26] Add more info about the hyphen character in identifiers (#271) --- SPEC.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/SPEC.md b/SPEC.md index b6e3711..29f17de 100644 --- a/SPEC.md +++ b/SPEC.md @@ -93,7 +93,10 @@ A bare Identifier is composed of any Unicode codepoint other than [non-initial characters](#non-initial-characters), followed by any number of Unicode codepoints other than [non-identifier characters](#non-identifier-characters), so long as this doesn't produce something confusable for a [Number](#number), -[Boolean](#boolean), or [Null](#null). +[Boolean](#boolean), or [Null](#null). For example, both a [Number](#number) +and an Identifier can start with `-`, but when an Identifier starts with `-` +the second character cannot be a digit. This is precicely specified in the +[Full Grammar](#full-grammar) below. Identifiers are terminated by [Whitespace](#whitespace) or [Newlines](#newline). @@ -106,6 +109,11 @@ The following characters cannot be the first character in a bare * Any decimal digit (0-9) * Any [non-identifier characters](#non-identifier-characters) +Be aware that the `-` character can only be used as an initial +character if the second character is not a digit. This allows +identifiers to look like `--this`, and removes the ambiguity +of having an identifier look like a negative number. + ### Non-identifier characters The following characters cannot be used anywhere in a bare From b027d3a7519d5d5ca1c82cdd74e3443bedb69a24 Mon Sep 17 00:00:00 2001 From: Bram Gotink Date: Tue, 12 Jul 2022 00:13:05 +0200 Subject: [PATCH 21/26] Remove children from node terminals (#275) The grammar doesn't specify that children count as node terminator, but the text does. The following document would be valid per text, but invalid per spec. ```kdl node { child {} } ``` Fixes #274 --- SPEC.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/SPEC.md b/SPEC.md index 29f17de..1558698 100644 --- a/SPEC.md +++ b/SPEC.md @@ -63,6 +63,10 @@ slash-escaped line continuation](#line-continuation). Arguments and Properties may be interspersed in any order, much like is common with positional arguments vs options in command line tools. +[Children](#children-block) can be placed after the name and the optional +Arguments and Properties, possibly separated by either whitespace or a +slash-escaped line continuation. + Arguments are ordered relative to each other (but not relative to Properties) and that order must be preserved in order to maintain the semantics. @@ -74,9 +78,8 @@ Nodes _MAY_ be prefixed with `/-` to "comment out" the entire node, including its properties, arguments, and children, and make it act as plain whitespace, even if it spreads across multiple lines. -Finally, a node is terminated by either a [Newline](#newline), a [Children -Block](#children-block), a semicolon (`;`) or the end of the file/stream (an -`EOF`). +Finally, a node is terminated by either a [Newline](#newline), a semicolon (`;`) +or the end of the file/stream (an `EOF`). #### Example @@ -182,7 +185,7 @@ my-node 1 2 3 "a" "b" "c" ### Children Block A children block is a block of [Nodes](#node), surrounded by `{` and `}`. They -are an optional terminator for nodes, and create a hierarchy of KDL nodes. +are an optional part of nodes, and create a hierarchy of KDL nodes. Regular node termination rules apply, which means multiple nodes can be included in a single-line children block, as long as they're all terminated by From 81fda2455f9b9742edd6fb16bd809bb303a25a6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kat=20March=C3=A1n?= Date: Wed, 20 Jul 2022 09:32:31 -0700 Subject: [PATCH 22/26] docs: add kaydle to impl list --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 212fdc1..59a4ec9 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ free to jump in and give us your 2 cents! ## Implementations -* Rust: [kdl-rs](https://github.com/kdl-org/kdl-rs) and [knuffel](https://crates.io/crates/knuffel/) (latter includes derive macro) +* Rust: [kdl-rs](https://github.com/kdl-org/kdl-rs), [knuffel](https://crates.io/crates/knuffel/) (latter includes derive macro), and [kaydle](https://github.com/Lucretiel/kaydle) (serde-based) * JavaScript: [kdljs](https://github.com/kdl-org/kdljs) * Ruby: [kdl-rb](https://github.com/danini-the-panini/kdl-rb) * Dart: [kdl-dart](https://github.com/danini-the-panini/kdl-dart) From 9daa2019f77598ea5a98a79f3a8c044eb58c5bc6 Mon Sep 17 00:00:00 2001 From: oledfish <88390729+oledfish@users.noreply.github.com> Date: Fri, 22 Jul 2022 14:34:21 -0300 Subject: [PATCH 23/26] Fix RFC typo (#276) The ``email`` field in Reserved Type Annotations for Strings refers to [RFC 5302](https://datatracker.ietf.org/doc/html/rfc5302), it should be [RFC 5322](https://datatracker.ietf.org/doc/html/rfc5322) instead. --- SPEC.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SPEC.md b/SPEC.md index 1558698..e2fd106 100644 --- a/SPEC.md +++ b/SPEC.md @@ -275,7 +275,7 @@ IEEE 754-2008 decimal floating point numbers * `country-2`: ISO 3166-1 alpha-2 country code. * `country-3`: ISO 3166-1 alpha-3 country code. * `country-subdivision`: ISO 3166-2 country subdivision code. -* `email`: RFC5302 email address. +* `email`: RFC5322 email address. * `idn-email`: RFC6531 internationalized email address. * `hostname`: RFC1132 internet hostname (only ASCII segments) * `idn-hostname`: RFC5890 internationalized internet hostname (only `xn--`-prefixed ASCII "punycode" segments, or non-ASCII segments) From e8fe0c38a8e4588dcb9f191cda4dde2526c8d909 Mon Sep 17 00:00:00 2001 From: oledfish <88390729+oledfish@users.noreply.github.com> Date: Sat, 23 Jul 2022 21:01:18 -0300 Subject: [PATCH 24/26] Add .NET library to the implementation list (#277) As per #51 --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 59a4ec9..90c9811 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,7 @@ free to jump in and give us your 2 cents! * Elixir: [kuddle](https://github.com/IceDragon200/kuddle) * XSLT: [xml2kdl](https://github.com/Devasta/XML2KDL) * Haskell: [Hustle](https://github.com/fuzzypixelz/Hustle) +* .NET: [Kadlet](https://github.com/oledfish/Kadlet) ## Compatibility Test Suite From 4f739516e6eef6ff52eeeb145a30713d4cade56a Mon Sep 17 00:00:00 2001 From: Fabian Cook Date: Sat, 30 Jul 2022 04:10:01 +1200 Subject: [PATCH 25/26] Add @virtualstate/kdl to implementations (#278) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 90c9811..117ceba 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ free to jump in and give us your 2 cents! ## Implementations * Rust: [kdl-rs](https://github.com/kdl-org/kdl-rs), [knuffel](https://crates.io/crates/knuffel/) (latter includes derive macro), and [kaydle](https://github.com/Lucretiel/kaydle) (serde-based) -* JavaScript: [kdljs](https://github.com/kdl-org/kdljs) +* JavaScript: [kdljs](https://github.com/kdl-org/kdljs), [@virtualstate/kdl](https://github.com/virtualstate/kdl) (query only, for JSX based) * Ruby: [kdl-rb](https://github.com/danini-the-panini/kdl-rb) * Dart: [kdl-dart](https://github.com/danini-the-panini/kdl-dart) * Java: [kdl4j](https://github.com/hkolbeck/kdl4j) From d9459f67c0ebc43351fa2f7a8c659bbeee84374e Mon Sep 17 00:00:00 2001 From: Fabian Cook Date: Sat, 30 Jul 2022 14:43:42 +1200 Subject: [PATCH 26/26] Correct @virtualstate/kdl description (#279) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 117ceba..d5ca1a1 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ free to jump in and give us your 2 cents! ## Implementations * Rust: [kdl-rs](https://github.com/kdl-org/kdl-rs), [knuffel](https://crates.io/crates/knuffel/) (latter includes derive macro), and [kaydle](https://github.com/Lucretiel/kaydle) (serde-based) -* JavaScript: [kdljs](https://github.com/kdl-org/kdljs), [@virtualstate/kdl](https://github.com/virtualstate/kdl) (query only, for JSX based) +* JavaScript: [kdljs](https://github.com/kdl-org/kdljs), [@virtualstate/kdl](https://github.com/virtualstate/kdl) (query only, JSX based) * Ruby: [kdl-rb](https://github.com/danini-the-panini/kdl-rb) * Dart: [kdl-dart](https://github.com/danini-the-panini/kdl-dart) * Java: [kdl4j](https://github.com/hkolbeck/kdl4j)