From 3989d37026050416b4eab275ff8116196359cf9b Mon Sep 17 00:00:00 2001 From: Patitotective Date: Mon, 19 Sep 2022 16:59:20 -0500 Subject: [PATCH] - Removed tests that allowed empty strings as identifiers. - Edited SPEC.md to be clear about not allowing zero-length identifiers. - Need to update grammar as well. --- SPEC.md | 6 +++--- tests/test_cases/expected_kdl/blank_arg_type.kdl | 1 - tests/test_cases/expected_kdl/blank_node_type.kdl | 1 - tests/test_cases/expected_kdl/blank_prop_type.kdl | 1 - tests/test_cases/expected_kdl/empty_quoted_node_id.kdl | 1 - tests/test_cases/expected_kdl/empty_quoted_prop_key.kdl | 1 - 6 files changed, 3 insertions(+), 8 deletions(-) delete mode 100644 tests/test_cases/expected_kdl/blank_arg_type.kdl delete mode 100644 tests/test_cases/expected_kdl/blank_node_type.kdl delete mode 100644 tests/test_cases/expected_kdl/blank_prop_type.kdl delete mode 100644 tests/test_cases/expected_kdl/empty_quoted_node_id.kdl delete mode 100644 tests/test_cases/expected_kdl/empty_quoted_prop_key.kdl diff --git a/SPEC.md b/SPEC.md index e2fd106..d038fbd 100644 --- a/SPEC.md +++ b/SPEC.md @@ -50,7 +50,7 @@ baz Being a node-oriented language means that the real core component of any KDL document is the "node". Every node must have a name, which is either a legal -[Identifier](#identifier), or a quoted [String](#string). +[Identifier](#identifier) or a quoted [String](#string), this quoted string has to have more than 0 characters (`""` is not a valid string identifier). The name may be preceded by a [Type Annotation](#type-annotation) to further clarify its type, particularly in relation to its parent node. (For example, @@ -145,7 +145,7 @@ my-node 1 2 \ // comments are ok after \ ### Property A Property is a key/value pair attached to a [Node](#node). A Property is -composed of an [Identifier](#identifier) or a [String](#string), followed +composed of an [Identifier](#identifier) or a [String](#string) (this quoted string has to have more than 0 characters), followed immediately by a `=`, and then a [Value](#value). Properties should be interpreted left-to-right, with rightmost properties with @@ -220,7 +220,7 @@ or as a _context-specific elaboration_ of the more generic type the node name indicates. Type annotations are written as a set of `(` and `)` with a single -[Identifier](#identifier) in it. Any valid identifier is considered a valid +[Identifier](#identifier) or [String](#string) (this quoted string has to have more than 0 characters) in it. Any valid identifier is considered a valid type annotation. There must be no whitespace between a type annotation and its associated Node Name or Value. diff --git a/tests/test_cases/expected_kdl/blank_arg_type.kdl b/tests/test_cases/expected_kdl/blank_arg_type.kdl deleted file mode 100644 index 8c6fb21..0000000 --- a/tests/test_cases/expected_kdl/blank_arg_type.kdl +++ /dev/null @@ -1 +0,0 @@ -node ("")10 diff --git a/tests/test_cases/expected_kdl/blank_node_type.kdl b/tests/test_cases/expected_kdl/blank_node_type.kdl deleted file mode 100644 index 6b064a6..0000000 --- a/tests/test_cases/expected_kdl/blank_node_type.kdl +++ /dev/null @@ -1 +0,0 @@ -("")node diff --git a/tests/test_cases/expected_kdl/blank_prop_type.kdl b/tests/test_cases/expected_kdl/blank_prop_type.kdl deleted file mode 100644 index c7b0e31..0000000 --- a/tests/test_cases/expected_kdl/blank_prop_type.kdl +++ /dev/null @@ -1 +0,0 @@ -node key=("")true diff --git a/tests/test_cases/expected_kdl/empty_quoted_node_id.kdl b/tests/test_cases/expected_kdl/empty_quoted_node_id.kdl deleted file mode 100644 index ebfa893..0000000 --- a/tests/test_cases/expected_kdl/empty_quoted_node_id.kdl +++ /dev/null @@ -1 +0,0 @@ -"" "arg" diff --git a/tests/test_cases/expected_kdl/empty_quoted_prop_key.kdl b/tests/test_cases/expected_kdl/empty_quoted_prop_key.kdl deleted file mode 100644 index e6e1310..0000000 --- a/tests/test_cases/expected_kdl/empty_quoted_prop_key.kdl +++ /dev/null @@ -1 +0,0 @@ -node ""="empty"