From f8053042374ddca4e4ee7edd4dd4ab87271887ca Mon Sep 17 00:00:00 2001 From: Thomas Jollans Date: Mon, 13 May 2024 20:49:57 +0200 Subject: [PATCH 01/45] Tokenizer: support KDLv2 strings --- include/kdl/tokenizer.h | 3 ++- src/tokenizer.c | 20 ++++++++++++++---- src/utils/ckdl-tokenize.c | 3 +++ tests/CMakeLists.txt | 4 ++++ tests/kdlv2_test.c | 43 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 68 insertions(+), 5 deletions(-) create mode 100644 tests/kdlv2_test.c diff --git a/include/kdl/tokenizer.h b/include/kdl/tokenizer.h index bc300f1..ef466a3 100644 --- a/include/kdl/tokenizer.h +++ b/include/kdl/tokenizer.h @@ -20,7 +20,8 @@ enum kdl_token_type { KDL_TOKEN_END_TYPE, // ')' KDL_TOKEN_WORD, // identifier, number, boolean, or null KDL_TOKEN_STRING, // regular string - KDL_TOKEN_RAW_STRING, // raw string + KDL_TOKEN_RAW_STRING, // KDLV1 raw string + KDL_TOKEN_RAW_STRING_V2, // KDLv2 raw string KDL_TOKEN_SINGLE_LINE_COMMENT, // // ... KDL_TOKEN_SLASHDASH, // /- KDL_TOKEN_MULTI_LINE_COMMENT, // /* ... */ diff --git a/src/tokenizer.c b/src/tokenizer.c index 3b8689a..63a3086 100644 --- a/src/tokenizer.c +++ b/src/tokenizer.c @@ -288,7 +288,7 @@ kdl_tokenizer_status kdl_pop_token(kdl_tokenizer* self, kdl_token* dest) // string return _pop_string(self, dest); } else if (_kdl_is_id(c)) { - if (c == 'r') { + if (c == 'r' || c == '#') { // this *could* be a raw string kdl_tokenizer_status rstring_status = _pop_raw_string(self, dest); if (rstring_status == KDL_TOKENIZER_OK) return KDL_TOKENIZER_OK; @@ -463,8 +463,20 @@ static kdl_tokenizer_status _pop_raw_string(kdl_tokenizer* self, kdl_token* dest uint32_t c = 0; char const* cur = self->document.data; char const* next = NULL; - if (_tok_get_char(self, &cur, &next, &c) != KDL_UTF8_OK || c != 'r') return KDL_TOKENIZER_ERROR; - cur = next; + kdl_token_type type = KDL_TOKEN_RAW_STRING; + + if (_tok_get_char(self, &cur, &next, &c) != KDL_UTF8_OK) return KDL_TOKENIZER_ERROR; + switch (c) { + case 'r': + type = KDL_TOKEN_RAW_STRING; + cur = next; + break; + case '#': + type = KDL_TOKEN_RAW_STRING_V2; + break; + default: + return KDL_TOKENIZER_ERROR; + } // Get all hashes, and the initial quote int hashes = 0; @@ -523,6 +535,6 @@ static kdl_tokenizer_status _pop_raw_string(kdl_tokenizer* self, kdl_token* dest dest->value.data = self->document.data + string_start_offset; dest->value.len = end_quote_offset - string_start_offset; _update_doc_ptr(self, next); - dest->type = KDL_TOKEN_RAW_STRING; + dest->type = type; return KDL_TOKENIZER_OK; } diff --git a/src/utils/ckdl-tokenize.c b/src/utils/ckdl-tokenize.c index e61b5f2..0bdbfa1 100644 --- a/src/utils/ckdl-tokenize.c +++ b/src/utils/ckdl-tokenize.c @@ -76,6 +76,9 @@ int main(int argc, char** argv) case KDL_TOKEN_RAW_STRING: token_type_name = "KDL_TOKEN_RAW_STRING"; break; + case KDL_TOKEN_RAW_STRING_V2: + token_type_name = "KDL_TOKEN_RAW_STRING_V2"; + break; case KDL_TOKEN_SINGLE_LINE_COMMENT: token_type_name = "KDL_TOKEN_SINGLE_LINE_COMMENT"; break; diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 05c1128..683133d 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -183,6 +183,10 @@ add_executable(emitter_test emitter_test.c) target_link_libraries(emitter_test kdl test_util) add_test(emitter_test emitter_test) +add_executable(kdlv2_test kdlv2_test.c) +target_link_libraries(kdlv2_test kdl test_util) +add_test(kdlv2_test kdlv2_test) + if(KDL_TEST_CASES_ROOT) # Ignore some tests which require unsupported number representations set(FUZZY_KDL_TESTS_LIST diff --git a/tests/kdlv2_test.c b/tests/kdlv2_test.c new file mode 100644 index 0000000..0919a7b --- /dev/null +++ b/tests/kdlv2_test.c @@ -0,0 +1,43 @@ +#include + +#include "test_util.h" + +#include + +static void test_tokenizer_strings(void) +{ + kdl_token token; + + char const* doc_v1 = "r#\"abc\"def\"#"; + char const* doc_v2 = "#\"abc\"def\"#"; + + kdl_str k_doc_v1 = kdl_str_from_cstr(doc_v1); + kdl_str k_doc_v2 = kdl_str_from_cstr(doc_v2); + + kdl_tokenizer* tok = kdl_create_string_tokenizer(k_doc_v1); + + ASSERT(kdl_pop_token(tok, &token) == KDL_TOKENIZER_OK); + ASSERT(token.type == KDL_TOKEN_RAW_STRING); + ASSERT(token.value.len == 7); + ASSERT(memcmp(token.value.data, "abc\"def", 7) == 0); + + ASSERT(kdl_pop_token(tok, &token) == KDL_TOKENIZER_EOF); + + kdl_destroy_tokenizer(tok); + + tok = kdl_create_string_tokenizer(k_doc_v2); + + ASSERT(kdl_pop_token(tok, &token) == KDL_TOKENIZER_OK); + ASSERT(token.type == KDL_TOKEN_RAW_STRING_V2); + ASSERT(token.value.len == 7); + ASSERT(memcmp(token.value.data, "abc\"def", 7) == 0); + + ASSERT(kdl_pop_token(tok, &token) == KDL_TOKENIZER_EOF); + + kdl_destroy_tokenizer(tok); +} + +void TEST_MAIN(void) +{ + run_test("Tokenizer: KDLv2 strings", &test_tokenizer_strings); +} From 38783e5c8357e240000d5616e161e1fc05b384ad Mon Sep 17 00:00:00 2001 From: Thomas Jollans Date: Mon, 13 May 2024 21:24:53 +0200 Subject: [PATCH 02/45] Add KDLv2 identifiers to tokenizer, but not to parser --- src/grammar.h | 2 ++ src/parser.c | 36 ++++++++++++++++++++++++++++++++---- src/tokenizer.c | 6 ++++-- tests/kdlv2_test.c | 35 +++++++++++++++++++++++++++++++++++ 4 files changed, 73 insertions(+), 6 deletions(-) diff --git a/src/grammar.h b/src/grammar.h index 78f9447..35c3c4f 100644 --- a/src/grammar.h +++ b/src/grammar.h @@ -8,6 +8,8 @@ bool _kdl_is_whitespace(uint32_t c); bool _kdl_is_newline(uint32_t c); bool _kdl_is_id(uint32_t c); bool _kdl_is_id_start(uint32_t c); +bool _kdl_is_v1_id(uint32_t c); +bool _kdl_is_v1_id_start(uint32_t c); bool _kdl_is_end_of_word(uint32_t c); #endif // KDL_INTERNAL_GRAMMAR_H_ diff --git a/src/parser.c b/src/parser.c index 13edef6..30cfc6f 100644 --- a/src/parser.c +++ b/src/parser.c @@ -4,6 +4,8 @@ #include "bigint.h" #include "compat.h" +#include "grammar.h" +#include "utf8.h" #include #include @@ -119,6 +121,7 @@ static bool _parse_decimal_float(kdl_str number, kdl_value* val, kdl_owned_strin static bool _parse_hex_number(kdl_str number, kdl_value* val, kdl_owned_string* s); static bool _parse_octal_number(kdl_str number, kdl_value* val, kdl_owned_string* s); static bool _parse_binary_number(kdl_str number, kdl_value* val, kdl_owned_string* s); +static bool _identifier_is_valid(kdl_str value); kdl_event_data* kdl_parser_next_event(kdl_parser* self) { @@ -557,10 +560,13 @@ static bool _parse_value(kdl_token const* token, kdl_value* val, kdl_owned_strin } } // this is a regular identifier - *s = kdl_clone_str(&token->value); - val->type = KDL_TYPE_STRING; - val->string = kdl_borrow_str(s); - return true; + if (_identifier_is_valid(token->value)) { + *s = kdl_clone_str(&token->value); + val->type = KDL_TYPE_STRING; + val->string = kdl_borrow_str(s); + return true; + } + _fallthrough_; default: return false; } @@ -962,3 +968,25 @@ static bool _parse_binary_number(kdl_str number, kdl_value* val, kdl_owned_strin _kdl_ubigint_free(n); return false; } + +static bool _identifier_is_valid(kdl_str value) +{ + // Check that this is a valid KDLv1 identifier! The tokenizer accepts KDLv2 + // identifiers, but the parser doesn't yet + uint32_t c = 0; + if (_kdl_pop_codepoint(&value, &c) != KDL_UTF8_OK || !_kdl_is_v1_id_start(c)) { + return false; + } + + while (true) { + switch (_kdl_pop_codepoint(&value, &c)) { + case KDL_UTF8_OK: + if (!_kdl_is_v1_id(c)) return false; + break; + case KDL_UTF8_EOF: + return true; + default: + return false; + } + } +} diff --git a/src/tokenizer.c b/src/tokenizer.c index 63a3086..7ee96f6 100644 --- a/src/tokenizer.c +++ b/src/tokenizer.c @@ -129,12 +129,14 @@ bool _kdl_is_newline(uint32_t c) bool _kdl_is_id(uint32_t c) { return c > 0x20 && c <= 0x10FFFF // - && c != '\\' && c != '/' && c != '(' && c != ')' && c != '{' && c != '}' && c != '<' && c != '>' - && c != ';' && c != '[' && c != ']' && c != '=' && c != ',' && c != '"' && !_kdl_is_whitespace(c) + && c != '\\' && c != '/' && c != '(' && c != ')' && c != '{' && c != '}' + && c != ';' && c != '[' && c != ']' && c != '=' && c != '"' && !_kdl_is_whitespace(c) && !_kdl_is_newline(c); } +bool _kdl_is_v1_id(uint32_t c) { return _kdl_is_id(c) && c != '<' && c != '>' && c != ','; } bool _kdl_is_id_start(uint32_t c) { return _kdl_is_id(c) && (c < '0' || c > '9'); } +bool _kdl_is_v1_id_start(uint32_t c) { return _kdl_is_v1_id(c) && (c < '0' || c > '9'); } bool _kdl_is_end_of_word(uint32_t c) { diff --git a/tests/kdlv2_test.c b/tests/kdlv2_test.c index 0919a7b..28aa42e 100644 --- a/tests/kdlv2_test.c +++ b/tests/kdlv2_test.c @@ -37,7 +37,42 @@ static void test_tokenizer_strings(void) kdl_destroy_tokenizer(tok); } +static void test_tokenizer_identifiers(void) +{ + kdl_token token; + + kdl_str doc = kdl_str_from_cstr("ab"); + + kdl_tokenizer* tok = kdl_create_string_tokenizer(doc); + + ASSERT(kdl_pop_token(tok, &token) == KDL_TOKENIZER_OK); + ASSERT(token.type == KDL_TOKEN_WORD); + ASSERT(token.value.len == 3); + ASSERT(memcmp(token.value.data, "ab", 3) == 0); + + ASSERT(kdl_pop_token(tok, &token) == KDL_TOKENIZER_EOF); + + kdl_destroy_tokenizer(tok); +} + void TEST_MAIN(void) { run_test("Tokenizer: KDLv2 strings", &test_tokenizer_strings); + run_test("Tokenizer: KDLv2 identifiers", &test_tokenizer_identifiers); } From 9690dbc937bf99d354f0de79bc471381ec005451 Mon Sep 17 00:00:00 2001 From: Thomas Jollans Date: Mon, 13 May 2024 21:27:49 +0200 Subject: [PATCH 03/45] Vertical tabs (U+000B) are now considered to be whitespace. --- src/tokenizer.c | 3 ++- tests/kdlv2_test.c | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/tokenizer.c b/src/tokenizer.c index 7ee96f6..1c570fd 100644 --- a/src/tokenizer.c +++ b/src/tokenizer.c @@ -96,7 +96,8 @@ static size_t _refill_tokenizer(kdl_tokenizer* self) bool _kdl_is_whitespace(uint32_t c) { - return c == 0x0009 || // Character Tabulation + return c == 0x000B || // Vertical Tab + c == 0x0009 || // Character Tabulation c == 0x0020 || // Space c == 0x00A0 || // No-Break Space c == 0x1680 || // Ogham Space Mark diff --git a/tests/kdlv2_test.c b/tests/kdlv2_test.c index 28aa42e..bee8c46 100644 --- a/tests/kdlv2_test.c +++ b/tests/kdlv2_test.c @@ -71,8 +71,27 @@ static void test_tokenizer_identifiers(void) kdl_destroy_tokenizer(tok); } +static void test_tokenizer_whitespace(void) +{ + kdl_token token; + + kdl_str doc = kdl_str_from_cstr("\x0b"); + + kdl_tokenizer* tok = kdl_create_string_tokenizer(doc); + + ASSERT(kdl_pop_token(tok, &token) == KDL_TOKENIZER_OK); + ASSERT(token.type == KDL_TOKEN_WHITESPACE); + ASSERT(token.value.len == 1); + ASSERT(token.value.data[0] == 0xb); + + ASSERT(kdl_pop_token(tok, &token) == KDL_TOKENIZER_EOF); + + kdl_destroy_tokenizer(tok); +} + void TEST_MAIN(void) { run_test("Tokenizer: KDLv2 strings", &test_tokenizer_strings); run_test("Tokenizer: KDLv2 identifiers", &test_tokenizer_identifiers); + run_test("Tokenizer: KDLv2 identifiers", &test_tokenizer_whitespace); } From 92219977c653a91254cdba6e372670489ad01215 Mon Sep 17 00:00:00 2001 From: Thomas Jollans Date: Tue, 14 May 2024 19:18:39 +0200 Subject: [PATCH 04/45] introduce character sets (kdlv1 vs kdlv2) --- include/kdl/tokenizer.h | 11 +++++++++ src/emitter.c | 2 +- src/grammar.h | 12 +++++----- src/parser.c | 6 +++-- src/tokenizer.c | 50 +++++++++++++++++++++++++---------------- 5 files changed, 53 insertions(+), 28 deletions(-) diff --git a/include/kdl/tokenizer.h b/include/kdl/tokenizer.h index ef466a3..a92aec0 100644 --- a/include/kdl/tokenizer.h +++ b/include/kdl/tokenizer.h @@ -34,8 +34,16 @@ enum kdl_token_type { KDL_TOKEN_WHITESPACE // any regular whitespace }; +// Character set configuration +enum kdl_character_set { + KDL_CHARACTER_SET_V1 = 1, // V1 character set: BOM is whitespace, vertical tab is not, etc. + KDL_CHARACTER_SET_V2 = 2, // V2 character set: control characters restricted, etc. + KDL_CHARACTER_SET_DEFAULT = KDL_CHARACTER_SET_V2 +}; + typedef enum kdl_tokenizer_status kdl_tokenizer_status; typedef enum kdl_token_type kdl_token_type; +typedef enum kdl_character_set kdl_character_set; typedef struct kdl_token kdl_token; typedef struct _kdl_tokenizer kdl_tokenizer; @@ -52,6 +60,9 @@ KDL_NODISCARD KDL_EXPORT kdl_tokenizer* kdl_create_stream_tokenizer(kdl_read_fun // Destroy a tokenizer KDL_EXPORT void kdl_destroy_tokenizer(kdl_tokenizer* tokenizer); +// Change the character set used by the tokenizer +KDL_EXPORT void kdl_tokenizer_set_character_set(kdl_tokenizer* tokenizer, kdl_character_set cs); + // Get the next token and write it to a user-supplied structure (or return an error) KDL_EXPORT kdl_tokenizer_status kdl_pop_token(kdl_tokenizer* tokenizer, kdl_token* dest); diff --git a/src/emitter.c b/src/emitter.c index 7c53a66..ee02257 100644 --- a/src/emitter.c +++ b/src/emitter.c @@ -236,7 +236,7 @@ static bool _emit_identifier(kdl_emitter* self, kdl_str name) kdl_str tail = name; bool first = true; while (KDL_UTF8_OK == _kdl_pop_codepoint(&tail, &c)) { - if ((first && !_kdl_is_id_start(c)) || !_kdl_is_id(c) + if ((first && !_kdl_is_id_start(KDL_CHARACTER_SET_V1, c)) || !_kdl_is_id(KDL_CHARACTER_SET_V1, c) || (self->opt.identifier_mode == KDL_ASCII_IDENTIFIERS && c >= 0x7f)) { bare = false; break; diff --git a/src/grammar.h b/src/grammar.h index 35c3c4f..b33d6fc 100644 --- a/src/grammar.h +++ b/src/grammar.h @@ -4,12 +4,12 @@ #include #include -bool _kdl_is_whitespace(uint32_t c); +#include + +bool _kdl_is_whitespace(kdl_character_set charset, uint32_t c); bool _kdl_is_newline(uint32_t c); -bool _kdl_is_id(uint32_t c); -bool _kdl_is_id_start(uint32_t c); -bool _kdl_is_v1_id(uint32_t c); -bool _kdl_is_v1_id_start(uint32_t c); -bool _kdl_is_end_of_word(uint32_t c); +bool _kdl_is_id(kdl_character_set charset, uint32_t c); +bool _kdl_is_id_start(kdl_character_set charset, uint32_t c); +bool _kdl_is_end_of_word(kdl_character_set charset, uint32_t c); #endif // KDL_INTERNAL_GRAMMAR_H_ diff --git a/src/parser.c b/src/parser.c index 30cfc6f..37af5c3 100644 --- a/src/parser.c +++ b/src/parser.c @@ -65,6 +65,7 @@ kdl_parser* kdl_create_string_parser(kdl_str doc, kdl_parse_option opt) _init_kdl_parser(self); self->tokenizer = kdl_create_string_tokenizer(doc); self->opt = opt; + kdl_tokenizer_set_character_set(self->tokenizer, KDL_CHARACTER_SET_V1); } return self; } @@ -76,6 +77,7 @@ kdl_parser* kdl_create_stream_parser(kdl_read_func read_func, void* user_data, k _init_kdl_parser(self); self->tokenizer = kdl_create_stream_tokenizer(read_func, user_data); self->opt = opt; + kdl_tokenizer_set_character_set(self->tokenizer, KDL_CHARACTER_SET_V1); } return self; } @@ -974,14 +976,14 @@ static bool _identifier_is_valid(kdl_str value) // Check that this is a valid KDLv1 identifier! The tokenizer accepts KDLv2 // identifiers, but the parser doesn't yet uint32_t c = 0; - if (_kdl_pop_codepoint(&value, &c) != KDL_UTF8_OK || !_kdl_is_v1_id_start(c)) { + if (_kdl_pop_codepoint(&value, &c) != KDL_UTF8_OK || !_kdl_is_id_start(KDL_CHARACTER_SET_V1, c)) { return false; } while (true) { switch (_kdl_pop_codepoint(&value, &c)) { case KDL_UTF8_OK: - if (!_kdl_is_v1_id(c)) return false; + if (!_kdl_is_id(KDL_CHARACTER_SET_V1, c)) return false; break; case KDL_UTF8_EOF: return true; diff --git a/src/tokenizer.c b/src/tokenizer.c index a48cfbf..ecce6eb 100644 --- a/src/tokenizer.c +++ b/src/tokenizer.c @@ -17,6 +17,7 @@ struct _kdl_tokenizer { kdl_str document; + kdl_character_set charset; kdl_read_func read_func; void* read_user_data; char* buffer; @@ -28,6 +29,7 @@ kdl_tokenizer* kdl_create_string_tokenizer(kdl_str doc) kdl_tokenizer* self = malloc(sizeof(kdl_tokenizer)); if (self != NULL) { self->document = doc; + self->charset = KDL_CHARACTER_SET_DEFAULT; self->read_func = NULL; self->read_user_data = NULL; self->buffer = NULL; @@ -41,6 +43,7 @@ kdl_tokenizer* kdl_create_stream_tokenizer(kdl_read_func read_func, void* user_d kdl_tokenizer* self = malloc(sizeof(kdl_tokenizer)); if (self != NULL) { self->document = (kdl_str){.data = NULL, .len = 0}; + self->charset = KDL_CHARACTER_SET_DEFAULT; self->read_func = read_func; self->read_user_data = user_data; self->buffer = NULL; @@ -57,6 +60,11 @@ void kdl_destroy_tokenizer(kdl_tokenizer* tokenizer) free(tokenizer); } +void kdl_tokenizer_set_character_set(kdl_tokenizer* self, kdl_character_set cs) +{ + self->charset = cs; +} + static size_t _refill_tokenizer(kdl_tokenizer* self) { if (self->read_func == NULL) return 0; @@ -94,10 +102,9 @@ static size_t _refill_tokenizer(kdl_tokenizer* self) return read_count; } -bool _kdl_is_whitespace(uint32_t c) +bool _kdl_is_whitespace(kdl_character_set charset, uint32_t c) { - return c == 0x000B || // Vertical Tab - c == 0x0009 || // Character Tabulation + return c == 0x0009 || // Character Tabulation c == 0x0020 || // Space c == 0x00A0 || // No-Break Space c == 0x1680 || // Ogham Space Mark @@ -115,7 +122,10 @@ bool _kdl_is_whitespace(uint32_t c) c == 0x202F || // Narrow No-Break Space c == 0x205F || // Medium Mathematical Space c == 0x3000 || // Ideographic Space - c == 0xFEFF; // Byte-order mark + + (charset == KDL_CHARACTER_SET_V1 && c == 0xFEFF) || // Byte-order mark + (charset == KDL_CHARACTER_SET_V2 && c == 0x000B) // Vertical Tab + ; } bool _kdl_is_newline(uint32_t c) @@ -128,22 +138,23 @@ bool _kdl_is_newline(uint32_t c) c == 0x2029; // PS Paragraph Separator } -bool _kdl_is_id(uint32_t c) +bool _kdl_is_id(kdl_character_set charset, uint32_t c) { - return c > 0x20 && c <= 0x10FFFF // - && c != '\\' && c != '/' && c != '(' && c != ')' && c != '{' && c != '}' - && c != ';' && c != '[' && c != ']' && c != '=' && c != '"' && !_kdl_is_whitespace(c) - && !_kdl_is_newline(c); + return c > 0x20 && c <= 0x10FFFF && c != '\\' && c != '/' && c != '(' && c != ')' && c != '{' && c != '}' + && c != ';' && c != '[' && c != ']' && c != '=' && c != '"' + && !(charset == KDL_CHARACTER_SET_V1 && (c == '<' || c == '>' || c == ',')) + && !_kdl_is_whitespace(charset, c) && !_kdl_is_newline(c); } -bool _kdl_is_v1_id(uint32_t c) { return _kdl_is_id(c) && c != '<' && c != '>' && c != ','; } -bool _kdl_is_id_start(uint32_t c) { return _kdl_is_id(c) && (c < '0' || c > '9'); } -bool _kdl_is_v1_id_start(uint32_t c) { return _kdl_is_v1_id(c) && (c < '0' || c > '9'); } +bool _kdl_is_id_start(kdl_character_set charset, uint32_t c) +{ + return _kdl_is_id(charset, c) && (c < '0' || c > '9'); +} -bool _kdl_is_end_of_word(uint32_t c) +bool _kdl_is_end_of_word(kdl_character_set charset, uint32_t c) { // is this character something that could terminate an identifier (or number) in some situation? - return _kdl_is_whitespace(c) || _kdl_is_newline(c) // + return _kdl_is_whitespace(charset, c) || _kdl_is_newline(c) // || c == ';' || c == ')' || c == '}' || c == '/' || c == '\\' || c == '='; } @@ -205,11 +216,12 @@ kdl_tokenizer_status kdl_pop_token(kdl_tokenizer* self, kdl_token* dest) } // Could be the start of a new token - if (_kdl_is_whitespace(c)) { + if (_kdl_is_whitespace(self->charset, c)) { // find whitespace run size_t ws_start_offset = cur - self->document.data; cur = next; - while (_tok_get_char(self, &cur, &next, &c) == KDL_UTF8_OK && _kdl_is_whitespace(c)) { + while ( + _tok_get_char(self, &cur, &next, &c) == KDL_UTF8_OK && _kdl_is_whitespace(self->charset, c)) { // accept whitespace character cur = next; } @@ -291,7 +303,7 @@ kdl_tokenizer_status kdl_pop_token(kdl_tokenizer* self, kdl_token* dest) } else if (c == '"') { // string return _pop_string(self, dest); - } else if (_kdl_is_id(c)) { + } else if (_kdl_is_id(self->charset, c)) { if (c == 'r' || c == '#') { // this *could* be a raw string kdl_tokenizer_status rstring_status = _pop_raw_string(self, dest); @@ -322,10 +334,10 @@ static kdl_tokenizer_status _pop_word(kdl_tokenizer* self, kdl_token* dest) return KDL_TOKENIZER_ERROR; } - if (_kdl_is_end_of_word(c)) { + if (_kdl_is_end_of_word(self->charset, c)) { // end the word goto end_of_word; - } else if (!_kdl_is_id(c)) { + } else if (!_kdl_is_id(self->charset, c)) { // invalid character return KDL_TOKENIZER_ERROR; } From 571865814d376f166a00b7ce69bf5b52e79b9a40 Mon Sep 17 00:00:00 2001 From: Thomas Jollans Date: Tue, 14 May 2024 19:48:58 +0200 Subject: [PATCH 05/45] banned characters are banned --- src/grammar.h | 1 + src/tokenizer.c | 39 ++++++++++++++++++++++++++++++++++++--- tests/kdlv2_test.c | 26 +++++++++++++++++++++++++- 3 files changed, 62 insertions(+), 4 deletions(-) diff --git a/src/grammar.h b/src/grammar.h index b33d6fc..f568525 100644 --- a/src/grammar.h +++ b/src/grammar.h @@ -11,5 +11,6 @@ bool _kdl_is_newline(uint32_t c); bool _kdl_is_id(kdl_character_set charset, uint32_t c); bool _kdl_is_id_start(kdl_character_set charset, uint32_t c); bool _kdl_is_end_of_word(kdl_character_set charset, uint32_t c); +bool _kdl_is_illegal_char(kdl_character_set charset, uint32_t c); #endif // KDL_INTERNAL_GRAMMAR_H_ diff --git a/src/tokenizer.c b/src/tokenizer.c index ecce6eb..036c40d 100644 --- a/src/tokenizer.c +++ b/src/tokenizer.c @@ -24,6 +24,11 @@ struct _kdl_tokenizer { size_t buffer_size; }; +static inline void _remove_initial_bom(kdl_tokenizer* self); +static inline void _update_doc_ptr(kdl_tokenizer* self, char const* new_ptr); +static inline kdl_utf8_status _tok_get_char( + kdl_tokenizer* self, char const** cur, char const** next, uint32_t* codepoint); + kdl_tokenizer* kdl_create_string_tokenizer(kdl_str doc) { kdl_tokenizer* self = malloc(sizeof(kdl_tokenizer)); @@ -35,6 +40,7 @@ kdl_tokenizer* kdl_create_string_tokenizer(kdl_str doc) self->buffer = NULL; self->buffer_size = 0; } + _remove_initial_bom(self); return self; } @@ -49,6 +55,7 @@ kdl_tokenizer* kdl_create_stream_tokenizer(kdl_read_func read_func, void* user_d self->buffer = NULL; self->buffer_size = 0; } + _remove_initial_bom(self); return self; } @@ -60,11 +67,20 @@ void kdl_destroy_tokenizer(kdl_tokenizer* tokenizer) free(tokenizer); } -void kdl_tokenizer_set_character_set(kdl_tokenizer* self, kdl_character_set cs) +static inline void _remove_initial_bom(kdl_tokenizer* self) { - self->charset = cs; + uint32_t c = 0; + char const* cur = self->document.data; + char const* next = NULL; + + if (_tok_get_char(self, &cur, &next, &c) == KDL_UTF8_OK && c == 0xFEFF) { + // skip initial BOM + _update_doc_ptr(self, next); + } } +void kdl_tokenizer_set_character_set(kdl_tokenizer* self, kdl_character_set cs) { self->charset = cs; } + static size_t _refill_tokenizer(kdl_tokenizer* self) { if (self->read_func == NULL) return 0; @@ -158,6 +174,21 @@ bool _kdl_is_end_of_word(kdl_character_set charset, uint32_t c) || c == ';' || c == ')' || c == '}' || c == '/' || c == '\\' || c == '='; } +bool _kdl_is_illegal_char(kdl_character_set charset, uint32_t c) +{ + return charset == KDL_CHARACTER_SET_V2 + && (c <= 0x0008 || // control characters + (0x000E <= c && c <= 0x001F) || // '' + c == 0x007F || // delete + (0xD800 <= c && c <= 0xDFFF) || // UTF-16 surrogates + c == 0x200E || c == 0x200F || // directional control characters + (0x202A <= c && c <= 0x202E) || // '' + (0x2066 <= c && c <= 0x2069) || // '' + c == 0xFEFF || // ZWNBSP = BOM + c > 0x10FFFF // not a codepoint + ); +} + static inline kdl_utf8_status _tok_get_char( kdl_tokenizer* self, char const** cur, char const** next, uint32_t* codepoint) { @@ -216,7 +247,9 @@ kdl_tokenizer_status kdl_pop_token(kdl_tokenizer* self, kdl_token* dest) } // Could be the start of a new token - if (_kdl_is_whitespace(self->charset, c)) { + if (_kdl_is_illegal_char(self->charset, c)) { + return KDL_TOKENIZER_ERROR; + } else if (_kdl_is_whitespace(self->charset, c)) { // find whitespace run size_t ws_start_offset = cur - self->document.data; cur = next; diff --git a/tests/kdlv2_test.c b/tests/kdlv2_test.c index bee8c46..676c4a4 100644 --- a/tests/kdlv2_test.c +++ b/tests/kdlv2_test.c @@ -89,9 +89,33 @@ static void test_tokenizer_whitespace(void) kdl_destroy_tokenizer(tok); } +static void test_tokenizer_bom(void) +{ + kdl_token token; + + kdl_str doc = kdl_str_from_cstr("\xEF\xBB\xBF "); + kdl_tokenizer* tok = kdl_create_string_tokenizer(doc); + + ASSERT(kdl_pop_token(tok, &token) == KDL_TOKENIZER_OK); + ASSERT(token.type == KDL_TOKEN_WHITESPACE); + + ASSERT(kdl_pop_token(tok, &token) == KDL_TOKENIZER_EOF); + + kdl_destroy_tokenizer(tok); + + doc = kdl_str_from_cstr(" \xEF\xBB\xBF"); + tok = kdl_create_string_tokenizer(doc); + + ASSERT(kdl_pop_token(tok, &token) == KDL_TOKENIZER_OK); + ASSERT(token.type == KDL_TOKEN_WHITESPACE); + + ASSERT(kdl_pop_token(tok, &token) == KDL_TOKENIZER_ERROR); +} + void TEST_MAIN(void) { run_test("Tokenizer: KDLv2 strings", &test_tokenizer_strings); run_test("Tokenizer: KDLv2 identifiers", &test_tokenizer_identifiers); - run_test("Tokenizer: KDLv2 identifiers", &test_tokenizer_whitespace); + run_test("Tokenizer: KDLv2 whitespace", &test_tokenizer_whitespace); + run_test("Tokenizer: byte-order-mark", &test_tokenizer_bom); } From 71c0c08d3c8d65815ceba27f62d5931e71dfacf5 Mon Sep 17 00:00:00 2001 From: Thomas Jollans Date: Tue, 14 May 2024 20:05:56 +0200 Subject: [PATCH 06/45] illegal characters are illegal in strings and comments --- src/tokenizer.c | 16 ++++++++++++---- tests/kdlv2_test.c | 30 ++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 4 deletions(-) diff --git a/src/tokenizer.c b/src/tokenizer.c index 036c40d..e961c90 100644 --- a/src/tokenizer.c +++ b/src/tokenizer.c @@ -417,7 +417,11 @@ static kdl_tokenizer_status _pop_comment(kdl_tokenizer* self, kdl_token* dest) default: // error return KDL_TOKENIZER_ERROR; } - if (_kdl_is_newline(c)) goto end_of_line; + if (_kdl_is_illegal_char(self->charset, c)) { + return KDL_TOKENIZER_ERROR; + } else if (_kdl_is_newline(c)) { + goto end_of_line; + } // Accept this character cur = next; } @@ -442,7 +446,9 @@ static kdl_tokenizer_status _pop_comment(kdl_tokenizer* self, kdl_token* dest) return KDL_TOKENIZER_ERROR; } - if (c == '*' && prev_char == '/') { + if (_kdl_is_illegal_char(self->charset, c)) { + return KDL_TOKENIZER_ERROR; + } else if (c == '*' && prev_char == '/') { // another level of nesting ++depth; c = 0; // "/*/" doesn't count as self-closing @@ -488,8 +494,10 @@ static kdl_tokenizer_status _pop_string(kdl_tokenizer* self, kdl_token* dest) return KDL_TOKENIZER_ERROR; } - if (c == '\\' && prev_char == '\\') { - c = 0; // double backslash is no backslash + if (_kdl_is_illegal_char(self->charset, c)) { + return KDL_TOKENIZER_ERROR; + } else if (c == '\\' && prev_char == '\\') { + c = 0; // double backslash is no backslash } else if (c == '"' && prev_char != '\\') { break; // non-escaped end of string } diff --git a/tests/kdlv2_test.c b/tests/kdlv2_test.c index 676c4a4..87651de 100644 --- a/tests/kdlv2_test.c +++ b/tests/kdlv2_test.c @@ -110,6 +110,35 @@ static void test_tokenizer_bom(void) ASSERT(token.type == KDL_TOKEN_WHITESPACE); ASSERT(kdl_pop_token(tok, &token) == KDL_TOKENIZER_ERROR); + + kdl_destroy_tokenizer(tok); + +} + +static void test_tokenizer_illegal_codepoints(void) +{ + kdl_token token; + + kdl_str doc = kdl_str_from_cstr("no\007de"); // BEL is illegal in identifiers + kdl_tokenizer* tok = kdl_create_string_tokenizer(doc); + + ASSERT(kdl_pop_token(tok, &token) == KDL_TOKENIZER_ERROR); + + kdl_destroy_tokenizer(tok); + + doc = kdl_str_from_cstr("\"this string contains a backspace \x08\""); + tok = kdl_create_string_tokenizer(doc); + + ASSERT(kdl_pop_token(tok, &token) == KDL_TOKENIZER_ERROR); + + kdl_destroy_tokenizer(tok); + + doc = kdl_str_from_cstr("// Not even comments can contain \x1B"); + tok = kdl_create_string_tokenizer(doc); + + ASSERT(kdl_pop_token(tok, &token) == KDL_TOKENIZER_ERROR); + + kdl_destroy_tokenizer(tok); } void TEST_MAIN(void) @@ -118,4 +147,5 @@ void TEST_MAIN(void) run_test("Tokenizer: KDLv2 identifiers", &test_tokenizer_identifiers); run_test("Tokenizer: KDLv2 whitespace", &test_tokenizer_whitespace); run_test("Tokenizer: byte-order-mark", &test_tokenizer_bom); + run_test("Tokenizer: illegal codepoints", &test_tokenizer_illegal_codepoints); } From e6b29001029e02c4513817f6ee0019aa5c0dd3b4 Mon Sep 17 00:00:00 2001 From: Thomas Jollans Date: Tue, 14 May 2024 20:11:14 +0200 Subject: [PATCH 07/45] illegal characters are illegal in raw strings, too --- src/tokenizer.c | 4 +++- tests/kdlv2_test.c | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/tokenizer.c b/src/tokenizer.c index e961c90..66b678d 100644 --- a/src/tokenizer.c +++ b/src/tokenizer.c @@ -570,7 +570,9 @@ static kdl_tokenizer_status _pop_raw_string(kdl_tokenizer* self, kdl_token* dest return KDL_TOKENIZER_ERROR; } - if (end_quote_offset != 0 && c == '#') { + if (_kdl_is_illegal_char(self->charset, c)) { + return KDL_TOKENIZER_ERROR; + } else if (end_quote_offset != 0 && c == '#') { ++hashes_found; } else if (c == '"') { end_quote_offset = cur - self->document.data; diff --git a/tests/kdlv2_test.c b/tests/kdlv2_test.c index 87651de..ee60ca5 100644 --- a/tests/kdlv2_test.c +++ b/tests/kdlv2_test.c @@ -139,6 +139,20 @@ static void test_tokenizer_illegal_codepoints(void) ASSERT(kdl_pop_token(tok, &token) == KDL_TOKENIZER_ERROR); kdl_destroy_tokenizer(tok); + + doc = kdl_str_from_cstr("/* multi-line comments also can't have \x15 */"); + tok = kdl_create_string_tokenizer(doc); + + ASSERT(kdl_pop_token(tok, &token) == KDL_TOKENIZER_ERROR); + + kdl_destroy_tokenizer(tok); + + doc = kdl_str_from_cstr("###\" multi-line strings must't \x10 \"###"); + tok = kdl_create_string_tokenizer(doc); + + ASSERT(kdl_pop_token(tok, &token) == KDL_TOKENIZER_ERROR); + + kdl_destroy_tokenizer(tok); } void TEST_MAIN(void) From 7ac4444a944c9cab5e3c2d566ea05a8b02ab89b9 Mon Sep 17 00:00:00 2001 From: Thomas Jollans Date: Tue, 14 May 2024 20:27:20 +0200 Subject: [PATCH 08/45] KDLv2 equals signs --- src/grammar.h | 1 + src/tokenizer.c | 14 +++++++++++++- tests/kdlv2_test.c | 14 ++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/grammar.h b/src/grammar.h index f568525..042302f 100644 --- a/src/grammar.h +++ b/src/grammar.h @@ -12,5 +12,6 @@ bool _kdl_is_id(kdl_character_set charset, uint32_t c); bool _kdl_is_id_start(kdl_character_set charset, uint32_t c); bool _kdl_is_end_of_word(kdl_character_set charset, uint32_t c); bool _kdl_is_illegal_char(kdl_character_set charset, uint32_t c); +bool _kdl_is_equals_sign(kdl_character_set charset, uint32_t c); #endif // KDL_INTERNAL_GRAMMAR_H_ diff --git a/src/tokenizer.c b/src/tokenizer.c index 66b678d..a15a2ea 100644 --- a/src/tokenizer.c +++ b/src/tokenizer.c @@ -189,6 +189,18 @@ bool _kdl_is_illegal_char(kdl_character_set charset, uint32_t c) ); } +bool _kdl_is_equals_sign(kdl_character_set charset, uint32_t c) +{ + if (charset == KDL_CHARACTER_SET_V1) { + return c == '='; + } else { + return c == '=' || // EQUALS SIGN = + c == 0xFE66 || // SMALL EQUALS SIGN ﹦ + c == 0xFF1D || // FULLWIDTH EQUALS SIGN = + c == 0x1F7F0; // HEAVY EQUALS SIGN 🟰 + } +} + static inline kdl_utf8_status _tok_get_char( kdl_tokenizer* self, char const** cur, char const** next, uint32_t* codepoint) { @@ -323,7 +335,7 @@ kdl_tokenizer_status kdl_pop_token(kdl_tokenizer* self, kdl_token* dest) dest->value.len = (size_t)(next - cur); _update_doc_ptr(self, next); return KDL_TOKENIZER_OK; - } else if (c == '=') { + } else if (_kdl_is_equals_sign(self->charset, c)) { // attribute assignment dest->type = KDL_TOKEN_EQUALS; dest->value.data = cur; diff --git a/tests/kdlv2_test.c b/tests/kdlv2_test.c index ee60ca5..a49bbb4 100644 --- a/tests/kdlv2_test.c +++ b/tests/kdlv2_test.c @@ -155,6 +155,19 @@ static void test_tokenizer_illegal_codepoints(void) kdl_destroy_tokenizer(tok); } +static void test_tokenizer_equals(void) +{ + kdl_token token; + + kdl_str doc = kdl_str_from_cstr("\xef\xbc\x9d"); // Fullwidth equals U+FF1D + kdl_tokenizer* tok = kdl_create_string_tokenizer(doc); + + ASSERT(kdl_pop_token(tok, &token) == KDL_TOKENIZER_OK); + ASSERT(token.type == KDL_TOKEN_EQUALS); + + kdl_destroy_tokenizer(tok); +} + void TEST_MAIN(void) { run_test("Tokenizer: KDLv2 strings", &test_tokenizer_strings); @@ -162,4 +175,5 @@ void TEST_MAIN(void) run_test("Tokenizer: KDLv2 whitespace", &test_tokenizer_whitespace); run_test("Tokenizer: byte-order-mark", &test_tokenizer_bom); run_test("Tokenizer: illegal codepoints", &test_tokenizer_illegal_codepoints); + run_test("Tokenizer: KDLv2 equals sign", &test_tokenizer_equals); } From 68719ecdf7c62b396f596dde0a1a843f6dfea33b Mon Sep 17 00:00:00 2001 From: Thomas Jollans Date: Sat, 25 May 2024 10:30:10 +0200 Subject: [PATCH 09/45] Add options for language version I'm trying to add the options in such a way as to get this backwards compatibility story: - ABI compatibility: a program compiled with an old version should have unchanged behaviour when the library is substituted; This includes not accepting KDLv2 documents. - API compatibility: a program recompiled from source with a new version should (eventually) accept KDLv2 without any further changes. This will be achieved by changing the definition of KDL_DEFAULTS. For now, KDL_DEFAULTS is unchanged, i.e., reject KDLv2 (keeping the tests running) --- include/kdl/parser.h | 7 +++++-- include/kdl/tokenizer.h | 8 ++++---- src/parser.c | 31 ++++++++++++++++++++++++------- 3 files changed, 33 insertions(+), 13 deletions(-) diff --git a/include/kdl/parser.h b/include/kdl/parser.h index 8e30778..c4b6f9a 100644 --- a/include/kdl/parser.h +++ b/include/kdl/parser.h @@ -25,8 +25,11 @@ enum kdl_event { // Parser configuration enum kdl_parse_option { - KDL_DEFAULTS = 0, // Nothing special - KDL_EMIT_COMMENTS = 1 // Emit comments (default: don't) + KDL_DEFAULTS = 0, // Nothing special + KDL_EMIT_COMMENTS = 0x001, // Emit comments (default: don't) + KDL_VERSION_1 = 0x20000, // Use KDL version 1.0.0 + KDL_VERSION_2 = 0x40000, // Use KDL version 2.0.0-draft.4 + KDL_DETECT_VERSION = 0x70000, // Allow both KDL v2 and KDL v1 }; typedef enum kdl_event kdl_event; diff --git a/include/kdl/tokenizer.h b/include/kdl/tokenizer.h index a92aec0..9254395 100644 --- a/include/kdl/tokenizer.h +++ b/include/kdl/tokenizer.h @@ -21,7 +21,6 @@ enum kdl_token_type { KDL_TOKEN_WORD, // identifier, number, boolean, or null KDL_TOKEN_STRING, // regular string KDL_TOKEN_RAW_STRING, // KDLV1 raw string - KDL_TOKEN_RAW_STRING_V2, // KDLv2 raw string KDL_TOKEN_SINGLE_LINE_COMMENT, // // ... KDL_TOKEN_SLASHDASH, // /- KDL_TOKEN_MULTI_LINE_COMMENT, // /* ... */ @@ -31,13 +30,14 @@ enum kdl_token_type { KDL_TOKEN_NEWLINE, // LF, CR, or CRLF KDL_TOKEN_SEMICOLON, // ';' KDL_TOKEN_LINE_CONTINUATION, // '\\' - KDL_TOKEN_WHITESPACE // any regular whitespace + KDL_TOKEN_WHITESPACE, // any regular whitespace + KDL_TOKEN_RAW_STRING_V2, // KDLv2 raw string }; // Character set configuration enum kdl_character_set { - KDL_CHARACTER_SET_V1 = 1, // V1 character set: BOM is whitespace, vertical tab is not, etc. - KDL_CHARACTER_SET_V2 = 2, // V2 character set: control characters restricted, etc. + KDL_CHARACTER_SET_V1 = 1, // V1 character set: BOM is whitespace, vertical tab is not, etc. + KDL_CHARACTER_SET_V2 = 2, // V2 character set: control characters restricted, etc. KDL_CHARACTER_SET_DEFAULT = KDL_CHARACTER_SET_V2 }; diff --git a/src/parser.c b/src/parser.c index 37af5c3..13c05d9 100644 --- a/src/parser.c +++ b/src/parser.c @@ -15,6 +15,9 @@ #define _str_equals_literal(k, l) \ ((k).len == (sizeof(l "") - 1) && 0 == memcmp(("" l), (k).data, (sizeof(l) - 1))) +#define KDL_DETECT_VERSION_BIT (kdl_parse_option)0x10000 +#define KDL_PARSE_OPT_VERSION_BITS KDL_DETECT_VERSION + enum _kdl_parser_state { // Basic states PARSER_OUTSIDE_NODE, @@ -47,7 +50,7 @@ struct _kdl_parser { bool have_next_token; }; -static void _init_kdl_parser(kdl_parser* self) +static void _init_kdl_parser(kdl_parser* self, kdl_parse_option opt) { self->depth = 0; self->slashdash_depth = -1; @@ -56,16 +59,31 @@ static void _init_kdl_parser(kdl_parser* self) self->tmp_string_key = (kdl_owned_string){NULL, 0}; self->tmp_string_value = (kdl_owned_string){NULL, 0}; self->have_next_token = false; + + // Fallback: use KDLv1 only + if (opt & KDL_PARSE_OPT_VERSION_BITS) { + opt |= KDL_VERSION_1; + } + + self->opt = opt; +} + +inline static kdl_character_set _default_character_set(kdl_parse_option opt) +{ + if (opt & KDL_VERSION_2) { + return KDL_CHARACTER_SET_V2; + } else { + return KDL_CHARACTER_SET_V1; + } } kdl_parser* kdl_create_string_parser(kdl_str doc, kdl_parse_option opt) { kdl_parser* self = malloc(sizeof(kdl_parser)); if (self != NULL) { - _init_kdl_parser(self); + _init_kdl_parser(self, opt); self->tokenizer = kdl_create_string_tokenizer(doc); - self->opt = opt; - kdl_tokenizer_set_character_set(self->tokenizer, KDL_CHARACTER_SET_V1); + kdl_tokenizer_set_character_set(self->tokenizer, _default_character_set(self->opt)); } return self; } @@ -74,10 +92,9 @@ kdl_parser* kdl_create_stream_parser(kdl_read_func read_func, void* user_data, k { kdl_parser* self = malloc(sizeof(kdl_parser)); if (self != NULL) { - _init_kdl_parser(self); + _init_kdl_parser(self, opt); self->tokenizer = kdl_create_stream_tokenizer(read_func, user_data); - self->opt = opt; - kdl_tokenizer_set_character_set(self->tokenizer, KDL_CHARACTER_SET_V1); + kdl_tokenizer_set_character_set(self->tokenizer, _default_character_set(self->opt)); } return self; } From 2bc2e9379e812e9cab1874b40a0d954b5aec9655 Mon Sep 17 00:00:00 2001 From: Thomas Jollans Date: Sat, 25 May 2024 12:44:44 +0200 Subject: [PATCH 10/45] allow v2 raw strings in parser --- include/kdl/tokenizer.h | 4 +-- src/parser.c | 66 +++++++++++++++++++++++++---------- src/tokenizer.c | 4 +-- src/utils/ckdl-parse-events.c | 10 +++++- src/utils/ckdl-tokenize.c | 4 +-- tests/kdlv2_test.c | 64 ++++++++++++++++++++++++++++++++- 6 files changed, 126 insertions(+), 26 deletions(-) diff --git a/include/kdl/tokenizer.h b/include/kdl/tokenizer.h index 9254395..8b6c822 100644 --- a/include/kdl/tokenizer.h +++ b/include/kdl/tokenizer.h @@ -20,7 +20,8 @@ enum kdl_token_type { KDL_TOKEN_END_TYPE, // ')' KDL_TOKEN_WORD, // identifier, number, boolean, or null KDL_TOKEN_STRING, // regular string - KDL_TOKEN_RAW_STRING, // KDLV1 raw string + KDL_TOKEN_RAW_STRING_V1, // KDLV1 raw string + KDL_TOKEN_RAW_STRING_V2, // KDLv2 raw string KDL_TOKEN_SINGLE_LINE_COMMENT, // // ... KDL_TOKEN_SLASHDASH, // /- KDL_TOKEN_MULTI_LINE_COMMENT, // /* ... */ @@ -31,7 +32,6 @@ enum kdl_token_type { KDL_TOKEN_SEMICOLON, // ';' KDL_TOKEN_LINE_CONTINUATION, // '\\' KDL_TOKEN_WHITESPACE, // any regular whitespace - KDL_TOKEN_RAW_STRING_V2, // KDLv2 raw string }; // Character set configuration diff --git a/src/parser.c b/src/parser.c index 13c05d9..0091243 100644 --- a/src/parser.c +++ b/src/parser.c @@ -18,6 +18,11 @@ #define KDL_DETECT_VERSION_BIT (kdl_parse_option)0x10000 #define KDL_PARSE_OPT_VERSION_BITS KDL_DETECT_VERSION +#define _v1_only(self) ((self->opt & KDL_PARSE_OPT_VERSION_BITS) == KDL_VERSION_1) +#define _v1_allowed(self) ((self->opt & KDL_VERSION_1) == KDL_VERSION_1) +#define _v2_only(self) ((self->opt & KDL_PARSE_OPT_VERSION_BITS) == KDL_VERSION_2) +#define _v2_allowed(self) ((self->opt & KDL_VERSION_2) == KDL_VERSION_2) + enum _kdl_parser_state { // Basic states PARSER_OUTSIDE_NODE, @@ -61,7 +66,7 @@ static void _init_kdl_parser(kdl_parser* self, kdl_parse_option opt) self->have_next_token = false; // Fallback: use KDLv1 only - if (opt & KDL_PARSE_OPT_VERSION_BITS) { + if ((opt & KDL_PARSE_OPT_VERSION_BITS) == 0) { opt |= KDL_VERSION_1; } @@ -108,6 +113,11 @@ void kdl_destroy_parser(kdl_parser* self) free(self); } +static void _set_version(kdl_parser *self, kdl_parse_option version) { + self->opt = (self->opt & ~KDL_PARSE_OPT_VERSION_BITS) | version; + kdl_tokenizer_set_character_set(self->tokenizer, _default_character_set(self->opt)); +} + static void _reset_event(kdl_parser* self) { self->event.name = (kdl_str){NULL, 0}; @@ -132,7 +142,7 @@ static void _set_comment_event(kdl_parser* self, kdl_token const* token) static kdl_event_data* _next_node(kdl_parser* self, kdl_token* token); static kdl_event_data* _next_event_in_node(kdl_parser* self, kdl_token* token); static kdl_event_data* _apply_slashdash(kdl_parser* self); -static bool _parse_value(kdl_token const* token, kdl_value* val, kdl_owned_string* s); +static bool _parse_value(kdl_parser * self, kdl_token const* token, kdl_value* val, kdl_owned_string* s); static bool _parse_number(kdl_str number, kdl_value* val, kdl_owned_string* s); static bool _parse_decimal_number(kdl_str number, kdl_value* val, kdl_owned_string* s); static bool _parse_decimal_integer(kdl_str number, kdl_value* val, kdl_owned_string* s); @@ -266,8 +276,9 @@ static kdl_event_data* _next_node(kdl_parser* self, kdl_token* token) switch (token->type) { case KDL_TOKEN_WORD: case KDL_TOKEN_STRING: - case KDL_TOKEN_RAW_STRING: - if (!_parse_value(token, &tmp_val, &self->tmp_string_type)) { + case KDL_TOKEN_RAW_STRING_V1: + case KDL_TOKEN_RAW_STRING_V2: + if (!_parse_value(self, token, &tmp_val, &self->tmp_string_type)) { _set_parse_error(self, "Error parsing type annotation"); return &self->event; } @@ -317,8 +328,9 @@ static kdl_event_data* _next_node(kdl_parser* self, kdl_token* token) } case KDL_TOKEN_WORD: case KDL_TOKEN_STRING: - case KDL_TOKEN_RAW_STRING: - if (!_parse_value(token, &tmp_val, &self->tmp_string_key)) { + case KDL_TOKEN_RAW_STRING_V1: + case KDL_TOKEN_RAW_STRING_V2: + if (!_parse_value(self, token, &tmp_val, &self->tmp_string_key)) { _set_parse_error(self, "Error parsing node name"); return &self->event; } @@ -378,8 +390,9 @@ static kdl_event_data* _next_event_in_node(kdl_parser* self, kdl_token* token) switch (token->type) { case KDL_TOKEN_WORD: case KDL_TOKEN_STRING: - case KDL_TOKEN_RAW_STRING: - if (!_parse_value(token, &tmp_val, &self->tmp_string_type)) { + case KDL_TOKEN_RAW_STRING_V1: + case KDL_TOKEN_RAW_STRING_V2: + if (!_parse_value(self, token, &tmp_val, &self->tmp_string_type)) { _set_parse_error(self, "Error parsing type annotation"); return &self->event; } @@ -434,7 +447,8 @@ static kdl_event_data* _next_event_in_node(kdl_parser* self, kdl_token* token) } case KDL_TOKEN_WORD: case KDL_TOKEN_STRING: - case KDL_TOKEN_RAW_STRING: { + case KDL_TOKEN_RAW_STRING_V1: + case KDL_TOKEN_RAW_STRING_V2: { kdl_owned_string tmp_str = {NULL, 0}; // either a property key, or a property value, or an argument if (self->event.name.data == NULL && self->event.value.type_annotation.data == NULL) { @@ -466,7 +480,7 @@ static kdl_event_data* _next_event_in_node(kdl_parser* self, kdl_token* token) // Parse the property name self->state |= PARSER_FLAG_IN_PROPERTY; kdl_value tmp_val; - bool parse_ok = _parse_value(token, &tmp_val, &self->tmp_string_key); + bool parse_ok = _parse_value(self, token, &tmp_val, &self->tmp_string_key); kdl_free_string(&tmp_str); if (!parse_ok) { _set_parse_error(self, "Error parsing property key"); @@ -482,7 +496,7 @@ static kdl_event_data* _next_event_in_node(kdl_parser* self, kdl_token* token) } } else { // Parse the argument - bool parse_ok = _parse_value(token, &self->event.value, &self->tmp_string_value); + bool parse_ok = _parse_value(self, token, &self->event.value, &self->tmp_string_value); kdl_free_string(&tmp_str); if (!parse_ok) { _set_parse_error(self, "Error parsing argument"); @@ -533,17 +547,33 @@ static kdl_event_data* _next_event_in_node(kdl_parser* self, kdl_token* token) } } -static bool _parse_value(kdl_token const* token, kdl_value* val, kdl_owned_string* s) +static bool _parse_value(kdl_parser * self, kdl_token const* token, kdl_value* val, kdl_owned_string* s) { kdl_free_string(s); switch (token->type) { - case KDL_TOKEN_RAW_STRING: - // no parsing necessary - *s = kdl_clone_str(&token->value); - val->type = KDL_TYPE_STRING; - val->string = kdl_borrow_str(s); - return true; + case KDL_TOKEN_RAW_STRING_V1: + if (_v1_allowed(self)) { + _set_version(self, KDL_VERSION_1); + // no parsing necessary + *s = kdl_clone_str(&token->value); + val->type = KDL_TYPE_STRING; + val->string = kdl_borrow_str(s); + return true; + } else { + return false; + } + case KDL_TOKEN_RAW_STRING_V2: + if (_v2_allowed(self)) { + _set_version(self, KDL_VERSION_2); + // no parsing necessary + *s = kdl_clone_str(&token->value); + val->type = KDL_TYPE_STRING; + val->string = kdl_borrow_str(s); + return true; + } else { + return false; + } case KDL_TOKEN_STRING: // parse escapes *s = kdl_unescape(&token->value); diff --git a/src/tokenizer.c b/src/tokenizer.c index a15a2ea..9f035da 100644 --- a/src/tokenizer.c +++ b/src/tokenizer.c @@ -532,12 +532,12 @@ static kdl_tokenizer_status _pop_raw_string(kdl_tokenizer* self, kdl_token* dest uint32_t c = 0; char const* cur = self->document.data; char const* next = NULL; - kdl_token_type type = KDL_TOKEN_RAW_STRING; + kdl_token_type type = KDL_TOKEN_RAW_STRING_V1; if (_tok_get_char(self, &cur, &next, &c) != KDL_UTF8_OK) return KDL_TOKENIZER_ERROR; switch (c) { case 'r': - type = KDL_TOKEN_RAW_STRING; + type = KDL_TOKEN_RAW_STRING_V1; cur = next; break; case '#': diff --git a/src/utils/ckdl-parse-events.c b/src/utils/ckdl-parse-events.c index 54b89a4..0725e53 100644 --- a/src/utils/ckdl-parse-events.c +++ b/src/utils/ckdl-parse-events.c @@ -22,13 +22,15 @@ void print_usage(char const* argv0, FILE* fp) fprintf(fp, "Usage: %s [-h] [-c]\n\n", argv0); fprintf(fp, " -h Print usage information\n"); fprintf(fp, " -c Emit comments\n"); + fprintf(fp, " -1 KDLv1 only\n"); + fprintf(fp, " -2 KDLv2 only\n"); } int main(int argc, char** argv) { FILE* in = stdin; char const* argv0 = argv[0]; - kdl_parse_option parse_opts = KDL_DEFAULTS; + kdl_parse_option parse_opts = KDL_DETECT_VERSION; bool opts_ended = false; while (--argc) { @@ -41,6 +43,12 @@ int main(int argc, char** argv) return 0; } else if (*p == 'c') { parse_opts |= KDL_EMIT_COMMENTS; + } else if (*p == '1') { + parse_opts &= ~KDL_DETECT_VERSION; + parse_opts |= KDL_VERSION_1; + } else if (*p == '2') { + parse_opts &= ~KDL_DETECT_VERSION; + parse_opts |= KDL_VERSION_2; } else if (*p == '-') { opts_ended = true; } else { diff --git a/src/utils/ckdl-tokenize.c b/src/utils/ckdl-tokenize.c index 0bdbfa1..6d496cc 100644 --- a/src/utils/ckdl-tokenize.c +++ b/src/utils/ckdl-tokenize.c @@ -73,8 +73,8 @@ int main(int argc, char** argv) case KDL_TOKEN_STRING: token_type_name = "KDL_TOKEN_STRING"; break; - case KDL_TOKEN_RAW_STRING: - token_type_name = "KDL_TOKEN_RAW_STRING"; + case KDL_TOKEN_RAW_STRING_V1: + token_type_name = "KDL_TOKEN_RAW_STRING_V1"; break; case KDL_TOKEN_RAW_STRING_V2: token_type_name = "KDL_TOKEN_RAW_STRING_V2"; diff --git a/tests/kdlv2_test.c b/tests/kdlv2_test.c index a49bbb4..e972fc8 100644 --- a/tests/kdlv2_test.c +++ b/tests/kdlv2_test.c @@ -17,7 +17,7 @@ static void test_tokenizer_strings(void) kdl_tokenizer* tok = kdl_create_string_tokenizer(k_doc_v1); ASSERT(kdl_pop_token(tok, &token) == KDL_TOKENIZER_OK); - ASSERT(token.type == KDL_TOKEN_RAW_STRING); + ASSERT(token.type == KDL_TOKEN_RAW_STRING_V1); ASSERT(token.value.len == 7); ASSERT(memcmp(token.value.data, "abc\"def", 7) == 0); @@ -168,6 +168,66 @@ static void test_tokenizer_equals(void) kdl_destroy_tokenizer(tok); } +static void test_parser_v1_raw_string(void) +{ + kdl_str doc = kdl_str_from_cstr("r#\"a\"# "); + kdl_event_data* ev; + + kdl_parser* parser = kdl_create_string_parser(doc, KDL_VERSION_1); + + ev = kdl_parser_next_event(parser); + ASSERT(ev->event == KDL_EVENT_START_NODE); + ASSERT(memcmp(ev->name.data, "a", 1) == 0); + + kdl_destroy_parser(parser); + + parser = kdl_create_string_parser(doc, KDL_DETECT_VERSION); + + ev = kdl_parser_next_event(parser); + ASSERT(ev->event == KDL_EVENT_START_NODE); + ASSERT(memcmp(ev->name.data, "a", 1) == 0); + + kdl_destroy_parser(parser); + + parser = kdl_create_string_parser(doc, KDL_DEFAULTS); + + ev = kdl_parser_next_event(parser); + ASSERT(ev->event == KDL_EVENT_START_NODE); + ASSERT(memcmp(ev->name.data, "a", 1) == 0); + + kdl_destroy_parser(parser); + + // Test that V1 raw strings are illegal in V2 + parser = kdl_create_string_parser(doc, KDL_VERSION_2); + + ev = kdl_parser_next_event(parser); + ASSERT(ev->event == KDL_EVENT_PARSE_ERROR); + + kdl_destroy_parser(parser); +} + +static void test_parser_v2_raw_string(void) +{ + kdl_str doc = kdl_str_from_cstr("#\"a\"#"); + kdl_event_data* ev; + + kdl_parser* parser = kdl_create_string_parser(doc, KDL_VERSION_2); + + ev = kdl_parser_next_event(parser); + ASSERT(ev->event == KDL_EVENT_START_NODE); + ASSERT(memcmp(ev->name.data, "a", 1) == 0); + + kdl_destroy_parser(parser); + + parser = kdl_create_string_parser(doc, KDL_DETECT_VERSION); + + ev = kdl_parser_next_event(parser); + ASSERT(ev->event == KDL_EVENT_START_NODE); + ASSERT(memcmp(ev->name.data, "a", 1) == 0); + + kdl_destroy_parser(parser); +} + void TEST_MAIN(void) { run_test("Tokenizer: KDLv2 strings", &test_tokenizer_strings); @@ -176,4 +236,6 @@ void TEST_MAIN(void) run_test("Tokenizer: byte-order-mark", &test_tokenizer_bom); run_test("Tokenizer: illegal codepoints", &test_tokenizer_illegal_codepoints); run_test("Tokenizer: KDLv2 equals sign", &test_tokenizer_equals); + run_test("Parser: KDLv1 raw string", &test_parser_v1_raw_string); + run_test("Parser: KDLv2 raw string", &test_parser_v2_raw_string); } From 24584e98275aff107684005bdce819fe3bd99d2b Mon Sep 17 00:00:00 2001 From: Thomas Jollans Date: Sat, 25 May 2024 14:40:56 +0200 Subject: [PATCH 11/45] KDLv2 string escapes --- include/kdl/common.h | 14 +++- src/str.c | 173 ++++++++++++++++++++++++++++++++++++++++++- tests/kdlv2_test.c | 20 ++++- 3 files changed, 200 insertions(+), 7 deletions(-) diff --git a/include/kdl/common.h b/include/kdl/common.h index 50d8402..f4809f8 100644 --- a/include/kdl/common.h +++ b/include/kdl/common.h @@ -56,9 +56,19 @@ KDL_NODISCARD KDL_EXPORT kdl_owned_string kdl_clone_str(kdl_str const* s); // Free the memory associated with an owned string, and set the pointer to NULL KDL_EXPORT void kdl_free_string(kdl_owned_string* s); -// Escape special characters in a string according to KDL string rules +// Escape special characters in a string according to KDLv1 string rules +KDL_NODISCARD KDL_EXPORT kdl_owned_string kdl_escape_v1(kdl_str const* s, kdl_escape_mode mode); +// Resolve backslash escape sequences according to KDLv1 rules +KDL_NODISCARD KDL_EXPORT kdl_owned_string kdl_unescape_v1(kdl_str const* s); + +// Escape special characters in a string according to KDLv2 string rules +KDL_NODISCARD KDL_EXPORT kdl_owned_string kdl_escape_v2(kdl_str const* s, kdl_escape_mode mode); +// Resolve backslash escape sequences according to KDLv2 rules +KDL_NODISCARD KDL_EXPORT kdl_owned_string kdl_unescape_v2(kdl_str const* s); + +// Escape special characters in a string according to KDLv1 string rules (subject to change) KDL_NODISCARD KDL_EXPORT kdl_owned_string kdl_escape(kdl_str const* s, kdl_escape_mode mode); -// Resolve backslash escape sequences +// Resolve backslash escape sequences according to KDLv1 rules (subject to change) KDL_NODISCARD KDL_EXPORT kdl_owned_string kdl_unescape(kdl_str const* s); #ifdef __cplusplus diff --git a/src/str.c b/src/str.c index 6924c89..a463ae3 100644 --- a/src/str.c +++ b/src/str.c @@ -1,5 +1,6 @@ #include "str.h" #include "compat.h" +#include "grammar.h" #include "kdl/common.h" #include "utf8.h" @@ -103,7 +104,11 @@ kdl_owned_string _kdl_buf_to_string(_kdl_write_buffer* buf) return s; } -kdl_owned_string kdl_escape(kdl_str const* s, kdl_escape_mode mode) +kdl_owned_string kdl_escape(kdl_str const* s, kdl_escape_mode mode) { return kdl_escape_v1(s, mode); } + +kdl_owned_string kdl_unescape(kdl_str const* s) { return kdl_unescape_v1(s); } + +kdl_owned_string kdl_escape_v1(kdl_str const* s, kdl_escape_mode mode) { kdl_owned_string result; kdl_str unescaped = *s; @@ -167,7 +172,7 @@ kdl_owned_string kdl_escape(kdl_str const* s, kdl_escape_mode mode) return result; } -kdl_owned_string kdl_unescape(kdl_str const* s) +kdl_owned_string kdl_unescape_v1(kdl_str const* s) { kdl_owned_string result; kdl_str escaped = *s; @@ -234,11 +239,171 @@ kdl_owned_string kdl_unescape(kdl_str const* s) ++p; break; default: - // emit backslash instead + // stray backslashes are not allowed + goto unesc_error; + } + } + + char const* start = p; + while (p != end && *p != '\\') ++p; + // copy everything until the backslash + if (!_kdl_buf_push_chars(&buf, start, (p - start))) goto unesc_error; + } + + return _kdl_buf_to_string(&buf); + +unesc_error: + _kdl_free_write_buffer(&buf); + result = (kdl_owned_string){NULL, 0}; + return result; +} + +kdl_owned_string kdl_escape_v2(kdl_str const* s, kdl_escape_mode mode) +{ + kdl_owned_string result; + kdl_str unescaped = *s; + + size_t orig_len = unescaped.len; + _kdl_write_buffer buf = _kdl_new_write_buffer(2 * orig_len); + if (buf.buf == NULL) goto esc_error; + + uint32_t c; + + while (true) { + char const* orig_char = unescaped.data; + switch (_kdl_pop_codepoint(&unescaped, &c)) { + case KDL_UTF8_EOF: + goto esc_eof; + case KDL_UTF8_OK: + break; + default: // error + goto esc_error; + } + + if (c > 0x10ffff) { + // Not a valid character + goto esc_error; + } else if (c == 0x0A && (mode & KDL_ESCAPE_NEWLINE)) { + if (!_kdl_buf_push_chars(&buf, "\\n", 2)) goto esc_error; + } else if (c == 0x0D && (mode & KDL_ESCAPE_NEWLINE)) { + if (!_kdl_buf_push_chars(&buf, "\\r", 2)) goto esc_error; + } else if (c == 0x09 && (mode & KDL_ESCAPE_TAB)) { + if (!_kdl_buf_push_chars(&buf, "\\t", 2)) goto esc_error; + } else if (c == 0x5C) { + if (!_kdl_buf_push_chars(&buf, "\\\\", 2)) goto esc_error; + } else if (c == 0x22) { + if (!_kdl_buf_push_chars(&buf, "\\\"", 2)) goto esc_error; + } else if (c == 0x08 && (mode & KDL_ESCAPE_CONTROL)) { + if (!_kdl_buf_push_chars(&buf, "\\b", 2)) goto esc_error; + } else if (c == 0x0C && (mode & KDL_ESCAPE_NEWLINE)) { + if (!_kdl_buf_push_chars(&buf, "\\f", 2)) goto esc_error; + } else if (_kdl_is_illegal_char(KDL_CHARACTER_SET_V2, c) + || ((mode & KDL_ESCAPE_CONTROL) && c == 0x0B /* vertical tab */) + || ((mode & KDL_ESCAPE_NEWLINE) && (c == 0x85 || c == 0x2028 || c == 0x2029)) + || ((mode & KDL_ESCAPE_ASCII_MODE) == KDL_ESCAPE_ASCII_MODE && c >= 0x7f)) { + // \u escape + char u_esc_buf[11]; + int count = snprintf(u_esc_buf, 11, "\\u{%x}", (unsigned int)c); + if (count < 0 || !_kdl_buf_push_chars(&buf, u_esc_buf, count)) { + goto esc_error; + } + } else { + // keep the rest + _kdl_buf_push_chars(&buf, orig_char, unescaped.data - orig_char); + } + } +esc_eof: + return _kdl_buf_to_string(&buf); + +esc_error: + _kdl_free_write_buffer(&buf); + result = (kdl_owned_string){NULL, 0}; + return result; +} + +kdl_owned_string kdl_unescape_v2(kdl_str const* s) +{ + kdl_owned_string result; + kdl_str escaped = *s; + + size_t orig_len = escaped.len; + _kdl_write_buffer buf = _kdl_new_write_buffer(2 * orig_len); + if (buf.buf == NULL) goto unesc_error; + + char const* p = s->data; + char const* end = p + s->len; + + while (p != end) { + if (*p == '\\') { + // deal with the escape + if (++p == end) goto unesc_error; + switch (*p) { + case 'n': + _kdl_buf_push_char(&buf, '\n'); + ++p; + break; + case 'r': + _kdl_buf_push_char(&buf, '\r'); + ++p; + break; + case 't': + _kdl_buf_push_char(&buf, '\t'); + ++p; + break; + case 's': + _kdl_buf_push_char(&buf, ' '); + ++p; + break; + case '\\': _kdl_buf_push_char(&buf, '\\'); - // don't eat the character after the backslash + ++p; + break; + case '"': + _kdl_buf_push_char(&buf, '\"'); + ++p; + break; + case 'b': + _kdl_buf_push_char(&buf, '\b'); + ++p; + break; + case 'f': + _kdl_buf_push_char(&buf, '\f'); + ++p; + break; + case 'u': { + // u should be followed by { + if (++p == end || *(p++) != '{') goto unesc_error; + // parse hex + uint32_t c = 0; + for (;; ++p) { + if (p == end) goto unesc_error; + else if (*p == '}') break; + else if (*p >= '0' && *p <= '9') c = (c << 4) + (*p - '0'); + else if (*p >= 'a' && *p <= 'f') c = (c << 4) + (*p - 'a' + 0xa); + else if (*p >= 'A' && *p <= 'F') c = (c << 4) + (*p - 'A' + 0xa); + else goto unesc_error; + } + if (!_kdl_buf_push_codepoint(&buf, c)) goto unesc_error; + ++p; break; } + default: { + // See if this is a whitespace escape + kdl_str tail = (kdl_str){.data = p, .len = end - p}; + uint32_t c = 0; + bool skipped_whitespace = false; + while (_kdl_pop_codepoint(&tail, &c) == KDL_UTF8_OK + && (_kdl_is_whitespace(KDL_CHARACTER_SET_V2, c) || _kdl_is_newline(c))) { + skipped_whitespace = true; + // update pointer + p = tail.data; + } + if (!skipped_whitespace) { + // stray backslashes are not allowed + goto unesc_error; + } + } + } } char const* start = p; diff --git a/tests/kdlv2_test.c b/tests/kdlv2_test.c index e972fc8..21089c9 100644 --- a/tests/kdlv2_test.c +++ b/tests/kdlv2_test.c @@ -112,7 +112,6 @@ static void test_tokenizer_bom(void) ASSERT(kdl_pop_token(tok, &token) == KDL_TOKENIZER_ERROR); kdl_destroy_tokenizer(tok); - } static void test_tokenizer_illegal_codepoints(void) @@ -168,6 +167,24 @@ static void test_tokenizer_equals(void) kdl_destroy_tokenizer(tok); } +static void test_string_escapes(void) +{ + kdl_str s = kdl_str_from_cstr("\\s\\ \n\n\t \\u{1b}"); + kdl_owned_string unesc = kdl_unescape_v2(&s); + + ASSERT(unesc.len == 2); + ASSERT(memcmp(unesc.data, " \x1b", 2) == 0); + + kdl_str unesc_ = kdl_borrow_str(&unesc); + kdl_owned_string reesc = kdl_escape_v2(&unesc_, KDL_ESCAPE_DEFAULT); + + ASSERT(reesc.len == 7); + ASSERT(memcmp(reesc.data, " \\u{1b}", 7) == 0); + + kdl_free_string(&unesc); + kdl_free_string(&reesc); +} + static void test_parser_v1_raw_string(void) { kdl_str doc = kdl_str_from_cstr("r#\"a\"# "); @@ -236,6 +253,7 @@ void TEST_MAIN(void) run_test("Tokenizer: byte-order-mark", &test_tokenizer_bom); run_test("Tokenizer: illegal codepoints", &test_tokenizer_illegal_codepoints); run_test("Tokenizer: KDLv2 equals sign", &test_tokenizer_equals); + run_test("Strings: KDLv2 escapes", &test_string_escapes); run_test("Parser: KDLv1 raw string", &test_parser_v1_raw_string); run_test("Parser: KDLv2 raw string", &test_parser_v2_raw_string); } From 083a52facf120d9c91608ea06f236bfd4152cf2a Mon Sep 17 00:00:00 2001 From: Thomas Jollans Date: Sat, 25 May 2024 17:23:03 +0200 Subject: [PATCH 12/45] KDLv2 multiline strings --- src/str.c | 204 ++++++++++++++++++++++++++++++++++----------- src/str.h | 2 + tests/kdlv2_test.c | 51 +++++++++++- 3 files changed, 209 insertions(+), 48 deletions(-) diff --git a/src/str.c b/src/str.c index a463ae3..2194d8c 100644 --- a/src/str.c +++ b/src/str.c @@ -324,98 +324,208 @@ kdl_owned_string kdl_escape_v2(kdl_str const* s, kdl_escape_mode mode) kdl_owned_string kdl_unescape_v2(kdl_str const* s) { kdl_owned_string result; - kdl_str escaped = *s; + kdl_owned_string dedented = _kdl_dedent_multiline_string(s); + kdl_str escaped = kdl_borrow_str(&dedented); size_t orig_len = escaped.len; - _kdl_write_buffer buf = _kdl_new_write_buffer(2 * orig_len); + _kdl_write_buffer buf = _kdl_new_write_buffer(orig_len); if (buf.buf == NULL) goto unesc_error; + if (dedented.data == NULL) goto unesc_error; - char const* p = s->data; - char const* end = p + s->len; + uint32_t c = 0; + kdl_utf8_status status; - while (p != end) { - if (*p == '\\') { - // deal with the escape - if (++p == end) goto unesc_error; - switch (*p) { + while ((status = _kdl_pop_codepoint(&escaped, &c)) == KDL_UTF8_OK) { + if (_kdl_is_illegal_char(KDL_CHARACTER_SET_V2, c)) { + goto unesc_error; + } else if (c == '\\') { + if (_kdl_pop_codepoint(&escaped, &c) != KDL_UTF8_OK) goto unesc_error; + + switch (c) { case 'n': _kdl_buf_push_char(&buf, '\n'); - ++p; break; case 'r': _kdl_buf_push_char(&buf, '\r'); - ++p; break; case 't': _kdl_buf_push_char(&buf, '\t'); - ++p; break; case 's': _kdl_buf_push_char(&buf, ' '); - ++p; break; case '\\': _kdl_buf_push_char(&buf, '\\'); - ++p; break; case '"': _kdl_buf_push_char(&buf, '\"'); - ++p; break; case 'b': _kdl_buf_push_char(&buf, '\b'); - ++p; break; case 'f': _kdl_buf_push_char(&buf, '\f'); - ++p; break; case 'u': { // u should be followed by { - if (++p == end || *(p++) != '{') goto unesc_error; - // parse hex - uint32_t c = 0; - for (;; ++p) { - if (p == end) goto unesc_error; - else if (*p == '}') break; - else if (*p >= '0' && *p <= '9') c = (c << 4) + (*p - '0'); - else if (*p >= 'a' && *p <= 'f') c = (c << 4) + (*p - 'a' + 0xa); - else if (*p >= 'A' && *p <= 'F') c = (c << 4) + (*p - 'A' + 0xa); + if (_kdl_pop_codepoint(&escaped, &c) != KDL_UTF8_OK || c != '{') goto unesc_error; + + uint32_t r = 0; + while ((status = _kdl_pop_codepoint(&escaped, &c)) == KDL_UTF8_OK) { + // parse hex + if (c == '}') break; + else if (c >= '0' && c <= '9') r = (r << 4) + (c - '0'); + else if (c >= 'a' && c <= 'f') r = (r << 4) + (c - 'a' + 0xa); + else if (c >= 'A' && c <= 'F') r = (r << 4) + (c - 'A' + 0xa); else goto unesc_error; } - if (!_kdl_buf_push_codepoint(&buf, c)) goto unesc_error; - ++p; + if (status != KDL_UTF8_OK) goto unesc_error; + if (!_kdl_buf_push_codepoint(&buf, r)) goto unesc_error; break; } - default: { + default: // See if this is a whitespace escape - kdl_str tail = (kdl_str){.data = p, .len = end - p}; - uint32_t c = 0; - bool skipped_whitespace = false; - while (_kdl_pop_codepoint(&tail, &c) == KDL_UTF8_OK - && (_kdl_is_whitespace(KDL_CHARACTER_SET_V2, c) || _kdl_is_newline(c))) { - skipped_whitespace = true; - // update pointer - p = tail.data; - } - if (!skipped_whitespace) { - // stray backslashes are not allowed + if (_kdl_is_whitespace(KDL_CHARACTER_SET_V2, c) || _kdl_is_newline(c)) { + kdl_str tail = escaped; // make a copy - we will advance too far + while ((status = _kdl_pop_codepoint(&tail, &c)) == KDL_UTF8_OK + && (_kdl_is_whitespace(KDL_CHARACTER_SET_V2, c) || _kdl_is_newline(c))) { + // skip this char + escaped = tail; + } + // if there is a UTF-8 error, this will be discovered on the + // next iteration of the outer loop + break; + } else { + // Not whitespace - backslash is illegal here goto unesc_error; } } - } + } else { + // Nothing special, copy the character + _kdl_buf_push_codepoint(&buf, c); } - - char const* start = p; - while (p != end && *p != '\\') ++p; - // copy everything until the backslash - if (!_kdl_buf_push_chars(&buf, start, (p - start))) goto unesc_error; } - return _kdl_buf_to_string(&buf); + if (status == KDL_UTF8_EOF) { + // ok + kdl_free_string(&dedented); + result = _kdl_buf_to_string(&buf); + return result; + } else { + goto unesc_error; + } unesc_error: + kdl_free_string(&dedented); _kdl_free_write_buffer(&buf); result = (kdl_owned_string){NULL, 0}; return result; } + +kdl_owned_string _kdl_dedent_multiline_string(kdl_str const* s) +{ + kdl_owned_string result; + + uint32_t c; + kdl_str orig = *s; + kdl_utf8_status status; + + char* buf_dedented = NULL; + + // Normalize newlines first + _kdl_write_buffer buf_norm_lf = _kdl_new_write_buffer(s->len); + + while ((status = _kdl_pop_codepoint(&orig, &c)) == KDL_UTF8_OK) { + if (_kdl_is_newline(c)) { + // Normalize CRLF + if (c == '\r' && orig.len >= 1 && orig.data[0] == '\n') { + ++orig.data; + --orig.len; + } + // every newline becomes a line feed + _kdl_buf_push_char(&buf_norm_lf, '\n'); + } else { + _kdl_buf_push_codepoint(&buf_norm_lf, c); + } + } + + if (status != KDL_UTF8_EOF) { + goto dedent_err; + } + + kdl_str norm_lf = (kdl_str){.data = buf_norm_lf.buf, .len = buf_norm_lf.str_len}; + + // What's after the final newline? + char const* final_newline = NULL; + for (char const* p = norm_lf.data + norm_lf.len - 1; p >= norm_lf.data; --p) { + if (*p == '\n') { + final_newline = p; + break; + } + } + + if (final_newline == NULL) { + // no newlines = no change + return _kdl_buf_to_string(&buf_norm_lf); + } + + kdl_str indent + = (kdl_str){.data = final_newline + 1, .len = (norm_lf.data + norm_lf.len) - (final_newline + 1)}; + + // Check that the indentation is all whitespace + kdl_str indent_ = indent; + while (_kdl_pop_codepoint(&indent_, &c) == KDL_UTF8_OK) { + if (!_kdl_is_whitespace(KDL_CHARACTER_SET_V2, c)) { + goto dedent_err; + } + } + + // The first character of the string MUST be a newline if there are any + // newlines. + if (norm_lf.data[0] != '\n') { + goto dedent_err; + } + + // Remove the whitespace from the beginning of all lines + buf_dedented = malloc(norm_lf.len - 1); + char* out = buf_dedented; + char const* in = norm_lf.data; // skip initial LF + char const* end = norm_lf.data + norm_lf.len; + bool at_start = true; + // copy the rest of the string + while (in < end) { + *out = *in; + if (*in == '\n') { + if (in + 1 < end && *(in + 1) == '\n') { + // double newline - ok + } else { + // check indent + if (memcmp(in + 1, indent.data, indent.len) == 0) { + // skip indent + in += indent.len; + } else { + goto dedent_err; + } + } + } + if (!at_start) { + // Skip the initial newline => only advance the output pointer + // if we're somewhere other than the initial newline + ++out; + } + ++in; + at_start = false; + } + + size_t len = out - buf_dedented; + // Strip the final line feed + if (len > 0 && buf_dedented[len - 1] == '\n') --len; + buf_dedented = realloc(buf_dedented, len); + return (kdl_owned_string){.data = buf_dedented, .len = len}; + +dedent_err: + _kdl_free_write_buffer(&buf_norm_lf); + if (buf_dedented != NULL) free(buf_dedented); + result = (kdl_owned_string){NULL, 0}; + return result; +} diff --git a/src/str.h b/src/str.h index a3a3f62..b3e19fd 100644 --- a/src/str.h +++ b/src/str.h @@ -22,4 +22,6 @@ bool _kdl_buf_push_codepoint(_kdl_write_buffer* buf, uint32_t c); kdl_owned_string _kdl_buf_to_string(_kdl_write_buffer* buf); void _kdl_free_write_buffer(_kdl_write_buffer* buf); +kdl_owned_string _kdl_dedent_multiline_string(kdl_str const* s); + #endif // KDL_INTERNAL_STR_H_ diff --git a/tests/kdlv2_test.c b/tests/kdlv2_test.c index 21089c9..693d3b8 100644 --- a/tests/kdlv2_test.c +++ b/tests/kdlv2_test.c @@ -169,7 +169,7 @@ static void test_tokenizer_equals(void) static void test_string_escapes(void) { - kdl_str s = kdl_str_from_cstr("\\s\\ \n\n\t \\u{1b}"); + kdl_str s = kdl_str_from_cstr("\\s\\ \t \\u{1b}\\\x0b "); kdl_owned_string unesc = kdl_unescape_v2(&s); ASSERT(unesc.len == 2); @@ -185,6 +185,54 @@ static void test_string_escapes(void) kdl_free_string(&reesc); } +static void test_multiline_strings(void) +{ + kdl_str expected = kdl_str_from_cstr("test\n\nstring"); + kdl_str escaped_variants[] = { + kdl_str_from_cstr("test\\n\\nstring"), + kdl_str_from_cstr("\ntest\\n\\nstring\n"), + kdl_str_from_cstr("\r\ntest\r\rstring\n"), + kdl_str_from_cstr("\n \t test\f \t \f \t string\n \t "), + kdl_str_from_cstr("\n te\\\n\n st\n\n string\n "), + }; + int n_escaped_variants = sizeof(escaped_variants) / sizeof(escaped_variants[0]); + + for (int i = 0; i < n_escaped_variants; ++i) { + kdl_owned_string result = kdl_unescape_v2(&escaped_variants[i]); + ASSERT(result.len == expected.len); + ASSERT(memcmp(result.data, expected.data, expected.len) == 0); + kdl_free_string(&result); + } + + kdl_str invalid_strings[] = { + kdl_str_from_cstr("\na\n "), // indent missing at start + kdl_str_from_cstr("\n \r\t\ta\n "), // indent wrong in middle + }; + int n_invalid_strings = sizeof(invalid_strings) / sizeof(invalid_strings[0]); + + for (int i = 0; i < n_invalid_strings; ++i) { + kdl_owned_string result = kdl_unescape_v2(&invalid_strings[i]); + ASSERT(result.data == NULL); + } + + kdl_str edge_cases[][2] = { + {kdl_str_from_cstr("\n\t"), kdl_str_from_cstr("") }, // empty + {kdl_str_from_cstr("\n\n hello\n "), kdl_str_from_cstr("\nhello")}, // double newline at start + {kdl_str_from_cstr("\n \\\n \n "), kdl_str_from_cstr("") }, // escaped newline within + {kdl_str_from_cstr("\n \n \n "), kdl_str_from_cstr("\n ") }, // whitespace only + }; + int n_edge_cases = sizeof(edge_cases) / sizeof(edge_cases[0]); + + for (int i = 0; i < n_edge_cases; ++i) { + kdl_str const* input = &edge_cases[i][0]; + kdl_str const* output = &edge_cases[i][1]; + kdl_owned_string result = kdl_unescape_v2(input); + ASSERT(result.len == output->len); + ASSERT(memcmp(result.data, output->data, output->len) == 0); + kdl_free_string(&result); + } +} + static void test_parser_v1_raw_string(void) { kdl_str doc = kdl_str_from_cstr("r#\"a\"# "); @@ -254,6 +302,7 @@ void TEST_MAIN(void) run_test("Tokenizer: illegal codepoints", &test_tokenizer_illegal_codepoints); run_test("Tokenizer: KDLv2 equals sign", &test_tokenizer_equals); run_test("Strings: KDLv2 escapes", &test_string_escapes); + run_test("Strings: KDLv2 multi-line strings", &test_multiline_strings); run_test("Parser: KDLv1 raw string", &test_parser_v1_raw_string); run_test("Parser: KDLv2 raw string", &test_parser_v2_raw_string); } From 2a684934e174eff7e44949dfe09067affeb7a2f7 Mon Sep 17 00:00:00 2001 From: Thomas Jollans Date: Sat, 25 May 2024 20:52:37 +0200 Subject: [PATCH 13/45] use v2 string format in parser --- src/parser.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/parser.c b/src/parser.c index 0091243..d9da335 100644 --- a/src/parser.c +++ b/src/parser.c @@ -5,6 +5,7 @@ #include "bigint.h" #include "compat.h" #include "grammar.h" +#include "str.h" #include "utf8.h" #include @@ -113,7 +114,8 @@ void kdl_destroy_parser(kdl_parser* self) free(self); } -static void _set_version(kdl_parser *self, kdl_parse_option version) { +static void _set_version(kdl_parser* self, kdl_parse_option version) +{ self->opt = (self->opt & ~KDL_PARSE_OPT_VERSION_BITS) | version; kdl_tokenizer_set_character_set(self->tokenizer, _default_character_set(self->opt)); } @@ -142,7 +144,7 @@ static void _set_comment_event(kdl_parser* self, kdl_token const* token) static kdl_event_data* _next_node(kdl_parser* self, kdl_token* token); static kdl_event_data* _next_event_in_node(kdl_parser* self, kdl_token* token); static kdl_event_data* _apply_slashdash(kdl_parser* self); -static bool _parse_value(kdl_parser * self, kdl_token const* token, kdl_value* val, kdl_owned_string* s); +static bool _parse_value(kdl_parser* self, kdl_token const* token, kdl_value* val, kdl_owned_string* s); static bool _parse_number(kdl_str number, kdl_value* val, kdl_owned_string* s); static bool _parse_decimal_number(kdl_str number, kdl_value* val, kdl_owned_string* s); static bool _parse_decimal_integer(kdl_str number, kdl_value* val, kdl_owned_string* s); @@ -547,7 +549,7 @@ static kdl_event_data* _next_event_in_node(kdl_parser* self, kdl_token* token) } } -static bool _parse_value(kdl_parser * self, kdl_token const* token, kdl_value* val, kdl_owned_string* s) +static bool _parse_value(kdl_parser* self, kdl_token const* token, kdl_value* val, kdl_owned_string* s) { kdl_free_string(s); @@ -566,8 +568,11 @@ static bool _parse_value(kdl_parser * self, kdl_token const* token, kdl_value* v case KDL_TOKEN_RAW_STRING_V2: if (_v2_allowed(self)) { _set_version(self, KDL_VERSION_2); - // no parsing necessary - *s = kdl_clone_str(&token->value); + // dedent multi-line string + *s = _kdl_dedent_multiline_string(&token->value); + if (s->data == NULL) { + return false; + } val->type = KDL_TYPE_STRING; val->string = kdl_borrow_str(s); return true; @@ -576,7 +581,11 @@ static bool _parse_value(kdl_parser * self, kdl_token const* token, kdl_value* v } case KDL_TOKEN_STRING: // parse escapes - *s = kdl_unescape(&token->value); + if (_v2_allowed(self)) { + *s = kdl_unescape_v2(&token->value); + } else { + *s = kdl_unescape_v1(&token->value); + } if (s->data == NULL) { return false; } else { From 03085142d12a4bf08807352264151b946bedb738 Mon Sep 17 00:00:00 2001 From: Thomas Jollans Date: Sat, 25 May 2024 21:28:19 +0200 Subject: [PATCH 14/45] v2 identifier rules, #null, #inf, etc --- src/parser.c | 111 ++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 101 insertions(+), 10 deletions(-) diff --git a/src/parser.c b/src/parser.c index d9da335..34cc40a 100644 --- a/src/parser.c +++ b/src/parser.c @@ -152,7 +152,8 @@ static bool _parse_decimal_float(kdl_str number, kdl_value* val, kdl_owned_strin static bool _parse_hex_number(kdl_str number, kdl_value* val, kdl_owned_string* s); static bool _parse_octal_number(kdl_str number, kdl_value* val, kdl_owned_string* s); static bool _parse_binary_number(kdl_str number, kdl_value* val, kdl_owned_string* s); -static bool _identifier_is_valid(kdl_str value); +static bool _identifier_is_valid_v1(kdl_str value); +static bool _identifier_is_valid_v2(kdl_str value); kdl_event_data* kdl_parser_next_event(kdl_parser* self) { @@ -593,38 +594,103 @@ static bool _parse_value(kdl_parser* self, kdl_token const* token, kdl_value* va val->string = kdl_borrow_str(s); return true; } - case KDL_TOKEN_WORD: + case KDL_TOKEN_WORD: { if (_str_equals_literal(token->value, "null")) { + if (_v1_allowed(self)) { + _set_version(self, KDL_VERSION_1); + val->type = KDL_TYPE_NULL; + return true; + } else { + return false; + } + } else if (_str_equals_literal(token->value, "true")) { + if (_v1_allowed(self)) { + _set_version(self, KDL_VERSION_1); + val->type = KDL_TYPE_BOOLEAN; + val->boolean = true; + return true; + } else { + return false; + } + } else if (_str_equals_literal(token->value, "false")) { + if (_v1_allowed(self)) { + _set_version(self, KDL_VERSION_1); + val->type = KDL_TYPE_BOOLEAN; + val->boolean = false; + return true; + } else { + return false; + } + } else if (_v2_allowed(self) && _str_equals_literal(token->value, "#null")) { + _set_version(self, KDL_VERSION_2); val->type = KDL_TYPE_NULL; return true; - } else if (_str_equals_literal(token->value, "true")) { + } else if (_v2_allowed(self) && _str_equals_literal(token->value, "#true")) { + _set_version(self, KDL_VERSION_2); val->type = KDL_TYPE_BOOLEAN; val->boolean = true; return true; - } else if (_str_equals_literal(token->value, "false")) { + } else if (_v2_allowed(self) && _str_equals_literal(token->value, "#false")) { + _set_version(self, KDL_VERSION_2); val->type = KDL_TYPE_BOOLEAN; val->boolean = false; return true; + } else if (_v2_allowed(self) && _str_equals_literal(token->value, "#inf")) { + _set_version(self, KDL_VERSION_2); + val->type = KDL_TYPE_NUMBER; + val->number.type = KDL_NUMBER_TYPE_FLOATING_POINT; + val->number.floating_point = INFINITY; + return true; + } else if (_v2_allowed(self) && _str_equals_literal(token->value, "#-inf")) { + _set_version(self, KDL_VERSION_2); + val->type = KDL_TYPE_NUMBER; + val->number.type = KDL_NUMBER_TYPE_FLOATING_POINT; + val->number.floating_point = -INFINITY; + return true; + } else if (_v2_allowed(self) && _str_equals_literal(token->value, "#nan")) { + _set_version(self, KDL_VERSION_2); + val->type = KDL_TYPE_NUMBER; + val->number.type = KDL_NUMBER_TYPE_FLOATING_POINT; + val->number.floating_point = NAN; + return true; } // either a number or an identifier if (token->value.len >= 1) { char first_char = token->value.data[0]; + int offset = 0; // skip sign if present - if ((first_char == '+' || first_char == '-') && token->value.len >= 2) + if ((first_char == '+' || first_char == '-') && token->value.len >= 2) { first_char = token->value.data[1]; + offset = 1; + } if (first_char >= '0' && first_char <= '9') { // first character after sign is a digit, this value should be interpreted as a number return _parse_number(token->value, val, s); + } else if (_v2_only(self) && first_char == '.' && token->value.len - offset >= 2) { + // check for v2 rule of banned "almost numbers" + char second_char = token->value.data[offset + 1]; + if (second_char >= '0' && second_char <= '9') { + return false; + } } } - // this is a regular identifier - if (_identifier_is_valid(token->value)) { + // this is a regular identifier (or a syntax error) + bool is_v1_identifier = _v1_allowed(self) && _identifier_is_valid_v1(token->value); + bool is_v2_identifier = _v2_allowed(self) && _identifier_is_valid_v2(token->value); + bool is_identifier = is_v1_identifier || is_v2_identifier; + if (is_v1_identifier && !is_v2_identifier) { + _set_version(self, KDL_VERSION_1); + } else if (is_v2_identifier && !is_v1_identifier) { + _set_version(self, KDL_VERSION_2); + } + if (is_identifier) { *s = kdl_clone_str(&token->value); val->type = KDL_TYPE_STRING; val->string = kdl_borrow_str(s); return true; } _fallthrough_; + } default: return false; } @@ -1027,10 +1093,8 @@ static bool _parse_binary_number(kdl_str number, kdl_value* val, kdl_owned_strin return false; } -static bool _identifier_is_valid(kdl_str value) +static bool _identifier_is_valid_v1(kdl_str value) { - // Check that this is a valid KDLv1 identifier! The tokenizer accepts KDLv2 - // identifiers, but the parser doesn't yet uint32_t c = 0; if (_kdl_pop_codepoint(&value, &c) != KDL_UTF8_OK || !_kdl_is_id_start(KDL_CHARACTER_SET_V1, c)) { return false; @@ -1048,3 +1112,30 @@ static bool _identifier_is_valid(kdl_str value) } } } + +static bool _identifier_is_valid_v2(kdl_str value) +{ + if (_str_equals_literal(value, "inf") || _str_equals_literal(value, "-inf") + || _str_equals_literal(value, "nan") || _str_equals_literal(value, "null") + || _str_equals_literal(value, "true") || _str_equals_literal(value, "false")) { + return false; + } + + uint32_t c = 0; + if (_kdl_pop_codepoint(&value, &c) != KDL_UTF8_OK || !_kdl_is_id_start(KDL_CHARACTER_SET_V2, c) + || c == '#') { + return false; + } + + while (true) { + switch (_kdl_pop_codepoint(&value, &c)) { + case KDL_UTF8_OK: + if (!_kdl_is_id(KDL_CHARACTER_SET_V2, c) || c == '#') return false; + break; + case KDL_UTF8_EOF: + return true; + default: + return false; + } + } +} From 93d3302748d6ce548504027e5b8a987b89930b83 Mon Sep 17 00:00:00 2001 From: Thomas Jollans Date: Sat, 25 May 2024 21:34:09 +0200 Subject: [PATCH 15/45] test for #null behaviour --- tests/kdlv2_test.c | 82 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/tests/kdlv2_test.c b/tests/kdlv2_test.c index 693d3b8..5b4b371 100644 --- a/tests/kdlv2_test.c +++ b/tests/kdlv2_test.c @@ -293,6 +293,85 @@ static void test_parser_v2_raw_string(void) kdl_destroy_parser(parser); } +static void test_parser_hashtag_null(void) +{ + kdl_str doc = kdl_str_from_cstr("a #null #true #false"); + kdl_event_data* ev; + + kdl_parser* parser = kdl_create_string_parser(doc, KDL_VERSION_2); + + ev = kdl_parser_next_event(parser); + ASSERT(ev->event == KDL_EVENT_START_NODE); + + ev = kdl_parser_next_event(parser); + ASSERT(ev->event == KDL_EVENT_ARGUMENT); + ASSERT(ev->value.type == KDL_TYPE_NULL); + + ev = kdl_parser_next_event(parser); + ASSERT(ev->event == KDL_EVENT_ARGUMENT); + ASSERT(ev->value.type == KDL_TYPE_BOOLEAN); + ASSERT(ev->value.boolean == true); + + ev = kdl_parser_next_event(parser); + ASSERT(ev->event == KDL_EVENT_ARGUMENT); + ASSERT(ev->value.type == KDL_TYPE_BOOLEAN); + ASSERT(ev->value.boolean == false); + + kdl_destroy_parser(parser); +} + +static void test_parser_hashless_syntax_error(void) +{ + kdl_str doc = kdl_str_from_cstr("a null"); + kdl_event_data* ev; + + kdl_parser* parser = kdl_create_string_parser(doc, KDL_VERSION_2); + + ev = kdl_parser_next_event(parser); + ASSERT(ev->event == KDL_EVENT_START_NODE); + + ev = kdl_parser_next_event(parser); + ASSERT(ev->event == KDL_EVENT_PARSE_ERROR); + + kdl_destroy_parser(parser); +} + +static void test_parser_hashtag_null_is_v2(void) +{ + kdl_event_data* ev; + kdl_str doc = kdl_str_from_cstr("a #null true"); + + kdl_parser* parser = kdl_create_string_parser(doc, KDL_DETECT_VERSION); + + ev = kdl_parser_next_event(parser); + ASSERT(ev->event == KDL_EVENT_START_NODE); + + ev = kdl_parser_next_event(parser); + ASSERT(ev->event == KDL_EVENT_ARGUMENT); + ASSERT(ev->value.type == KDL_TYPE_NULL); + + ev = kdl_parser_next_event(parser); + ASSERT(ev->event == KDL_EVENT_PARSE_ERROR); + + kdl_destroy_parser(parser); + + doc = kdl_str_from_cstr("a null #true"); + + parser = kdl_create_string_parser(doc, KDL_DETECT_VERSION); + + ev = kdl_parser_next_event(parser); + ASSERT(ev->event == KDL_EVENT_START_NODE); + + ev = kdl_parser_next_event(parser); + ASSERT(ev->event == KDL_EVENT_ARGUMENT); + ASSERT(ev->value.type == KDL_TYPE_NULL); + + ev = kdl_parser_next_event(parser); + ASSERT(ev->event == KDL_EVENT_PARSE_ERROR); + + kdl_destroy_parser(parser); +} + void TEST_MAIN(void) { run_test("Tokenizer: KDLv2 strings", &test_tokenizer_strings); @@ -305,4 +384,7 @@ void TEST_MAIN(void) run_test("Strings: KDLv2 multi-line strings", &test_multiline_strings); run_test("Parser: KDLv1 raw string", &test_parser_v1_raw_string); run_test("Parser: KDLv2 raw string", &test_parser_v2_raw_string); + run_test("Parser: KDLv2 #null", &test_parser_hashtag_null); + run_test("Parser: null is a syntax error in KDLv2", &test_parser_hashless_syntax_error); + run_test("Parser: #null means we're in v2, etc.", &test_parser_hashtag_null_is_v2); } From 3b08d2071331798eaa847615794e85617eb41346 Mon Sep 17 00:00:00 2001 From: Thomas Jollans Date: Sat, 25 May 2024 22:00:27 +0200 Subject: [PATCH 16/45] KDLv2 allows whitespace in annotations --- src/parser.c | 34 ++++++++++++++++++++++------------ tests/kdlv2_test.c | 24 ++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 12 deletions(-) diff --git a/src/parser.c b/src/parser.c index 34cc40a..76947e4 100644 --- a/src/parser.c +++ b/src/parser.c @@ -35,11 +35,12 @@ enum _kdl_parser_state { PARSER_FLAG_TYPE_ANNOTATION_ENDED = 0x800, PARSER_FLAG_IN_PROPERTY = 0x1000, // Bitmask for testing the state - PARSER_MASK_WHITESPACE_BANNED = // + PARSER_MASK_NODE_CANNOT_END_HERE = // PARSER_FLAG_TYPE_ANNOTATION_START // | PARSER_FLAG_TYPE_ANNOTATION_END // | PARSER_FLAG_TYPE_ANNOTATION_ENDED // - | PARSER_FLAG_IN_PROPERTY + | PARSER_FLAG_IN_PROPERTY, + PARSER_MASK_WHITESPACE_BANNED_V1 = PARSER_MASK_NODE_CANNOT_END_HERE, }; struct _kdl_parser { @@ -207,17 +208,26 @@ kdl_event_data* kdl_parser_next_event(kdl_parser* self) switch (token.type) { case KDL_TOKEN_WHITESPACE: - if (self->state & PARSER_MASK_WHITESPACE_BANNED) { - _set_parse_error(self, "Whitespace not allowed here"); - return &self->event; - } else { - break; // ignore whitespace + if (self->state & PARSER_MASK_WHITESPACE_BANNED_V1) { + if (_v1_only(self)) { + _set_parse_error(self, "Whitespace not allowed here"); + return &self->event; + } else { + _set_version(self, KDL_VERSION_2); + } } + break; // ignore whitespace + case KDL_TOKEN_MULTI_LINE_COMMENT: case KDL_TOKEN_SINGLE_LINE_COMMENT: - if (self->state & PARSER_MASK_WHITESPACE_BANNED) { - _set_parse_error(self, "Comment not allowed here"); - return &self->event; + if (self->state & PARSER_MASK_WHITESPACE_BANNED_V1) { + if (_v1_only(self)) { + + _set_parse_error(self, "Comment not allowed here"); + return &self->event; + } else { + _set_version(self, KDL_VERSION_2); + } } // Comments may or may not be emitted if (self->opt & KDL_EMIT_COMMENTS) { @@ -313,7 +323,7 @@ static kdl_event_data* _next_node(kdl_parser* self, kdl_token* token) switch (token->type) { case KDL_TOKEN_NEWLINE: case KDL_TOKEN_SEMICOLON: - if (self->state & PARSER_MASK_WHITESPACE_BANNED) { + if (self->state & PARSER_MASK_NODE_CANNOT_END_HERE) { _set_parse_error(self, "Unexpected end of node (incomplete node name?)"); return &self->event; } else { @@ -435,7 +445,7 @@ static kdl_event_data* _next_event_in_node(kdl_parser* self, kdl_token* token) _fallthrough_; case KDL_TOKEN_NEWLINE: case KDL_TOKEN_SEMICOLON: - if (self->state & PARSER_MASK_WHITESPACE_BANNED) { + if (self->state & PARSER_MASK_NODE_CANNOT_END_HERE) { _set_parse_error(self, "Unexpected end of node (incomplete argument or property?)"); return &self->event; } else { diff --git a/tests/kdlv2_test.c b/tests/kdlv2_test.c index 5b4b371..49c41e4 100644 --- a/tests/kdlv2_test.c +++ b/tests/kdlv2_test.c @@ -372,6 +372,29 @@ static void test_parser_hashtag_null_is_v2(void) kdl_destroy_parser(parser); } +static void test_parser_kdlv2_whitespace(void) +{ + kdl_event_data* ev; + kdl_str doc = kdl_str_from_cstr("( a ) n p=1"); + + kdl_parser* parser = kdl_create_string_parser(doc, KDL_DETECT_VERSION); + + ev = kdl_parser_next_event(parser); + ASSERT(ev->event == KDL_EVENT_START_NODE); + ASSERT(ev->name.len == 1); + ASSERT(ev->name.data[0] == 'n'); + ASSERT(ev->value.type_annotation.len == 1); + ASSERT(ev->value.type_annotation.data[0] == 'a'); + + ev = kdl_parser_next_event(parser); + ASSERT(ev->event == KDL_EVENT_PROPERTY); + ASSERT(ev->name.len == 1); + ASSERT(ev->name.data[0] == 'p'); + ASSERT(ev->value.type == KDL_TYPE_NUMBER); + + kdl_destroy_parser(parser); +} + void TEST_MAIN(void) { run_test("Tokenizer: KDLv2 strings", &test_tokenizer_strings); @@ -387,4 +410,5 @@ void TEST_MAIN(void) run_test("Parser: KDLv2 #null", &test_parser_hashtag_null); run_test("Parser: null is a syntax error in KDLv2", &test_parser_hashless_syntax_error); run_test("Parser: #null means we're in v2, etc.", &test_parser_hashtag_null_is_v2); + run_test("Parser: whitespace in new place", &test_parser_kdlv2_whitespace); } From 54fb190015357df64c628955b2a446de3aa14707 Mon Sep 17 00:00:00 2001 From: Thomas Jollans Date: Sun, 26 May 2024 09:18:21 +0200 Subject: [PATCH 17/45] allow spaces around property = in v2 (and only in v2) --- src/parser.c | 202 +++++++++++++++++++++++++-------------------- tests/kdlv2_test.c | 2 +- 2 files changed, 115 insertions(+), 89 deletions(-) diff --git a/src/parser.c b/src/parser.c index 76947e4..3dea657 100644 --- a/src/parser.c +++ b/src/parser.c @@ -34,13 +34,20 @@ enum _kdl_parser_state { PARSER_FLAG_TYPE_ANNOTATION_END = 0x400, PARSER_FLAG_TYPE_ANNOTATION_ENDED = 0x800, PARSER_FLAG_IN_PROPERTY = 0x1000, + PARSER_FLAG_MAYBE_IN_PROPERTY = 0x2000, + PARSER_FLAG_BARE_PROPERTY_NAME = 0x4000, + PARSER_FLAG_CONTEXTUALLY_ILLEGAL_WHITESPACE = 0x100000, // Bitmask for testing the state - PARSER_MASK_NODE_CANNOT_END_HERE = // - PARSER_FLAG_TYPE_ANNOTATION_START // - | PARSER_FLAG_TYPE_ANNOTATION_END // - | PARSER_FLAG_TYPE_ANNOTATION_ENDED // - | PARSER_FLAG_IN_PROPERTY, - PARSER_MASK_WHITESPACE_BANNED_V1 = PARSER_MASK_NODE_CANNOT_END_HERE, + PARSER_MASK_WHITESPACE_CONTEXTUALLY_BANNED = // + PARSER_FLAG_MAYBE_IN_PROPERTY, + PARSER_MASK_WHITESPACE_BANNED_V1 = // + PARSER_FLAG_TYPE_ANNOTATION_START // + | PARSER_FLAG_TYPE_ANNOTATION_END // + | PARSER_FLAG_TYPE_ANNOTATION_ENDED // + | PARSER_FLAG_IN_PROPERTY, // + PARSER_MASK_NODE_CANNOT_END_HERE = // + PARSER_MASK_WHITESPACE_BANNED_V1 // + | PARSER_MASK_WHITESPACE_CONTEXTUALLY_BANNED, // }; struct _kdl_parser { @@ -172,15 +179,11 @@ kdl_event_data* kdl_parser_next_event(kdl_parser* self) } else { switch (kdl_pop_token(self->tokenizer, &token)) { case KDL_TOKENIZER_EOF: - if (self->state == PARSER_IN_NODE) { + if ((self->state & 0xff) == PARSER_IN_NODE) { // EOF may be ok, but we have to close the node first - --self->depth; - self->state = PARSER_OUTSIDE_NODE; - _reset_event(self); - self->event.event = KDL_EVENT_END_NODE; - ev = _apply_slashdash(self); - if (ev) return ev; - else continue; + token.type = KDL_TOKEN_NEWLINE; + token.value = (kdl_str){NULL, 0}; + break; } else if (self->depth > 0) { _set_parse_error(self, "Unexpected end of data (unclosed lists of children)"); return &self->event; @@ -215,6 +218,8 @@ kdl_event_data* kdl_parser_next_event(kdl_parser* self) } else { _set_version(self, KDL_VERSION_2); } + } else if (self->state & PARSER_MASK_WHITESPACE_CONTEXTUALLY_BANNED) { + self->state |= PARSER_FLAG_CONTEXTUALLY_ILLEGAL_WHITESPACE; } break; // ignore whitespace @@ -222,12 +227,13 @@ kdl_event_data* kdl_parser_next_event(kdl_parser* self) case KDL_TOKEN_SINGLE_LINE_COMMENT: if (self->state & PARSER_MASK_WHITESPACE_BANNED_V1) { if (_v1_only(self)) { - _set_parse_error(self, "Comment not allowed here"); return &self->event; } else { _set_version(self, KDL_VERSION_2); } + } else if (self->state & PARSER_MASK_WHITESPACE_CONTEXTUALLY_BANNED) { + self->state |= PARSER_FLAG_CONTEXTUALLY_ILLEGAL_WHITESPACE; } // Comments may or may not be emitted if (self->opt & KDL_EMIT_COMMENTS) { @@ -237,10 +243,19 @@ kdl_event_data* kdl_parser_next_event(kdl_parser* self) break; case KDL_TOKEN_SLASHDASH: // slashdash comments out the next node or argument or property - if (self->slashdash_depth < 0) { - self->slashdash_depth = self->depth + 1; + if (self->state & PARSER_MASK_WHITESPACE_CONTEXTUALLY_BANNED) { + // fall through to _next_event_in_node() - this event should be + // bubbled back up + } else if (self->state & PARSER_MASK_NODE_CANNOT_END_HERE) { + _set_parse_error(self, "/- not allowed here"); + return &self->event; + } else { + if (self->slashdash_depth < 0) { + self->slashdash_depth = self->depth + 1; + } + break; } - break; + _fallthrough_; default: switch (self->state & 0xff) { case PARSER_OUTSIDE_NODE: @@ -354,8 +369,7 @@ static kdl_event_data* _next_node(kdl_parser* self, kdl_token* token) self->event.name = tmp_val.string; ++self->depth; ev = _apply_slashdash(self); - if (ev) return ev; - else return NULL; + return ev; } else { _set_parse_error(self, "Expected identifier or string"); return &self->event; @@ -370,8 +384,7 @@ static kdl_event_data* _next_node(kdl_parser* self, kdl_token* token) _reset_event(self); self->event.event = KDL_EVENT_END_NODE; ev = _apply_slashdash(self); - if (ev) return ev; - else return NULL; + return ev; } default: _set_parse_error(self, "Unexpected token, expected node"); @@ -383,7 +396,6 @@ static kdl_event_data* _next_node(kdl_parser* self, kdl_token* token) static kdl_event_data* _next_event_in_node(kdl_parser* self, kdl_token* token) { kdl_event_data* ev; - bool is_property = false; if (self->state & PARSER_FLAG_LINE_CONT) { switch (token->type) { @@ -398,7 +410,47 @@ static kdl_event_data* _next_event_in_node(kdl_parser* self, kdl_token* token) } } - if (self->state & PARSER_FLAG_TYPE_ANNOTATION_START) { + if (self->state & PARSER_FLAG_MAYBE_IN_PROPERTY) { + if (token->type == KDL_TOKEN_EQUALS) { + // Property value comes next + self->state = (self->state & ~PARSER_FLAG_MAYBE_IN_PROPERTY) | PARSER_FLAG_IN_PROPERTY; + + // Whitespace before the equals sign? + if (self->state & PARSER_FLAG_CONTEXTUALLY_ILLEGAL_WHITESPACE) { + self->state &= ~PARSER_FLAG_CONTEXTUALLY_ILLEGAL_WHITESPACE; + if (_v1_only(self)) { + _set_parse_error(self, "Whitespace not allowed before = sign"); + return &self->event; + } else { + _set_version(self, KDL_VERSION_2); + } + } + + return NULL; + } else { + // We'll need that token again + self->next_token = *token; + self->have_next_token = true; + + // Not in property; emit as argument (if legal) + if (self->state & PARSER_FLAG_BARE_PROPERTY_NAME) { + if (_v1_only(self)) { + _set_parse_error(self, "Bare identifier not allowed here"); + return &self->event; + } else { + _set_version(self, KDL_VERSION_2); + } + } + + self->event.event = KDL_EVENT_ARGUMENT; + self->event.value.type = KDL_TYPE_STRING; + self->event.value.string = self->event.name; + self->event.name = (kdl_str){.data = NULL, .len = 0}; + ev = _apply_slashdash(self); + self->state = PARSER_IN_NODE; + return ev; + } + } else if (self->state & PARSER_FLAG_TYPE_ANNOTATION_START) { kdl_value tmp_val; switch (token->type) { case KDL_TOKEN_WORD: @@ -455,83 +507,57 @@ static kdl_event_data* _next_event_in_node(kdl_parser* self, kdl_token* token) _reset_event(self); self->event.event = KDL_EVENT_END_NODE; ev = _apply_slashdash(self); - if (ev) return ev; - else return NULL; + return ev; } case KDL_TOKEN_WORD: case KDL_TOKEN_STRING: case KDL_TOKEN_RAW_STRING_V1: case KDL_TOKEN_RAW_STRING_V2: { - kdl_owned_string tmp_str = {NULL, 0}; - // either a property key, or a property value, or an argument - if (self->event.name.data == NULL && self->event.value.type_annotation.data == NULL) { - // the call to kdl_pop_token will invalidate the old token's value - clone it - tmp_str = kdl_clone_str(&token->value); - token->value = kdl_borrow_str(&tmp_str); - // property key only possible if we don't already have one, and if we don't - // yet have a type annotation (values are annotated, keys are not) - // -> Check the next token - switch (kdl_pop_token(self->tokenizer, &self->next_token)) { - case KDL_TOKENIZER_EOF: - break; // all good - case KDL_TOKENIZER_OK: - if (self->next_token.type == KDL_TOKEN_EQUALS) is_property = true; - else - // process this token next time - self->have_next_token = true; - break; - default: - case KDL_TOKENIZER_ERROR: - // parse error - _set_parse_error(self, "Parse error"); - kdl_free_string(&tmp_str); - return &self->event; - } + kdl_owned_string* tmp_str = &self->tmp_string_key; + if (self->state & PARSER_FLAG_IN_PROPERTY) tmp_str = &self->tmp_string_value; + + // Either a property key, or a property value, or an argument. + if (!_parse_value(self, token, &self->event.value, tmp_str)) { + _set_parse_error(self, "Error parsing property or argument"); + return &self->event; } - if (is_property) { - // Parse the property name - self->state |= PARSER_FLAG_IN_PROPERTY; - kdl_value tmp_val; - bool parse_ok = _parse_value(self, token, &tmp_val, &self->tmp_string_key); - kdl_free_string(&tmp_str); - if (!parse_ok) { - _set_parse_error(self, "Error parsing property key"); - return &self->event; - } - if (tmp_val.type == KDL_TYPE_STRING) { - // all good - self->event.name = tmp_val.string; - return NULL; - } else { - _set_parse_error(self, "Property keys must be strings or identifiers"); - return &self->event; - } - } else { - // Parse the argument - bool parse_ok = _parse_value(self, token, &self->event.value, &self->tmp_string_value); - kdl_free_string(&tmp_str); - if (!parse_ok) { - _set_parse_error(self, "Error parsing argument"); - return &self->event; + // Can this be a property key? + if (self->event.value.type_annotation.data == NULL && (self->state & PARSER_FLAG_IN_PROPERTY) == 0 + && self->event.value.type == KDL_TYPE_STRING) { + self->event.name = self->event.value.string; + self->event.value.type = KDL_TYPE_NULL; + self->state |= PARSER_FLAG_MAYBE_IN_PROPERTY; + + if (token->type == KDL_TOKEN_WORD) { + // bare identifiers can't be arguments in KDLv1 + self->state |= PARSER_FLAG_BARE_PROPERTY_NAME; } - // check that it's not a bare identifier - if (token->type == KDL_TOKEN_WORD && self->event.value.type == KDL_TYPE_STRING) { + + return NULL; + } + + // This is an argument or a property value. + // KDLv1 bans bare identifiers in this position + if (token->type == KDL_TOKEN_WORD && self->event.value.type == KDL_TYPE_STRING) { + if (_v1_only(self)) { _set_parse_error(self, "Bare identifier not allowed here"); return &self->event; - } - // return it - if (self->event.name.data != NULL) { - self->event.event = KDL_EVENT_PROPERTY; } else { - self->event.event = KDL_EVENT_ARGUMENT; + _set_version(self, KDL_VERSION_2); } - ev = _apply_slashdash(self); - // be sure to reset the parser state - self->state = PARSER_IN_NODE; - if (ev) return ev; - else return NULL; } + + // We can return the event + if (self->state & PARSER_FLAG_IN_PROPERTY) { + self->event.event = KDL_EVENT_PROPERTY; + } else { + self->event.event = KDL_EVENT_ARGUMENT; + } + ev = _apply_slashdash(self); + // be sure to reset the parser state + self->state = PARSER_IN_NODE; + return ev; } case KDL_TOKEN_START_TYPE: // only one type allowed! diff --git a/tests/kdlv2_test.c b/tests/kdlv2_test.c index 49c41e4..d8ece8d 100644 --- a/tests/kdlv2_test.c +++ b/tests/kdlv2_test.c @@ -375,7 +375,7 @@ static void test_parser_hashtag_null_is_v2(void) static void test_parser_kdlv2_whitespace(void) { kdl_event_data* ev; - kdl_str doc = kdl_str_from_cstr("( a ) n p=1"); + kdl_str doc = kdl_str_from_cstr("( a ) n p = 1"); kdl_parser* parser = kdl_create_string_parser(doc, KDL_DETECT_VERSION); From fbde11c2a0e52400865a016c5d77408d22ca9ea0 Mon Sep 17 00:00:00 2001 From: Thomas Jollans Date: Sun, 26 May 2024 09:29:54 +0200 Subject: [PATCH 18/45] line continuations near equals sign --- src/parser.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/parser.c b/src/parser.c index 3dea657..43061c2 100644 --- a/src/parser.c +++ b/src/parser.c @@ -410,7 +410,20 @@ static kdl_event_data* _next_event_in_node(kdl_parser* self, kdl_token* token) } } - if (self->state & PARSER_FLAG_MAYBE_IN_PROPERTY) { + if (token->type == KDL_TOKEN_LINE_CONTINUATION) { + if (self->state & PARSER_MASK_WHITESPACE_BANNED_V1) { + if (_v1_only(self)) { + _set_parse_error(self, "Line continuation not allowed here"); + return &self->event; + } else { + _set_version(self, KDL_VERSION_2); + } + } else if (self->state & PARSER_MASK_WHITESPACE_CONTEXTUALLY_BANNED) { + self->state |= PARSER_FLAG_CONTEXTUALLY_ILLEGAL_WHITESPACE; + } + self->state |= PARSER_FLAG_LINE_CONT; + return NULL; + } else if (self->state & PARSER_FLAG_MAYBE_IN_PROPERTY) { if (token->type == KDL_TOKEN_EQUALS) { // Property value comes next self->state = (self->state & ~PARSER_FLAG_MAYBE_IN_PROPERTY) | PARSER_FLAG_IN_PROPERTY; @@ -487,9 +500,6 @@ static kdl_event_data* _next_event_in_node(kdl_parser* self, kdl_token* token) } } else { switch (token->type) { - case KDL_TOKEN_LINE_CONTINUATION: - self->state |= PARSER_FLAG_LINE_CONT; - return NULL; case KDL_TOKEN_END_CHILDREN: // end this node, and process the token again self->next_token = *token; From 06d9e9c0197ee36452130708f15dca13964e87fc Mon Sep 17 00:00:00 2001 From: Thomas Jollans Date: Sun, 26 May 2024 09:39:34 +0200 Subject: [PATCH 19/45] test comment in property --- src/parser.c | 19 ++++++++++++------- tests/kdlv2_test.c | 25 +++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 7 deletions(-) diff --git a/src/parser.c b/src/parser.c index 43061c2..4d26705 100644 --- a/src/parser.c +++ b/src/parser.c @@ -60,6 +60,7 @@ struct _kdl_parser { kdl_owned_string tmp_string_type; kdl_owned_string tmp_string_key; kdl_owned_string tmp_string_value; + kdl_owned_string waiting_string; kdl_token next_token; bool have_next_token; }; @@ -72,6 +73,7 @@ static void _init_kdl_parser(kdl_parser* self, kdl_parse_option opt) self->tmp_string_type = (kdl_owned_string){NULL, 0}; self->tmp_string_key = (kdl_owned_string){NULL, 0}; self->tmp_string_value = (kdl_owned_string){NULL, 0}; + self->waiting_string = (kdl_owned_string){NULL, 0}; self->have_next_token = false; // Fallback: use KDLv1 only @@ -457,8 +459,9 @@ static kdl_event_data* _next_event_in_node(kdl_parser* self, kdl_token* token) self->event.event = KDL_EVENT_ARGUMENT; self->event.value.type = KDL_TYPE_STRING; - self->event.value.string = self->event.name; - self->event.name = (kdl_str){.data = NULL, .len = 0}; + self->tmp_string_value = self->waiting_string; + self->waiting_string = (kdl_owned_string){NULL, 0}; + self->event.value.string = kdl_borrow_str(&self->tmp_string_value); ev = _apply_slashdash(self); self->state = PARSER_IN_NODE; return ev; @@ -523,11 +526,8 @@ static kdl_event_data* _next_event_in_node(kdl_parser* self, kdl_token* token) case KDL_TOKEN_STRING: case KDL_TOKEN_RAW_STRING_V1: case KDL_TOKEN_RAW_STRING_V2: { - kdl_owned_string* tmp_str = &self->tmp_string_key; - if (self->state & PARSER_FLAG_IN_PROPERTY) tmp_str = &self->tmp_string_value; - // Either a property key, or a property value, or an argument. - if (!_parse_value(self, token, &self->event.value, tmp_str)) { + if (!_parse_value(self, token, &self->event.value, &self->tmp_string_value)) { _set_parse_error(self, "Error parsing property or argument"); return &self->event; } @@ -535,7 +535,9 @@ static kdl_event_data* _next_event_in_node(kdl_parser* self, kdl_token* token) // Can this be a property key? if (self->event.value.type_annotation.data == NULL && (self->state & PARSER_FLAG_IN_PROPERTY) == 0 && self->event.value.type == KDL_TYPE_STRING) { - self->event.name = self->event.value.string; + // carry over the potential name in waiting_string + self->waiting_string = self->tmp_string_value; + self->tmp_string_value = (kdl_owned_string){NULL, 0}; self->event.value.type = KDL_TYPE_NULL; self->state |= PARSER_FLAG_MAYBE_IN_PROPERTY; @@ -560,6 +562,9 @@ static kdl_event_data* _next_event_in_node(kdl_parser* self, kdl_token* token) // We can return the event if (self->state & PARSER_FLAG_IN_PROPERTY) { + self->tmp_string_key = self->waiting_string; + self->waiting_string = (kdl_owned_string){NULL, 0}; + self->event.name = kdl_borrow_str(&self->tmp_string_key); self->event.event = KDL_EVENT_PROPERTY; } else { self->event.event = KDL_EVENT_ARGUMENT; diff --git a/tests/kdlv2_test.c b/tests/kdlv2_test.c index d8ece8d..3a6f2f5 100644 --- a/tests/kdlv2_test.c +++ b/tests/kdlv2_test.c @@ -395,6 +395,30 @@ static void test_parser_kdlv2_whitespace(void) kdl_destroy_parser(parser); } +static void test_parser_comment_in_property(void) +{ + kdl_event_data* ev; + kdl_str doc = kdl_str_from_cstr("node key /* equals sign coming up */ = \\ \n value"); + + kdl_parser* parser = kdl_create_string_parser(doc, KDL_EMIT_COMMENTS | KDL_VERSION_2); + + ev = kdl_parser_next_event(parser); + ASSERT(ev->event == KDL_EVENT_START_NODE); + + ev = kdl_parser_next_event(parser); + ASSERT(ev->event == KDL_EVENT_COMMENT); + + ev = kdl_parser_next_event(parser); + ASSERT(ev->event == KDL_EVENT_PROPERTY); + ASSERT(ev->name.len == 3); + ASSERT(memcmp(ev->name.data, "key", 3) == 0); + ASSERT(ev->value.type == KDL_TYPE_STRING); + ASSERT(ev->value.string.len == 5); + ASSERT(memcmp(ev->value.string.data, "value", 5) == 0); + + kdl_destroy_parser(parser); +} + void TEST_MAIN(void) { run_test("Tokenizer: KDLv2 strings", &test_tokenizer_strings); @@ -411,4 +435,5 @@ void TEST_MAIN(void) run_test("Parser: null is a syntax error in KDLv2", &test_parser_hashless_syntax_error); run_test("Parser: #null means we're in v2, etc.", &test_parser_hashtag_null_is_v2); run_test("Parser: whitespace in new place", &test_parser_kdlv2_whitespace); + run_test("Parser: comment in property definition", &test_parser_comment_in_property); } From 6f584621d2ec714a7a58567aebf7228a45c039c6 Mon Sep 17 00:00:00 2001 From: Thomas Jollans Date: Sun, 26 May 2024 09:55:25 +0200 Subject: [PATCH 20/45] ban surrogates in strings completely --- src/str.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/str.c b/src/str.c index 2194d8c..60ec96e 100644 --- a/src/str.c +++ b/src/str.c @@ -380,7 +380,9 @@ kdl_owned_string kdl_unescape_v2(kdl_str const* s) else goto unesc_error; } if (status != KDL_UTF8_OK) goto unesc_error; - if (!_kdl_buf_push_codepoint(&buf, r)) goto unesc_error; + if ((0xD800 <= r && r <= 0xDFFF) // only Unicode Scalar values are allowed in strings + || !_kdl_buf_push_codepoint(&buf, r)) + goto unesc_error; break; } default: From 05da4060277fa6d5c2d51c334b814d13286aec85 Mon Sep 17 00:00:00 2001 From: Thomas Jollans Date: Sun, 26 May 2024 11:36:10 +0200 Subject: [PATCH 21/45] KDLv2 emitter This change is ABI incompatible because it changes the size of struct kdl_emitter_options --- include/kdl/common.h | 11 ++++++ include/kdl/emitter.h | 1 + include/kdl/parser.h | 4 +- src/emitter.c | 72 +++++++++++++++++++++++++---------- src/grammar.h | 2 + src/parser.c | 27 ++++++------- src/str.c | 25 ++++++++++++ src/tokenizer.c | 16 ++++++-- src/utils/ckdl-parse-events.c | 8 ++-- src/utils/ckdl-tokenize.c | 4 +- tests/kdlv2_test.c | 12 +++--- 11 files changed, 134 insertions(+), 48 deletions(-) diff --git a/include/kdl/common.h b/include/kdl/common.h index f4809f8..e363d06 100644 --- a/include/kdl/common.h +++ b/include/kdl/common.h @@ -20,6 +20,11 @@ enum kdl_escape_mode { KDL_ESCAPE_DEFAULT = KDL_ESCAPE_CONTROL | KDL_ESCAPE_NEWLINE | KDL_ESCAPE_TAB }; +enum kdl_version { + KDL_VERSION_1, + KDL_VERSION_2 +}; + // Function pointers used to interface with external IO typedef size_t (*kdl_read_func)(void* user_data, char* buf, size_t bufsize); typedef size_t (*kdl_write_func)(void* user_data, char const* data, size_t nbytes); @@ -27,6 +32,7 @@ typedef size_t (*kdl_write_func)(void* user_data, char const* data, size_t nbyte typedef struct kdl_str kdl_str; typedef struct kdl_owned_string kdl_owned_string; typedef enum kdl_escape_mode kdl_escape_mode; +typedef enum kdl_version kdl_version; // A reference to a string, like Rust's str or C++'s std::u8string_view // Need not be nul-terminated! @@ -66,6 +72,11 @@ KDL_NODISCARD KDL_EXPORT kdl_owned_string kdl_escape_v2(kdl_str const* s, kdl_es // Resolve backslash escape sequences according to KDLv2 rules KDL_NODISCARD KDL_EXPORT kdl_owned_string kdl_unescape_v2(kdl_str const* s); +// Escape special characters in a string +KDL_NODISCARD KDL_EXPORT kdl_owned_string kdl_escape_v(kdl_version version, kdl_str const* s, kdl_escape_mode mode); +// Resolve backslash escape sequences +KDL_NODISCARD KDL_EXPORT kdl_owned_string kdl_unescape_v(kdl_version version, kdl_str const* s); + // Escape special characters in a string according to KDLv1 string rules (subject to change) KDL_NODISCARD KDL_EXPORT kdl_owned_string kdl_escape(kdl_str const* s, kdl_escape_mode mode); // Resolve backslash escape sequences according to KDLv1 rules (subject to change) diff --git a/include/kdl/emitter.h b/include/kdl/emitter.h index 04e0e4c..1c96c1e 100644 --- a/include/kdl/emitter.h +++ b/include/kdl/emitter.h @@ -36,6 +36,7 @@ struct kdl_emitter_options { kdl_escape_mode escape_mode; // How to escape strings kdl_identifier_emission_mode identifier_mode; // How to quote identifiers kdl_float_printing_options float_mode; // How to print floating point numbers + kdl_version version; // KDL version to use }; KDL_EXPORT extern const kdl_emitter_options KDL_DEFAULT_EMITTER_OPTIONS; diff --git a/include/kdl/parser.h b/include/kdl/parser.h index c4b6f9a..d169d85 100644 --- a/include/kdl/parser.h +++ b/include/kdl/parser.h @@ -27,8 +27,8 @@ enum kdl_event { enum kdl_parse_option { KDL_DEFAULTS = 0, // Nothing special KDL_EMIT_COMMENTS = 0x001, // Emit comments (default: don't) - KDL_VERSION_1 = 0x20000, // Use KDL version 1.0.0 - KDL_VERSION_2 = 0x40000, // Use KDL version 2.0.0-draft.4 + KDL_READ_VERSION_1 = 0x20000, // Use KDL version 1.0.0 + KDL_READ_VERSION_2 = 0x40000, // Use KDL version 2.0.0-draft.4 KDL_DETECT_VERSION = 0x70000, // Allow both KDL v2 and KDL v1 }; diff --git a/src/emitter.c b/src/emitter.c index ee02257..17121ad 100644 --- a/src/emitter.c +++ b/src/emitter.c @@ -18,7 +18,8 @@ const kdl_emitter_options KDL_DEFAULT_EMITTER_OPTIONS = { .capital_e = false, .exponent_plus = false, .plus = false, - .min_exponent = 4} + .min_exponent = 4}, + .version = KDL_VERSION_1 }; struct _kdl_emitter { @@ -77,9 +78,9 @@ void kdl_destroy_emitter(kdl_emitter* self) free(self); } -static bool _emit_str(kdl_emitter* self, kdl_str s) +static bool _emit_quoted_str(kdl_emitter* self, kdl_str s) { - kdl_owned_string escaped = kdl_escape(&s, self->opt.escape_mode); + kdl_owned_string escaped = kdl_escape_v(self->opt.version, &s, self->opt.escape_mode); bool ok = self->write_func(self->write_user_data, "\"", 1) == 1 && self->write_func(self->write_user_data, escaped.data, escaped.len) == escaped.len && self->write_func(self->write_user_data, "\"", 1) == 1; @@ -89,6 +90,15 @@ static bool _emit_str(kdl_emitter* self, kdl_str s) static kdl_owned_string _float_to_string(double f, kdl_float_printing_options const* opts) { + // emit #nan, #inf, #-inf even in KDLv1 because there is no alternative + if (isnan(f)) { + kdl_str result = kdl_str_from_cstr("#nan"); + return kdl_clone_str(&result); + } else if (isinf(f)) { + kdl_str result = f < 0.0 ? kdl_str_from_cstr("#-inf") : kdl_str_from_cstr("#inf"); + return kdl_clone_str(&result); + } + bool negative = f < 0.0; f = fabs(f); int exponent = (int)floor(log10(f)); @@ -224,19 +234,21 @@ static bool _emit_number(kdl_emitter* self, kdl_number const* n) return false; } -static bool _emit_identifier(kdl_emitter* self, kdl_str name) +static bool _emit_bare_string(kdl_emitter* self, kdl_str s) { bool bare = true; if (self->opt.identifier_mode == KDL_QUOTE_ALL_IDENTIFIERS) { bare = false; - } else if (name.len == 0) { + } else if (s.len == 0) { bare = false; } else { uint32_t c; - kdl_str tail = name; + kdl_str tail = s; bool first = true; + kdl_character_set charset + = self->opt.version == KDL_VERSION_1 ? KDL_CHARACTER_SET_V1 : KDL_CHARACTER_SET_V2; while (KDL_UTF8_OK == _kdl_pop_codepoint(&tail, &c)) { - if ((first && !_kdl_is_id_start(KDL_CHARACTER_SET_V1, c)) || !_kdl_is_id(KDL_CHARACTER_SET_V1, c) + if ((first && !_kdl_is_id_start(charset, c)) || !_kdl_is_id(charset, c) || (self->opt.identifier_mode == KDL_ASCII_IDENTIFIERS && c >= 0x7f)) { bare = false; break; @@ -246,9 +258,17 @@ static bool _emit_identifier(kdl_emitter* self, kdl_str name) } if (bare) { - return self->write_func(self->write_user_data, name.data, name.len) == name.len; + return self->write_func(self->write_user_data, s.data, s.len) == s.len; + } else { + return _emit_quoted_str(self, s); + } +} + +static bool _emit_string(kdl_emitter* self, kdl_str s) { + if (self->opt.version == KDL_VERSION_1) { + return _emit_quoted_str(self, s); } else { - return _emit_str(self, name); + return _emit_bare_string(self, s); } } @@ -258,23 +278,35 @@ static bool _emit_identifier(kdl_emitter* self, kdl_str name) static bool _emit_value(kdl_emitter* self, kdl_value const* v) { if (v->type_annotation.data != NULL) { - if (!(_write_string_literal_ok(self, "(") // - && _emit_identifier(self, v->type_annotation) // + if (!(_write_string_literal_ok(self, "(") // + && _emit_bare_string(self, v->type_annotation) // && _write_string_literal_ok(self, ")"))) return false; } switch (v->type) { case KDL_TYPE_NULL: - return _write_string_literal_ok(self, "null"); + if (self->opt.version == KDL_VERSION_1) { + return _write_string_literal_ok(self, "null"); + } else { + return _write_string_literal_ok(self, "#null"); + } case KDL_TYPE_STRING: - return _emit_str(self, v->string); + return _emit_string(self, v->string); case KDL_TYPE_NUMBER: return _emit_number(self, &v->number); case KDL_TYPE_BOOLEAN: - if (v->boolean) { - return _write_string_literal_ok(self, "true"); + if (self->opt.version == KDL_VERSION_1) { + if (v->boolean) { + return _write_string_literal_ok(self, "true"); + } else { + return _write_string_literal_ok(self, "false"); + } } else { - return _write_string_literal_ok(self, "false"); + if (v->boolean) { + return _write_string_literal_ok(self, "#true"); + } else { + return _write_string_literal_ok(self, "#false"); + } } } return false; @@ -298,16 +330,16 @@ static bool _emit_node_preamble(kdl_emitter* self) bool kdl_emit_node(kdl_emitter* self, kdl_str name) { - return _emit_node_preamble(self) && _emit_identifier(self, name); + return _emit_node_preamble(self) && _emit_bare_string(self, name); } bool kdl_emit_node_with_type(kdl_emitter* self, kdl_str type, kdl_str name) { return _emit_node_preamble(self) // && _write_string_literal_ok(self, "(") // - && _emit_identifier(self, type) // + && _emit_bare_string(self, type) // && _write_string_literal_ok(self, ")") // - && _emit_identifier(self, name); + && _emit_bare_string(self, name); } bool kdl_emit_arg(kdl_emitter* self, kdl_value const* value) @@ -318,7 +350,7 @@ bool kdl_emit_arg(kdl_emitter* self, kdl_value const* value) bool kdl_emit_property(kdl_emitter* self, kdl_str name, kdl_value const* value) { return (_write_string_literal_ok(self, " ")) // - && _emit_identifier(self, name) // + && _emit_bare_string(self, name) // && _write_string_literal_ok(self, "=") // && _emit_value(self, value); } diff --git a/src/grammar.h b/src/grammar.h index 042302f..5a8647d 100644 --- a/src/grammar.h +++ b/src/grammar.h @@ -10,6 +10,8 @@ bool _kdl_is_whitespace(kdl_character_set charset, uint32_t c); bool _kdl_is_newline(uint32_t c); bool _kdl_is_id(kdl_character_set charset, uint32_t c); bool _kdl_is_id_start(kdl_character_set charset, uint32_t c); +bool _kdl_is_word_char(kdl_character_set charset, uint32_t c); +bool _kdl_is_word_start(kdl_character_set charset, uint32_t c); bool _kdl_is_end_of_word(kdl_character_set charset, uint32_t c); bool _kdl_is_illegal_char(kdl_character_set charset, uint32_t c); bool _kdl_is_equals_sign(kdl_character_set charset, uint32_t c); diff --git a/src/parser.c b/src/parser.c index 4d26705..bbe9da6 100644 --- a/src/parser.c +++ b/src/parser.c @@ -19,10 +19,10 @@ #define KDL_DETECT_VERSION_BIT (kdl_parse_option)0x10000 #define KDL_PARSE_OPT_VERSION_BITS KDL_DETECT_VERSION -#define _v1_only(self) ((self->opt & KDL_PARSE_OPT_VERSION_BITS) == KDL_VERSION_1) -#define _v1_allowed(self) ((self->opt & KDL_VERSION_1) == KDL_VERSION_1) -#define _v2_only(self) ((self->opt & KDL_PARSE_OPT_VERSION_BITS) == KDL_VERSION_2) -#define _v2_allowed(self) ((self->opt & KDL_VERSION_2) == KDL_VERSION_2) +#define _v1_only(self) ((self->opt & KDL_PARSE_OPT_VERSION_BITS) == KDL_READ_VERSION_1) +#define _v1_allowed(self) ((self->opt & KDL_READ_VERSION_1) == KDL_READ_VERSION_1) +#define _v2_only(self) ((self->opt & KDL_PARSE_OPT_VERSION_BITS) == KDL_READ_VERSION_2) +#define _v2_allowed(self) ((self->opt & KDL_READ_VERSION_2) == KDL_READ_VERSION_2) enum _kdl_parser_state { // Basic states @@ -78,7 +78,7 @@ static void _init_kdl_parser(kdl_parser* self, kdl_parse_option opt) // Fallback: use KDLv1 only if ((opt & KDL_PARSE_OPT_VERSION_BITS) == 0) { - opt |= KDL_VERSION_1; + opt |= KDL_READ_VERSION_1; } self->opt = opt; @@ -86,7 +86,7 @@ static void _init_kdl_parser(kdl_parser* self, kdl_parse_option opt) inline static kdl_character_set _default_character_set(kdl_parse_option opt) { - if (opt & KDL_VERSION_2) { + if (opt & KDL_READ_VERSION_2) { return KDL_CHARACTER_SET_V2; } else { return KDL_CHARACTER_SET_V1; @@ -124,9 +124,11 @@ void kdl_destroy_parser(kdl_parser* self) free(self); } -static void _set_version(kdl_parser* self, kdl_parse_option version) +static void _set_version(kdl_parser* self, kdl_version version) { - self->opt = (self->opt & ~KDL_PARSE_OPT_VERSION_BITS) | version; + kdl_parse_option version_flag = version == KDL_VERSION_1 ? KDL_READ_VERSION_1 : KDL_READ_VERSION_2; + + self->opt = (self->opt & ~KDL_PARSE_OPT_VERSION_BITS) | version_flag; kdl_tokenizer_set_character_set(self->tokenizer, _default_character_set(self->opt)); } @@ -1147,14 +1149,14 @@ static bool _parse_binary_number(kdl_str number, kdl_value* val, kdl_owned_strin static bool _identifier_is_valid_v1(kdl_str value) { uint32_t c = 0; - if (_kdl_pop_codepoint(&value, &c) != KDL_UTF8_OK || !_kdl_is_id_start(KDL_CHARACTER_SET_V1, c)) { + if (_kdl_pop_codepoint(&value, &c) != KDL_UTF8_OK || !_kdl_is_word_start(KDL_CHARACTER_SET_V1, c)) { return false; } while (true) { switch (_kdl_pop_codepoint(&value, &c)) { case KDL_UTF8_OK: - if (!_kdl_is_id(KDL_CHARACTER_SET_V1, c)) return false; + if (!_kdl_is_word_char(KDL_CHARACTER_SET_V1, c)) return false; break; case KDL_UTF8_EOF: return true; @@ -1173,15 +1175,14 @@ static bool _identifier_is_valid_v2(kdl_str value) } uint32_t c = 0; - if (_kdl_pop_codepoint(&value, &c) != KDL_UTF8_OK || !_kdl_is_id_start(KDL_CHARACTER_SET_V2, c) - || c == '#') { + if (_kdl_pop_codepoint(&value, &c) != KDL_UTF8_OK || !_kdl_is_word_start(KDL_CHARACTER_SET_V2, c)) { return false; } while (true) { switch (_kdl_pop_codepoint(&value, &c)) { case KDL_UTF8_OK: - if (!_kdl_is_id(KDL_CHARACTER_SET_V2, c) || c == '#') return false; + if (!_kdl_is_word_char(KDL_CHARACTER_SET_V2, c)) return false; break; case KDL_UTF8_EOF: return true; diff --git a/src/str.c b/src/str.c index 60ec96e..1e25ed8 100644 --- a/src/str.c +++ b/src/str.c @@ -108,6 +108,31 @@ kdl_owned_string kdl_escape(kdl_str const* s, kdl_escape_mode mode) { return kdl kdl_owned_string kdl_unescape(kdl_str const* s) { return kdl_unescape_v1(s); } +KDL_NODISCARD KDL_EXPORT kdl_owned_string kdl_escape_v( + kdl_version version, kdl_str const* s, kdl_escape_mode mode) +{ + switch (version) { + case KDL_VERSION_1: + return kdl_escape_v1(s, mode); + case KDL_VERSION_2: + return kdl_escape_v2(s, mode); + default: + return (kdl_owned_string){NULL, 0}; + } +} + +KDL_NODISCARD KDL_EXPORT kdl_owned_string kdl_unescape_v(kdl_version version, kdl_str const* s) +{ + switch (version) { + case KDL_VERSION_1: + return kdl_unescape_v1(s); + case KDL_VERSION_2: + return kdl_unescape_v2(s); + default: + return (kdl_owned_string){NULL, 0}; + } +} + kdl_owned_string kdl_escape_v1(kdl_str const* s, kdl_escape_mode mode) { kdl_owned_string result; diff --git a/src/tokenizer.c b/src/tokenizer.c index 9f035da..3787ef6 100644 --- a/src/tokenizer.c +++ b/src/tokenizer.c @@ -155,6 +155,16 @@ bool _kdl_is_newline(uint32_t c) } bool _kdl_is_id(kdl_character_set charset, uint32_t c) +{ + return _kdl_is_word_char(charset, c) && !(charset == KDL_CHARACTER_SET_V2 && c == '#'); +} + +bool _kdl_is_id_start(kdl_character_set charset, uint32_t c) +{ + return _kdl_is_word_start(charset, c) && !(charset == KDL_CHARACTER_SET_V2 && c == '#'); +} + +bool _kdl_is_word_char(kdl_character_set charset, uint32_t c) { return c > 0x20 && c <= 0x10FFFF && c != '\\' && c != '/' && c != '(' && c != ')' && c != '{' && c != '}' && c != ';' && c != '[' && c != ']' && c != '=' && c != '"' @@ -162,7 +172,7 @@ bool _kdl_is_id(kdl_character_set charset, uint32_t c) && !_kdl_is_whitespace(charset, c) && !_kdl_is_newline(c); } -bool _kdl_is_id_start(kdl_character_set charset, uint32_t c) +bool _kdl_is_word_start(kdl_character_set charset, uint32_t c) { return _kdl_is_id(charset, c) && (c < '0' || c > '9'); } @@ -348,7 +358,7 @@ kdl_tokenizer_status kdl_pop_token(kdl_tokenizer* self, kdl_token* dest) } else if (c == '"') { // string return _pop_string(self, dest); - } else if (_kdl_is_id(self->charset, c)) { + } else if (_kdl_is_word_char(self->charset, c)) { if (c == 'r' || c == '#') { // this *could* be a raw string kdl_tokenizer_status rstring_status = _pop_raw_string(self, dest); @@ -382,7 +392,7 @@ static kdl_tokenizer_status _pop_word(kdl_tokenizer* self, kdl_token* dest) if (_kdl_is_end_of_word(self->charset, c)) { // end the word goto end_of_word; - } else if (!_kdl_is_id(self->charset, c)) { + } else if (!_kdl_is_word_char(self->charset, c)) { // invalid character return KDL_TOKENIZER_ERROR; } diff --git a/src/utils/ckdl-parse-events.c b/src/utils/ckdl-parse-events.c index 0725e53..d9c8cc8 100644 --- a/src/utils/ckdl-parse-events.c +++ b/src/utils/ckdl-parse-events.c @@ -45,10 +45,10 @@ int main(int argc, char** argv) parse_opts |= KDL_EMIT_COMMENTS; } else if (*p == '1') { parse_opts &= ~KDL_DETECT_VERSION; - parse_opts |= KDL_VERSION_1; + parse_opts |= KDL_READ_VERSION_1; } else if (*p == '2') { parse_opts &= ~KDL_DETECT_VERSION; - parse_opts |= KDL_VERSION_2; + parse_opts |= KDL_READ_VERSION_2; } else if (*p == '-') { opts_ended = true; } else { @@ -67,7 +67,9 @@ int main(int argc, char** argv) } kdl_parser* parser = kdl_create_stream_parser(&read_func, (void*)in, parse_opts); - kdl_emitter* emitter = kdl_create_stream_emitter(&write_func, NULL, &KDL_DEFAULT_EMITTER_OPTIONS); + kdl_emitter_options emitter_opts = KDL_DEFAULT_EMITTER_OPTIONS; + emitter_opts.version = KDL_VERSION_2; + kdl_emitter* emitter = kdl_create_stream_emitter(&write_func, NULL, &emitter_opts); if (parser == NULL || emitter == NULL) { fprintf(stderr, "Initialization error\n"); diff --git a/src/utils/ckdl-tokenize.c b/src/utils/ckdl-tokenize.c index 6d496cc..a05cb27 100644 --- a/src/utils/ckdl-tokenize.c +++ b/src/utils/ckdl-tokenize.c @@ -39,7 +39,9 @@ int main(int argc, char** argv) } kdl_tokenizer* tokenizer = kdl_create_stream_tokenizer(&read_func, (void*)in); - kdl_emitter* emitter = kdl_create_stream_emitter(&write_func, NULL, &KDL_DEFAULT_EMITTER_OPTIONS); + kdl_emitter_options emitter_opts = KDL_DEFAULT_EMITTER_OPTIONS; + emitter_opts.version = KDL_VERSION_2; + kdl_emitter* emitter = kdl_create_stream_emitter(&write_func, NULL, &emitter_opts); if (tokenizer == NULL || emitter == NULL) { fprintf(stderr, "Initialization error\n"); diff --git a/tests/kdlv2_test.c b/tests/kdlv2_test.c index 3a6f2f5..05e5b5a 100644 --- a/tests/kdlv2_test.c +++ b/tests/kdlv2_test.c @@ -238,7 +238,7 @@ static void test_parser_v1_raw_string(void) kdl_str doc = kdl_str_from_cstr("r#\"a\"# "); kdl_event_data* ev; - kdl_parser* parser = kdl_create_string_parser(doc, KDL_VERSION_1); + kdl_parser* parser = kdl_create_string_parser(doc, KDL_READ_VERSION_1); ev = kdl_parser_next_event(parser); ASSERT(ev->event == KDL_EVENT_START_NODE); @@ -263,7 +263,7 @@ static void test_parser_v1_raw_string(void) kdl_destroy_parser(parser); // Test that V1 raw strings are illegal in V2 - parser = kdl_create_string_parser(doc, KDL_VERSION_2); + parser = kdl_create_string_parser(doc, KDL_READ_VERSION_2); ev = kdl_parser_next_event(parser); ASSERT(ev->event == KDL_EVENT_PARSE_ERROR); @@ -276,7 +276,7 @@ static void test_parser_v2_raw_string(void) kdl_str doc = kdl_str_from_cstr("#\"a\"#"); kdl_event_data* ev; - kdl_parser* parser = kdl_create_string_parser(doc, KDL_VERSION_2); + kdl_parser* parser = kdl_create_string_parser(doc, KDL_READ_VERSION_2); ev = kdl_parser_next_event(parser); ASSERT(ev->event == KDL_EVENT_START_NODE); @@ -298,7 +298,7 @@ static void test_parser_hashtag_null(void) kdl_str doc = kdl_str_from_cstr("a #null #true #false"); kdl_event_data* ev; - kdl_parser* parser = kdl_create_string_parser(doc, KDL_VERSION_2); + kdl_parser* parser = kdl_create_string_parser(doc, KDL_READ_VERSION_2); ev = kdl_parser_next_event(parser); ASSERT(ev->event == KDL_EVENT_START_NODE); @@ -325,7 +325,7 @@ static void test_parser_hashless_syntax_error(void) kdl_str doc = kdl_str_from_cstr("a null"); kdl_event_data* ev; - kdl_parser* parser = kdl_create_string_parser(doc, KDL_VERSION_2); + kdl_parser* parser = kdl_create_string_parser(doc, KDL_READ_VERSION_2); ev = kdl_parser_next_event(parser); ASSERT(ev->event == KDL_EVENT_START_NODE); @@ -400,7 +400,7 @@ static void test_parser_comment_in_property(void) kdl_event_data* ev; kdl_str doc = kdl_str_from_cstr("node key /* equals sign coming up */ = \\ \n value"); - kdl_parser* parser = kdl_create_string_parser(doc, KDL_EMIT_COMMENTS | KDL_VERSION_2); + kdl_parser* parser = kdl_create_string_parser(doc, KDL_EMIT_COMMENTS | KDL_READ_VERSION_2); ev = kdl_parser_next_event(parser); ASSERT(ev->event == KDL_EVENT_START_NODE); From db87a62952465b41a2d0f7997e772856e608b163 Mon Sep 17 00:00:00 2001 From: Thomas Jollans Date: Sun, 26 May 2024 12:03:00 +0200 Subject: [PATCH 22/45] properly support comments in type annotations --- src/parser.c | 33 ++++++++++++++++++++++----------- tests/kdlv2_test.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 11 deletions(-) diff --git a/src/parser.c b/src/parser.c index bbe9da6..d1c48be 100644 --- a/src/parser.c +++ b/src/parser.c @@ -60,7 +60,8 @@ struct _kdl_parser { kdl_owned_string tmp_string_type; kdl_owned_string tmp_string_key; kdl_owned_string tmp_string_value; - kdl_owned_string waiting_string; + kdl_str waiting_type_annotation; + kdl_owned_string waiting_prop_name; kdl_token next_token; bool have_next_token; }; @@ -73,7 +74,8 @@ static void _init_kdl_parser(kdl_parser* self, kdl_parse_option opt) self->tmp_string_type = (kdl_owned_string){NULL, 0}; self->tmp_string_key = (kdl_owned_string){NULL, 0}; self->tmp_string_value = (kdl_owned_string){NULL, 0}; - self->waiting_string = (kdl_owned_string){NULL, 0}; + self->waiting_type_annotation = (kdl_str){NULL, 0}; + self->waiting_prop_name = (kdl_owned_string){NULL, 0}; self->have_next_token = false; // Fallback: use KDLv1 only @@ -121,6 +123,7 @@ void kdl_destroy_parser(kdl_parser* self) kdl_free_string(&self->tmp_string_type); kdl_free_string(&self->tmp_string_key); kdl_free_string(&self->tmp_string_value); + kdl_free_string(&self->waiting_prop_name); free(self); } @@ -318,7 +321,7 @@ static kdl_event_data* _next_node(kdl_parser* self, kdl_token* token) // We're good, this is an identifier self->state = (self->state & ~PARSER_FLAG_TYPE_ANNOTATION_START) | PARSER_FLAG_TYPE_ANNOTATION_END; - self->event.value.type_annotation = tmp_val.string; + self->waiting_type_annotation = tmp_val.string; return NULL; } else { _set_parse_error(self, "Expected identifier or string"); @@ -371,6 +374,10 @@ static kdl_event_data* _next_node(kdl_parser* self, kdl_token* token) self->state = PARSER_IN_NODE; self->event.event = KDL_EVENT_START_NODE; self->event.name = tmp_val.string; + if (self->waiting_type_annotation.data != NULL) { + self->event.value.type_annotation = self->waiting_type_annotation; + self->waiting_type_annotation = (kdl_str){NULL, 0}; + } ++self->depth; ev = _apply_slashdash(self); return ev; @@ -461,8 +468,8 @@ static kdl_event_data* _next_event_in_node(kdl_parser* self, kdl_token* token) self->event.event = KDL_EVENT_ARGUMENT; self->event.value.type = KDL_TYPE_STRING; - self->tmp_string_value = self->waiting_string; - self->waiting_string = (kdl_owned_string){NULL, 0}; + self->tmp_string_value = self->waiting_prop_name; + self->waiting_prop_name = (kdl_owned_string){NULL, 0}; self->event.value.string = kdl_borrow_str(&self->tmp_string_value); ev = _apply_slashdash(self); self->state = PARSER_IN_NODE; @@ -483,7 +490,7 @@ static kdl_event_data* _next_event_in_node(kdl_parser* self, kdl_token* token) // We're good, this is an identifier self->state = (self->state & ~PARSER_FLAG_TYPE_ANNOTATION_START) | PARSER_FLAG_TYPE_ANNOTATION_END; - self->event.value.type_annotation = tmp_val.string; + self->waiting_type_annotation = tmp_val.string; return NULL; } else { _set_parse_error(self, "Expected identifier or string"); @@ -535,10 +542,10 @@ static kdl_event_data* _next_event_in_node(kdl_parser* self, kdl_token* token) } // Can this be a property key? - if (self->event.value.type_annotation.data == NULL && (self->state & PARSER_FLAG_IN_PROPERTY) == 0 + if (self->waiting_type_annotation.data == NULL && (self->state & PARSER_FLAG_IN_PROPERTY) == 0 && self->event.value.type == KDL_TYPE_STRING) { - // carry over the potential name in waiting_string - self->waiting_string = self->tmp_string_value; + // carry over the potential name in waiting_prop_name + self->waiting_prop_name = self->tmp_string_value; self->tmp_string_value = (kdl_owned_string){NULL, 0}; self->event.value.type = KDL_TYPE_NULL; self->state |= PARSER_FLAG_MAYBE_IN_PROPERTY; @@ -563,9 +570,13 @@ static kdl_event_data* _next_event_in_node(kdl_parser* self, kdl_token* token) } // We can return the event + if (self->waiting_type_annotation.data != NULL) { + self->event.value.type_annotation = self->waiting_type_annotation; + self->waiting_type_annotation = (kdl_str){NULL, 0}; + } if (self->state & PARSER_FLAG_IN_PROPERTY) { - self->tmp_string_key = self->waiting_string; - self->waiting_string = (kdl_owned_string){NULL, 0}; + self->tmp_string_key = self->waiting_prop_name; + self->waiting_prop_name = (kdl_owned_string){NULL, 0}; self->event.name = kdl_borrow_str(&self->tmp_string_key); self->event.event = KDL_EVENT_PROPERTY; } else { diff --git a/tests/kdlv2_test.c b/tests/kdlv2_test.c index 05e5b5a..d83bdfe 100644 --- a/tests/kdlv2_test.c +++ b/tests/kdlv2_test.c @@ -419,6 +419,38 @@ static void test_parser_comment_in_property(void) kdl_destroy_parser(parser); } + +static void test_parser_comment_in_type(void) +{ + kdl_event_data* ev; + kdl_str doc = kdl_str_from_cstr("(/* */ t1) node (t2 /* */)arg"); + + kdl_parser* parser = kdl_create_string_parser(doc, KDL_EMIT_COMMENTS | KDL_READ_VERSION_2); + + ev = kdl_parser_next_event(parser); + ASSERT(ev->event == KDL_EVENT_COMMENT); + + ev = kdl_parser_next_event(parser); + ASSERT(ev->event == KDL_EVENT_START_NODE); + ASSERT(ev->value.type_annotation.len == 2); + ASSERT(memcmp(ev->value.type_annotation.data, "t1", 2) == 0); + + ev = kdl_parser_next_event(parser); + ASSERT(ev->event == KDL_EVENT_COMMENT); + + ev = kdl_parser_next_event(parser); + ASSERT(ev->event == KDL_EVENT_ARGUMENT); + ASSERT(ev->name.data == NULL); + ASSERT(ev->value.type == KDL_TYPE_STRING); + ASSERT(ev->value.string.len == 3); + ASSERT(memcmp(ev->value.string.data, "arg", 3) == 0); + ASSERT(ev->value.type_annotation.len == 2); + ASSERT(memcmp(ev->value.type_annotation.data, "t2", 2) == 0); + + kdl_destroy_parser(parser); +} + + void TEST_MAIN(void) { run_test("Tokenizer: KDLv2 strings", &test_tokenizer_strings); @@ -436,4 +468,5 @@ void TEST_MAIN(void) run_test("Parser: #null means we're in v2, etc.", &test_parser_hashtag_null_is_v2); run_test("Parser: whitespace in new place", &test_parser_kdlv2_whitespace); run_test("Parser: comment in property definition", &test_parser_comment_in_property); + run_test("Parser: comment in type annotation", &test_parser_comment_in_type); } From f5c85b8824e9d9fb54bba79e10eb3773cae32676 Mon Sep 17 00:00:00 2001 From: Thomas Jollans Date: Sun, 26 May 2024 12:17:45 +0200 Subject: [PATCH 23/45] KDLv2 in ckdl-cat --- src/utils/ckdl-cat-main.c | 20 +++++++++++++++++++- src/utils/ckdl-cat.c | 22 ++++++++++++++++++---- src/utils/ckdl-cat.h | 3 +++ 3 files changed, 40 insertions(+), 5 deletions(-) diff --git a/src/utils/ckdl-cat-main.c b/src/utils/ckdl-cat-main.c index 20b1305..d74a6d7 100644 --- a/src/utils/ckdl-cat-main.c +++ b/src/utils/ckdl-cat-main.c @@ -8,6 +8,9 @@ static void print_usage(char const* argv0, FILE* fp) { fprintf(fp, "Usage: %s [-h]\n\n", argv0); fprintf(fp, " -h Print usage information\n"); + fprintf(fp, " -1 Output KDLv1 (default)\n"); + fprintf(fp, " -2 Output KDLv2\n"); + fprintf(fp, " -m Monoglot mode: accept only one KDL version as input\n"); } int main(int argc, char** argv) @@ -16,6 +19,9 @@ int main(int argc, char** argv) char const* argv0 = argv[0]; bool opts_ended = false; + bool monoglot = false; + kdl_version version = KDL_VERSION_1; + while (--argc) { ++argv; if (!opts_ended && **argv == '-') { @@ -24,6 +30,12 @@ int main(int argc, char** argv) if (*p == 'h') { print_usage(argv0, stdout); return 0; + } else if (*p == '1') { + version = KDL_VERSION_1; + } else if (*p == '2') { + version = KDL_VERSION_2; + } else if (*p == 'm') { + monoglot = true; } else if (*p == '-') { opts_ended = true; } else { @@ -41,7 +53,13 @@ int main(int argc, char** argv) } } - bool ok = kdl_cat_file_to_file(in, stdout); + kdl_parse_option parse_opt = monoglot + ? (version == KDL_VERSION_1 ? KDL_READ_VERSION_1 : KDL_READ_VERSION_2) + : KDL_DETECT_VERSION; + kdl_emitter_options emit_opt = KDL_DEFAULT_EMITTER_OPTIONS; + emit_opt.version = version; + + bool ok = kdl_cat_file_to_file_ex(in, stdout, parse_opt, &emit_opt); if (in != stdin) { fclose(in); diff --git a/src/utils/ckdl-cat.c b/src/utils/ckdl-cat.c index d8bf68e..79fbc2f 100644 --- a/src/utils/ckdl-cat.c +++ b/src/utils/ckdl-cat.c @@ -31,11 +31,18 @@ bool kdl_cat_file_to_file(FILE* in, FILE* out) } bool kdl_cat_file_to_file_opt(FILE* in, FILE* out, kdl_emitter_options const* opt) +{ + kdl_cat_file_to_file_ex(in, out, KDL_DEFAULTS, opt); +} + +bool kdl_cat_file_to_file_ex(FILE* in, FILE* out, kdl_parse_option parse_opt, kdl_emitter_options const* emit_opt) { bool ok = true; - kdl_parser* parser = kdl_create_stream_parser(&read_func, (void*)in, KDL_DEFAULTS); - kdl_emitter* emitter = kdl_create_stream_emitter(&write_func, (void*)out, opt); + parse_opt &= ~KDL_EMIT_COMMENTS; + + kdl_parser* parser = kdl_create_stream_parser(&read_func, (void*)in, parse_opt); + kdl_emitter* emitter = kdl_create_stream_emitter(&write_func, (void*)out, emit_opt); if (parser == NULL || emitter == NULL) { ok = false; @@ -54,11 +61,18 @@ kdl_owned_string kdl_cat_file_to_string(FILE* in) } kdl_owned_string kdl_cat_file_to_string_opt(FILE* in, kdl_emitter_options const* opt) +{ + return kdl_cat_file_to_string_ex(in, KDL_DEFAULTS, opt); +} + +kdl_owned_string kdl_cat_file_to_string_ex(FILE* in, kdl_parse_option parse_opt, kdl_emitter_options const* emit_opt) { kdl_owned_string result = {NULL, 0}; - kdl_parser* parser = kdl_create_stream_parser(&read_func, (void*)in, KDL_DEFAULTS); - kdl_emitter* emitter = kdl_create_buffering_emitter(opt); + parse_opt &= ~KDL_EMIT_COMMENTS; + + kdl_parser* parser = kdl_create_stream_parser(&read_func, (void*)in, parse_opt); + kdl_emitter* emitter = kdl_create_buffering_emitter(emit_opt); bool ok = true; if (parser == NULL || emitter == NULL) { diff --git a/src/utils/ckdl-cat.h b/src/utils/ckdl-cat.h index ee06f05..f2555f9 100644 --- a/src/utils/ckdl-cat.h +++ b/src/utils/ckdl-cat.h @@ -3,13 +3,16 @@ #include #include +#include #include #include bool kdl_cat_file_to_file(FILE* in, FILE* out); bool kdl_cat_file_to_file_opt(FILE* in, FILE* out, kdl_emitter_options const* opt); +bool kdl_cat_file_to_file_ex(FILE* in, FILE* out, kdl_parse_option parse_opt, kdl_emitter_options const* emit_opt); kdl_owned_string kdl_cat_file_to_string(FILE* in); kdl_owned_string kdl_cat_file_to_string_opt(FILE* in, kdl_emitter_options const* opt); +kdl_owned_string kdl_cat_file_to_string_ex(FILE* in, kdl_parse_option parse_opt, kdl_emitter_options const* emit_opt); #endif // CKDL_CAT_H_ From 28dc86dddb412003842d52b342130beeb3b89bc2 Mon Sep 17 00:00:00 2001 From: Thomas Jollans Date: Sun, 26 May 2024 12:31:09 +0200 Subject: [PATCH 24/45] detect version from multi-line strings --- src/parser.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/src/parser.c b/src/parser.c index d1c48be..bce7de8 100644 --- a/src/parser.c +++ b/src/parser.c @@ -644,13 +644,26 @@ static bool _parse_value(kdl_parser* self, kdl_token const* token, kdl_value* va } else { return false; } - case KDL_TOKEN_STRING: + case KDL_TOKEN_STRING: { // parse escapes - if (_v2_allowed(self)) { - *s = kdl_unescape_v2(&token->value); - } else { - *s = kdl_unescape_v1(&token->value); + kdl_owned_string v1_str = (kdl_owned_string){NULL, 0}; + kdl_owned_string v2_str = (kdl_owned_string){NULL, 0}; + + if (_v1_allowed(self)) v1_str = kdl_unescape_v1(&token->value); + if (_v2_allowed(self)) v2_str = kdl_unescape_v2(&token->value); + + if (v1_str.data == NULL && v2_str.data != NULL) { + _set_version(self, KDL_VERSION_2); + *s = v2_str; + } else if (v1_str.data != NULL && v2_str.data == NULL) { + _set_version(self, KDL_VERSION_1); + *s = v1_str; + } else if (v1_str.data != NULL && v2_str.data != NULL) { + // Could be either version, used KDLv2 value + *s = v2_str; + kdl_free_string(&v1_str); } + if (s->data == NULL) { return false; } else { @@ -658,6 +671,7 @@ static bool _parse_value(kdl_parser* self, kdl_token const* token, kdl_value* va val->string = kdl_borrow_str(s); return true; } + } case KDL_TOKEN_WORD: { if (_str_equals_literal(token->value, "null")) { if (_v1_allowed(self)) { From 3c630e3e921ff7393cd61dd79ca84f25b61f9820 Mon Sep 17 00:00:00 2001 From: Thomas Jollans Date: Sun, 26 May 2024 12:51:38 +0200 Subject: [PATCH 25/45] Just copy the test cases, downloading them from GH every time was silly --- COPYING | 2 +- include/kdl/parser.h | 2 +- tests/CMakeLists.txt | 110 +++--------------- tests/test_documents/upstream/1.0.0/COPYING | 1 + .../1.0.0/expected_kdl/all_escapes.kdl | 1 + .../1.0.0/expected_kdl/all_node_fields.kdl | 3 + .../expected_kdl/arg_and_prop_same_name.kdl | 1 + .../1.0.0/expected_kdl/arg_false_type.kdl | 1 + .../1.0.0/expected_kdl/arg_float_type.kdl | 1 + .../1.0.0/expected_kdl/arg_hex_type.kdl | 1 + .../1.0.0/expected_kdl/arg_null_type.kdl | 1 + .../expected_kdl/arg_raw_string_type.kdl | 1 + .../1.0.0/expected_kdl/arg_string_type.kdl | 1 + .../1.0.0/expected_kdl/arg_true_type.kdl | 1 + .../upstream/1.0.0/expected_kdl/arg_type.kdl | 1 + .../1.0.0/expected_kdl/arg_zero_type.kdl | 1 + .../asterisk_in_block_comment.kdl | 1 + .../1.0.0/expected_kdl/bare_emoji.kdl | 1 + .../upstream/1.0.0/expected_kdl/binary.kdl | 1 + .../binary_trailing_underscore.kdl | 1 + .../1.0.0/expected_kdl/binary_underscore.kdl | 1 + .../1.0.0/expected_kdl/blank_arg_type.kdl | 1 + .../1.0.0/expected_kdl/blank_node_type.kdl | 1 + .../1.0.0/expected_kdl/blank_prop_type.kdl | 1 + .../1.0.0/expected_kdl/block_comment.kdl | 1 + .../expected_kdl/block_comment_after_node.kdl | 1 + .../block_comment_before_node.kdl | 1 + .../block_comment_before_node_no_space.kdl | 1 + .../expected_kdl/block_comment_newline.kdl | 1 + .../1.0.0/expected_kdl/boolean_arg.kdl | 1 + .../1.0.0/expected_kdl/boolean_prop.kdl | 1 + .../1.0.0/expected_kdl/commented_arg.kdl | 1 + .../1.0.0/expected_kdl/commented_child.kdl | 1 + .../1.0.0/expected_kdl/commented_line.kdl | 1 + .../1.0.0/expected_kdl/commented_node.kdl | 1 + .../1.0.0/expected_kdl/commented_prop.kdl | 1 + .../1.0.0/expected_kdl/crlf_between_nodes.kdl | 2 + .../upstream/1.0.0/expected_kdl/emoji.kdl | 1 + .../upstream/1.0.0/expected_kdl/empty.kdl | 1 + .../1.0.0/expected_kdl/empty_child.kdl | 1 + .../empty_child_different_lines.kdl | 1 + .../expected_kdl/empty_child_same_line.kdl | 1 + .../expected_kdl/empty_child_whitespace.kdl | 1 + .../expected_kdl/empty_quoted_node_id.kdl | 1 + .../expected_kdl/empty_quoted_prop_key.kdl | 1 + .../1.0.0/expected_kdl/empty_string_arg.kdl | 1 + .../expected_kdl/esc_newline_in_string.kdl | 1 + .../expected_kdl/esc_unicode_in_string.kdl | 1 + .../upstream/1.0.0/expected_kdl/escline.kdl | 1 + .../expected_kdl/escline_line_comment.kdl | 1 + .../1.0.0/expected_kdl/escline_node.kdl | 2 + .../expected_kdl/false_prefix_in_bare_id.kdl | 1 + .../expected_kdl/false_prefix_in_prop_key.kdl | 1 + .../upstream/1.0.0/expected_kdl/hex.kdl | 1 + .../upstream/1.0.0/expected_kdl/hex_int.kdl | 1 + .../expected_kdl/hex_int_underscores.kdl | 1 + .../1.0.0/expected_kdl/hex_leading_zero.kdl | 1 + .../expected_kdl/int_multiple_underscore.kdl | 1 + .../1.0.0/expected_kdl/just_block_comment.kdl | 1 + .../1.0.0/expected_kdl/just_child.kdl | 3 + .../1.0.0/expected_kdl/just_newline.kdl | 1 + .../1.0.0/expected_kdl/just_node_id.kdl | 1 + .../1.0.0/expected_kdl/just_space.kdl | 1 + .../1.0.0/expected_kdl/leading_newline.kdl | 1 + .../expected_kdl/leading_zero_binary.kdl | 1 + .../1.0.0/expected_kdl/leading_zero_int.kdl | 1 + .../1.0.0/expected_kdl/leading_zero_oct.kdl | 1 + .../1.0.0/expected_kdl/multiline_comment.kdl | 1 + .../1.0.0/expected_kdl/multiline_nodes.kdl | 1 + .../1.0.0/expected_kdl/multiline_string.kdl | 1 + .../1.0.0/expected_kdl/negative_exponent.kdl | 1 + .../1.0.0/expected_kdl/negative_float.kdl | 1 + .../1.0.0/expected_kdl/negative_int.kdl | 1 + .../expected_kdl/nested_block_comment.kdl | 1 + .../1.0.0/expected_kdl/nested_children.kdl | 5 + .../1.0.0/expected_kdl/nested_comments.kdl | 1 + .../nested_multiline_block_comment.kdl | 1 + .../expected_kdl/newline_between_nodes.kdl | 2 + .../newlines_in_block_comment.kdl | 1 + .../expected_kdl/no_decimal_exponent.kdl | 1 + .../1.0.0/expected_kdl/node_false.kdl | 1 + .../upstream/1.0.0/expected_kdl/node_true.kdl | 1 + .../upstream/1.0.0/expected_kdl/node_type.kdl | 1 + .../upstream/1.0.0/expected_kdl/null_arg.kdl | 1 + .../expected_kdl/null_prefix_in_bare_id.kdl | 1 + .../expected_kdl/null_prefix_in_prop_key.kdl | 1 + .../upstream/1.0.0/expected_kdl/null_prop.kdl | 1 + .../1.0.0/expected_kdl/numeric_arg.kdl | 1 + .../1.0.0/expected_kdl/numeric_prop.kdl | 1 + .../upstream/1.0.0/expected_kdl/octal.kdl | 1 + .../upstream/1.0.0/expected_kdl/only_cr.kdl | 1 + .../1.0.0/expected_kdl/only_line_comment.kdl | 1 + .../expected_kdl/only_line_comment_crlf.kdl | 1 + .../only_line_comment_newline.kdl | 1 + .../expected_kdl/parse_all_arg_types.kdl | 1 + .../1.0.0/expected_kdl/positive_exponent.kdl | 1 + .../1.0.0/expected_kdl/positive_int.kdl | 1 + .../expected_kdl/preserve_duplicate_nodes.kdl | 2 + .../expected_kdl/preserve_node_order.kdl | 3 + .../1.0.0/expected_kdl/prop_false_type.kdl | 1 + .../1.0.0/expected_kdl/prop_float_type.kdl | 1 + .../1.0.0/expected_kdl/prop_hex_type.kdl | 1 + .../1.0.0/expected_kdl/prop_null_type.kdl | 1 + .../expected_kdl/prop_raw_string_type.kdl | 1 + .../1.0.0/expected_kdl/prop_string_type.kdl | 1 + .../1.0.0/expected_kdl/prop_true_type.kdl | 1 + .../upstream/1.0.0/expected_kdl/prop_type.kdl | 1 + .../1.0.0/expected_kdl/prop_zero_type.kdl | 1 + .../1.0.0/expected_kdl/quoted_arg_type.kdl | 1 + .../1.0.0/expected_kdl/quoted_node_name.kdl | 1 + .../1.0.0/expected_kdl/quoted_node_type.kdl | 1 + .../1.0.0/expected_kdl/quoted_numeric.kdl | 1 + .../1.0.0/expected_kdl/quoted_prop_name.kdl | 1 + .../1.0.0/expected_kdl/quoted_prop_type.kdl | 1 + .../upstream/1.0.0/expected_kdl/r_node.kdl | 1 + .../1.0.0/expected_kdl/raw_arg_type.kdl | 1 + .../1.0.0/expected_kdl/raw_node_name.kdl | 1 + .../1.0.0/expected_kdl/raw_node_type.kdl | 1 + .../1.0.0/expected_kdl/raw_prop_type.kdl | 1 + .../1.0.0/expected_kdl/raw_string_arg.kdl | 3 + .../expected_kdl/raw_string_backslash.kdl | 1 + .../expected_kdl/raw_string_hash_no_esc.kdl | 1 + .../raw_string_just_backslash.kdl | 1 + .../expected_kdl/raw_string_just_quote.kdl | 1 + .../expected_kdl/raw_string_multiple_hash.kdl | 1 + .../1.0.0/expected_kdl/raw_string_newline.kdl | 1 + .../1.0.0/expected_kdl/raw_string_prop.kdl | 3 + .../1.0.0/expected_kdl/raw_string_quote.kdl | 1 + .../1.0.0/expected_kdl/repeated_arg.kdl | 1 + .../1.0.0/expected_kdl/repeated_prop.kdl | 1 + .../upstream/1.0.0/expected_kdl/same_args.kdl | 1 + .../1.0.0/expected_kdl/same_name_nodes.kdl | 2 + .../1.0.0/expected_kdl/sci_notation_large.kdl | 1 + .../1.0.0/expected_kdl/sci_notation_small.kdl | 1 + .../expected_kdl/semicolon_after_child.kdl | 3 + .../1.0.0/expected_kdl/semicolon_in_child.kdl | 3 + .../expected_kdl/semicolon_separated.kdl | 2 + .../semicolon_separated_nodes.kdl | 2 + .../expected_kdl/semicolon_terminated.kdl | 1 + .../1.0.0/expected_kdl/single_arg.kdl | 1 + .../1.0.0/expected_kdl/single_prop.kdl | 1 + .../slashdash_arg_after_newline_esc.kdl | 1 + .../slashdash_arg_before_newline_esc.kdl | 1 + .../1.0.0/expected_kdl/slashdash_child.kdl | 1 + .../expected_kdl/slashdash_empty_child.kdl | 1 + .../expected_kdl/slashdash_full_node.kdl | 1 + .../expected_kdl/slashdash_in_slashdash.kdl | 1 + .../slashdash_negative_number.kdl | 1 + .../expected_kdl/slashdash_node_in_child.kdl | 1 + .../slashdash_node_with_child.kdl | 1 + .../expected_kdl/slashdash_only_node.kdl | 1 + .../slashdash_only_node_with_space.kdl | 1 + .../1.0.0/expected_kdl/slashdash_prop.kdl | 1 + .../expected_kdl/slashdash_raw_prop_key.kdl | 1 + .../expected_kdl/slashdash_repeated_prop.kdl | 1 + .../1.0.0/expected_kdl/string_arg.kdl | 1 + .../1.0.0/expected_kdl/string_prop.kdl | 1 + .../upstream/1.0.0/expected_kdl/tab_space.kdl | 1 + .../1.0.0/expected_kdl/trailing_crlf.kdl | 1 + .../expected_kdl/trailing_underscore_hex.kdl | 1 + .../trailing_underscore_octal.kdl | 1 + .../expected_kdl/true_prefix_in_bare_id.kdl | 1 + .../expected_kdl/true_prefix_in_prop_key.kdl | 1 + .../upstream/1.0.0/expected_kdl/two_nodes.kdl | 2 + .../expected_kdl/underscore_in_exponent.kdl | 1 + .../expected_kdl/underscore_in_float.kdl | 1 + .../expected_kdl/underscore_in_fraction.kdl | 1 + .../1.0.0/expected_kdl/underscore_in_int.kdl | 1 + .../expected_kdl/underscore_in_octal.kdl | 1 + .../unusual_bare_id_chars_in_quoted_id.kdl | 1 + .../expected_kdl/unusual_chars_in_bare_id.kdl | 1 + .../upstream/1.0.0/expected_kdl/zero_arg.kdl | 1 + .../1.0.0/expected_kdl/zero_float.kdl | 1 + .../upstream/1.0.0/expected_kdl/zero_int.kdl | 1 + .../upstream/1.0.0/input/all_escapes.kdl | 1 + .../upstream/1.0.0/input/all_node_fields.kdl | 3 + .../1.0.0/input/arg_and_prop_same_name.kdl | 1 + .../upstream/1.0.0/input/arg_false_type.kdl | 1 + .../upstream/1.0.0/input/arg_float_type.kdl | 1 + .../upstream/1.0.0/input/arg_hex_type.kdl | 1 + .../upstream/1.0.0/input/arg_null_type.kdl | 1 + .../1.0.0/input/arg_raw_string_type.kdl | 1 + .../upstream/1.0.0/input/arg_string_type.kdl | 1 + .../upstream/1.0.0/input/arg_true_type.kdl | 1 + .../upstream/1.0.0/input/arg_type.kdl | 1 + .../upstream/1.0.0/input/arg_zero_type.kdl | 1 + .../1.0.0/input/asterisk_in_block_comment.kdl | 1 + .../1.0.0/input/backslash_in_bare_id.kdl | 1 + .../upstream/1.0.0/input/bare_arg.kdl | 1 + .../upstream/1.0.0/input/bare_emoji.kdl | 1 + .../upstream/1.0.0/input/binary.kdl | 1 + .../input/binary_trailing_underscore.kdl | 1 + .../1.0.0/input/binary_underscore.kdl | 1 + .../upstream/1.0.0/input/blank_arg_type.kdl | 1 + .../upstream/1.0.0/input/blank_node_type.kdl | 1 + .../upstream/1.0.0/input/blank_prop_type.kdl | 1 + .../upstream/1.0.0/input/block_comment.kdl | 1 + .../1.0.0/input/block_comment_after_node.kdl | 1 + .../1.0.0/input/block_comment_before_node.kdl | 1 + .../block_comment_before_node_no_space.kdl | 1 + .../1.0.0/input/block_comment_newline.kdl | 1 + .../upstream/1.0.0/input/boolean_arg.kdl | 1 + .../upstream/1.0.0/input/boolean_prop.kdl | 1 + .../1.0.0/input/brackets_in_bare_id.kdl | 1 + .../1.0.0/input/chevrons_in_bare_id.kdl | 1 + .../upstream/1.0.0/input/comma_in_bare_id.kdl | 1 + .../1.0.0/input/comment_after_arg_type.kdl | 1 + .../1.0.0/input/comment_after_node_type.kdl | 1 + .../1.0.0/input/comment_after_prop_type.kdl | 1 + .../1.0.0/input/comment_in_arg_type.kdl | 1 + .../1.0.0/input/comment_in_node_type.kdl | 1 + .../1.0.0/input/comment_in_prop_type.kdl | 1 + .../upstream/1.0.0/input/commented_arg.kdl | 1 + .../upstream/1.0.0/input/commented_child.kdl | 3 + .../upstream/1.0.0/input/commented_line.kdl | 2 + .../upstream/1.0.0/input/commented_node.kdl | 2 + .../upstream/1.0.0/input/commented_prop.kdl | 1 + .../1.0.0/input/crlf_between_nodes.kdl | 2 + .../upstream/1.0.0/input/dash_dash.kdl | 1 + .../1.0.0/input/dot_but_no_fraction.kdl | 1 + .../dot_but_no_fraction_before_exponent.kdl | 1 + .../upstream/1.0.0/input/dot_in_exponent.kdl | 1 + .../upstream/1.0.0/input/dot_zero.kdl | 1 + .../upstream/1.0.0/input/emoji.kdl | 1 + .../upstream/1.0.0/input/empty.kdl | 0 .../upstream/1.0.0/input/empty_arg_type.kdl | 1 + .../upstream/1.0.0/input/empty_child.kdl | 2 + .../input/empty_child_different_lines.kdl | 2 + .../1.0.0/input/empty_child_same_line.kdl | 1 + .../1.0.0/input/empty_child_whitespace.kdl | 3 + .../upstream/1.0.0/input/empty_node_type.kdl | 1 + .../upstream/1.0.0/input/empty_prop_type.kdl | 1 + .../1.0.0/input/empty_quoted_node_id.kdl | 1 + .../1.0.0/input/empty_quoted_prop_key.kdl | 1 + .../upstream/1.0.0/input/empty_string_arg.kdl | 1 + .../1.0.0/input/esc_newline_in_string.kdl | 1 + .../1.0.0/input/esc_unicode_in_string.kdl | 1 + .../upstream/1.0.0/input/escline.kdl | 2 + .../1.0.0/input/escline_comment_node.kdl | 3 + .../1.0.0/input/escline_line_comment.kdl | 4 + .../upstream/1.0.0/input/escline_node.kdl | 2 + .../1.0.0/input/false_prefix_in_bare_id.kdl | 1 + .../1.0.0/input/false_prefix_in_prop_key.kdl | 1 + .../upstream/1.0.0/input/false_prop_key.kdl | 1 + .../upstream/1.0.0/input/hex.kdl | 1 + .../upstream/1.0.0/input/hex_int.kdl | 1 + .../1.0.0/input/hex_int_underscores.kdl | 1 + .../upstream/1.0.0/input/hex_leading_zero.kdl | 1 + .../1.0.0/input/illegal_char_in_binary.kdl | 1 + .../1.0.0/input/illegal_char_in_hex.kdl | 1 + .../1.0.0/input/illegal_char_in_octal.kdl | 1 + .../1.0.0/input/int_multiple_underscore.kdl | 1 + .../1.0.0/input/just_block_comment.kdl | 1 + .../upstream/1.0.0/input/just_child.kdl | 3 + .../upstream/1.0.0/input/just_newline.kdl | 1 + .../upstream/1.0.0/input/just_node_id.kdl | 1 + .../upstream/1.0.0/input/just_space.kdl | 1 + .../1.0.0/input/just_space_in_arg_type.kdl | 1 + .../1.0.0/input/just_space_in_node_type.kdl | 1 + .../1.0.0/input/just_space_in_prop_type.kdl | 1 + .../upstream/1.0.0/input/just_type_no_arg.kdl | 1 + .../1.0.0/input/just_type_no_node_id.kdl | 1 + .../1.0.0/input/just_type_no_prop.kdl | 1 + .../upstream/1.0.0/input/leading_newline.kdl | 2 + .../1.0.0/input/leading_zero_binary.kdl | 1 + .../upstream/1.0.0/input/leading_zero_int.kdl | 1 + .../upstream/1.0.0/input/leading_zero_oct.kdl | 1 + .../1.0.0/input/multiline_comment.kdl | 4 + .../upstream/1.0.0/input/multiline_nodes.kdl | 3 + .../upstream/1.0.0/input/multiline_string.kdl | 4 + .../1.0.0/input/multiple_dots_in_float.kdl | 1 + ...multiple_dots_in_float_before_exponent.kdl | 1 + .../1.0.0/input/multiple_es_in_float.kdl | 1 + .../1.0.0/input/multiple_x_in_hex.kdl | 1 + .../1.0.0/input/negative_exponent.kdl | 1 + .../upstream/1.0.0/input/negative_float.kdl | 1 + .../upstream/1.0.0/input/negative_int.kdl | 1 + .../1.0.0/input/nested_block_comment.kdl | 1 + .../upstream/1.0.0/input/nested_children.kdl | 5 + .../upstream/1.0.0/input/nested_comments.kdl | 1 + .../input/nested_multiline_block_comment.kdl | 7 ++ .../1.0.0/input/newline_between_nodes.kdl | 2 + .../1.0.0/input/newlines_in_block_comment.kdl | 3 + .../1.0.0/input/no_decimal_exponent.kdl | 1 + .../upstream/1.0.0/input/no_digits_in_hex.kdl | 1 + .../upstream/1.0.0/input/node_false.kdl | 1 + .../upstream/1.0.0/input/node_true.kdl | 1 + .../upstream/1.0.0/input/node_type.kdl | 1 + .../upstream/1.0.0/input/null_arg.kdl | 1 + .../1.0.0/input/null_prefix_in_bare_id.kdl | 1 + .../1.0.0/input/null_prefix_in_prop_key.kdl | 1 + .../upstream/1.0.0/input/null_prop.kdl | 1 + .../upstream/1.0.0/input/null_prop_key.kdl | 1 + .../upstream/1.0.0/input/numeric_arg.kdl | 1 + .../upstream/1.0.0/input/numeric_prop.kdl | 1 + .../upstream/1.0.0/input/octal.kdl | 1 + .../upstream/1.0.0/input/only_cr.kdl | 1 + .../1.0.0/input/only_line_comment.kdl | 1 + .../1.0.0/input/only_line_comment_crlf.kdl | 1 + .../1.0.0/input/only_line_comment_newline.kdl | 1 + .../1.0.0/input/parens_in_bare_id.kdl | 1 + .../1.0.0/input/parse_all_arg_types.kdl | 1 + .../1.0.0/input/positive_exponent.kdl | 1 + .../upstream/1.0.0/input/positive_int.kdl | 1 + .../1.0.0/input/preserve_duplicate_nodes.kdl | 2 + .../1.0.0/input/preserve_node_order.kdl | 3 + .../upstream/1.0.0/input/prop_false_type.kdl | 1 + .../upstream/1.0.0/input/prop_float_type.kdl | 1 + .../upstream/1.0.0/input/prop_hex_type.kdl | 1 + .../upstream/1.0.0/input/prop_null_type.kdl | 1 + .../1.0.0/input/prop_raw_string_type.kdl | 1 + .../upstream/1.0.0/input/prop_string_type.kdl | 1 + .../upstream/1.0.0/input/prop_true_type.kdl | 1 + .../upstream/1.0.0/input/prop_type.kdl | 1 + .../upstream/1.0.0/input/prop_zero_type.kdl | 1 + .../input/question_mark_at_start_of_int.kdl | 1 + .../input/question_mark_before_number.kdl | 1 + .../upstream/1.0.0/input/quote_in_bare_id.kdl | 1 + .../upstream/1.0.0/input/quoted_arg_type.kdl | 1 + .../upstream/1.0.0/input/quoted_node_name.kdl | 1 + .../upstream/1.0.0/input/quoted_node_type.kdl | 1 + .../upstream/1.0.0/input/quoted_numeric.kdl | 1 + .../upstream/1.0.0/input/quoted_prop_name.kdl | 1 + .../upstream/1.0.0/input/quoted_prop_type.kdl | 1 + .../upstream/1.0.0/input/r_node.kdl | 1 + .../upstream/1.0.0/input/raw_arg_type.kdl | 1 + .../upstream/1.0.0/input/raw_node_name.kdl | 1 + .../upstream/1.0.0/input/raw_node_type.kdl | 1 + .../upstream/1.0.0/input/raw_prop_type.kdl | 1 + .../upstream/1.0.0/input/raw_string_arg.kdl | 3 + .../1.0.0/input/raw_string_backslash.kdl | 1 + .../1.0.0/input/raw_string_hash_no_esc.kdl | 1 + .../1.0.0/input/raw_string_just_backslash.kdl | 1 + .../1.0.0/input/raw_string_just_quote.kdl | 1 + .../1.0.0/input/raw_string_multiple_hash.kdl | 1 + .../1.0.0/input/raw_string_newline.kdl | 4 + .../upstream/1.0.0/input/raw_string_prop.kdl | 3 + .../upstream/1.0.0/input/raw_string_quote.kdl | 1 + .../upstream/1.0.0/input/repeated_arg.kdl | 1 + .../upstream/1.0.0/input/repeated_prop.kdl | 1 + .../upstream/1.0.0/input/same_args.kdl | 1 + .../upstream/1.0.0/input/same_name_nodes.kdl | 2 + .../1.0.0/input/sci_notation_large.kdl | 1 + .../1.0.0/input/sci_notation_small.kdl | 1 + .../1.0.0/input/semicolon_after_child.kdl | 3 + .../1.0.0/input/semicolon_in_child.kdl | 3 + .../1.0.0/input/semicolon_separated.kdl | 1 + .../1.0.0/input/semicolon_separated_nodes.kdl | 1 + .../1.0.0/input/semicolon_terminated.kdl | 1 + .../upstream/1.0.0/input/single_arg.kdl | 1 + .../upstream/1.0.0/input/single_prop.kdl | 1 + .../upstream/1.0.0/input/slash_in_bare_id.kdl | 1 + .../input/slashdash_arg_after_newline_esc.kdl | 2 + .../slashdash_arg_before_newline_esc.kdl | 2 + .../upstream/1.0.0/input/slashdash_child.kdl | 3 + .../1.0.0/input/slashdash_empty_child.kdl | 2 + .../1.0.0/input/slashdash_full_node.kdl | 2 + .../1.0.0/input/slashdash_in_slashdash.kdl | 2 + .../1.0.0/input/slashdash_negative_number.kdl | 1 + .../1.0.0/input/slashdash_node_in_child.kdl | 3 + .../1.0.0/input/slashdash_node_with_child.kdl | 3 + .../1.0.0/input/slashdash_only_node.kdl | 1 + .../input/slashdash_only_node_with_space.kdl | 1 + .../upstream/1.0.0/input/slashdash_prop.kdl | 1 + .../1.0.0/input/slashdash_raw_prop_key.kdl | 1 + .../1.0.0/input/slashdash_repeated_prop.kdl | 1 + .../1.0.0/input/space_after_arg_type.kdl | 1 + .../1.0.0/input/space_after_node_type.kdl | 1 + .../1.0.0/input/space_after_prop_type.kdl | 1 + .../1.0.0/input/space_in_arg_type.kdl | 1 + .../1.0.0/input/space_in_node_type.kdl | 1 + .../1.0.0/input/space_in_prop_type.kdl | 1 + .../1.0.0/input/square_bracket_in_bare_id.kdl | 1 + .../upstream/1.0.0/input/string_arg.kdl | 1 + .../upstream/1.0.0/input/string_prop.kdl | 1 + .../upstream/1.0.0/input/tab_space.kdl | 1 + .../upstream/1.0.0/input/trailing_crlf.kdl | 1 + .../1.0.0/input/trailing_underscore_hex.kdl | 1 + .../1.0.0/input/trailing_underscore_octal.kdl | 1 + .../1.0.0/input/true_prefix_in_bare_id.kdl | 1 + .../1.0.0/input/true_prefix_in_prop_key.kdl | 1 + .../upstream/1.0.0/input/true_prop_key.kdl | 1 + .../upstream/1.0.0/input/two_nodes.kdl | 2 + .../1.0.0/input/type_before_prop_key.kdl | 1 + .../1.0.0/input/unbalanced_raw_hashes.kdl | 1 + .../input/underscore_at_start_of_fraction.kdl | 1 + .../input/underscore_at_start_of_hex.kdl | 1 + .../input/underscore_at_start_of_int.kdl | 1 + .../1.0.0/input/underscore_before_number.kdl | 1 + .../1.0.0/input/underscore_in_exponent.kdl | 1 + .../1.0.0/input/underscore_in_float.kdl | 1 + .../1.0.0/input/underscore_in_fraction.kdl | 1 + .../1.0.0/input/underscore_in_int.kdl | 1 + .../1.0.0/input/underscore_in_octal.kdl | 1 + .../unusual_bare_id_chars_in_quoted_id.kdl | 1 + .../1.0.0/input/unusual_chars_in_bare_id.kdl | 1 + .../upstream/1.0.0/input/zero_arg.kdl | 1 + .../upstream/1.0.0/input/zero_float.kdl | 1 + .../upstream/1.0.0/input/zero_int.kdl | 1 + 399 files changed, 509 insertions(+), 95 deletions(-) create mode 100644 tests/test_documents/upstream/1.0.0/COPYING create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/all_escapes.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/all_node_fields.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/arg_and_prop_same_name.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/arg_false_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/arg_float_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/arg_hex_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/arg_null_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/arg_raw_string_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/arg_string_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/arg_true_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/arg_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/arg_zero_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/asterisk_in_block_comment.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/bare_emoji.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/binary.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/binary_trailing_underscore.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/binary_underscore.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/blank_arg_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/blank_node_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/blank_prop_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/block_comment.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/block_comment_after_node.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/block_comment_before_node.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/block_comment_before_node_no_space.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/block_comment_newline.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/boolean_arg.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/boolean_prop.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/commented_arg.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/commented_child.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/commented_line.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/commented_node.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/commented_prop.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/crlf_between_nodes.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/emoji.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/empty.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/empty_child.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/empty_child_different_lines.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/empty_child_same_line.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/empty_child_whitespace.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/empty_quoted_node_id.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/empty_quoted_prop_key.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/empty_string_arg.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/esc_newline_in_string.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/esc_unicode_in_string.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/escline.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/escline_line_comment.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/escline_node.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/false_prefix_in_bare_id.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/false_prefix_in_prop_key.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/hex.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/hex_int.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/hex_int_underscores.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/hex_leading_zero.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/int_multiple_underscore.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/just_block_comment.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/just_child.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/just_newline.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/just_node_id.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/just_space.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/leading_newline.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/leading_zero_binary.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/leading_zero_int.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/leading_zero_oct.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/multiline_comment.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/multiline_nodes.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/multiline_string.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/negative_exponent.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/negative_float.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/negative_int.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/nested_block_comment.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/nested_children.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/nested_comments.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/nested_multiline_block_comment.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/newline_between_nodes.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/newlines_in_block_comment.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/no_decimal_exponent.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/node_false.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/node_true.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/node_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/null_arg.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/null_prefix_in_bare_id.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/null_prefix_in_prop_key.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/null_prop.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/numeric_arg.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/numeric_prop.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/octal.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/only_cr.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/only_line_comment.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/only_line_comment_crlf.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/only_line_comment_newline.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/parse_all_arg_types.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/positive_exponent.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/positive_int.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/preserve_duplicate_nodes.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/preserve_node_order.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/prop_false_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/prop_float_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/prop_hex_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/prop_null_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/prop_raw_string_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/prop_string_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/prop_true_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/prop_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/prop_zero_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/quoted_arg_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/quoted_node_name.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/quoted_node_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/quoted_numeric.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/quoted_prop_name.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/quoted_prop_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/r_node.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/raw_arg_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/raw_node_name.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/raw_node_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/raw_prop_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/raw_string_arg.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/raw_string_backslash.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/raw_string_hash_no_esc.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/raw_string_just_backslash.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/raw_string_just_quote.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/raw_string_multiple_hash.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/raw_string_newline.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/raw_string_prop.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/raw_string_quote.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/repeated_arg.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/repeated_prop.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/same_args.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/same_name_nodes.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/sci_notation_large.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/sci_notation_small.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/semicolon_after_child.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/semicolon_in_child.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/semicolon_separated.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/semicolon_separated_nodes.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/semicolon_terminated.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/single_arg.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/single_prop.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_arg_after_newline_esc.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_arg_before_newline_esc.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_child.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_empty_child.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_full_node.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_in_slashdash.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_negative_number.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_node_in_child.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_node_with_child.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_only_node.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_only_node_with_space.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_prop.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_raw_prop_key.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_repeated_prop.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/string_arg.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/string_prop.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/tab_space.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/trailing_crlf.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/trailing_underscore_hex.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/trailing_underscore_octal.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/true_prefix_in_bare_id.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/true_prefix_in_prop_key.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/two_nodes.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/underscore_in_exponent.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/underscore_in_float.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/underscore_in_fraction.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/underscore_in_int.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/underscore_in_octal.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/unusual_bare_id_chars_in_quoted_id.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/unusual_chars_in_bare_id.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/zero_arg.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/zero_float.kdl create mode 100644 tests/test_documents/upstream/1.0.0/expected_kdl/zero_int.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/all_escapes.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/all_node_fields.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/arg_and_prop_same_name.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/arg_false_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/arg_float_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/arg_hex_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/arg_null_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/arg_raw_string_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/arg_string_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/arg_true_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/arg_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/arg_zero_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/asterisk_in_block_comment.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/backslash_in_bare_id.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/bare_arg.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/bare_emoji.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/binary.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/binary_trailing_underscore.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/binary_underscore.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/blank_arg_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/blank_node_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/blank_prop_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/block_comment.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/block_comment_after_node.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/block_comment_before_node.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/block_comment_before_node_no_space.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/block_comment_newline.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/boolean_arg.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/boolean_prop.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/brackets_in_bare_id.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/chevrons_in_bare_id.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/comma_in_bare_id.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/comment_after_arg_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/comment_after_node_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/comment_after_prop_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/comment_in_arg_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/comment_in_node_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/comment_in_prop_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/commented_arg.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/commented_child.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/commented_line.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/commented_node.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/commented_prop.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/crlf_between_nodes.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/dash_dash.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/dot_but_no_fraction.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/dot_but_no_fraction_before_exponent.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/dot_in_exponent.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/dot_zero.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/emoji.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/empty.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/empty_arg_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/empty_child.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/empty_child_different_lines.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/empty_child_same_line.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/empty_child_whitespace.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/empty_node_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/empty_prop_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/empty_quoted_node_id.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/empty_quoted_prop_key.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/empty_string_arg.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/esc_newline_in_string.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/esc_unicode_in_string.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/escline.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/escline_comment_node.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/escline_line_comment.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/escline_node.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/false_prefix_in_bare_id.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/false_prefix_in_prop_key.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/false_prop_key.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/hex.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/hex_int.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/hex_int_underscores.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/hex_leading_zero.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/illegal_char_in_binary.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/illegal_char_in_hex.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/illegal_char_in_octal.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/int_multiple_underscore.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/just_block_comment.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/just_child.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/just_newline.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/just_node_id.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/just_space.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/just_space_in_arg_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/just_space_in_node_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/just_space_in_prop_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/just_type_no_arg.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/just_type_no_node_id.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/just_type_no_prop.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/leading_newline.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/leading_zero_binary.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/leading_zero_int.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/leading_zero_oct.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/multiline_comment.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/multiline_nodes.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/multiline_string.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/multiple_dots_in_float.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/multiple_dots_in_float_before_exponent.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/multiple_es_in_float.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/multiple_x_in_hex.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/negative_exponent.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/negative_float.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/negative_int.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/nested_block_comment.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/nested_children.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/nested_comments.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/nested_multiline_block_comment.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/newline_between_nodes.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/newlines_in_block_comment.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/no_decimal_exponent.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/no_digits_in_hex.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/node_false.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/node_true.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/node_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/null_arg.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/null_prefix_in_bare_id.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/null_prefix_in_prop_key.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/null_prop.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/null_prop_key.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/numeric_arg.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/numeric_prop.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/octal.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/only_cr.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/only_line_comment.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/only_line_comment_crlf.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/only_line_comment_newline.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/parens_in_bare_id.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/parse_all_arg_types.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/positive_exponent.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/positive_int.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/preserve_duplicate_nodes.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/preserve_node_order.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/prop_false_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/prop_float_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/prop_hex_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/prop_null_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/prop_raw_string_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/prop_string_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/prop_true_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/prop_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/prop_zero_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/question_mark_at_start_of_int.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/question_mark_before_number.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/quote_in_bare_id.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/quoted_arg_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/quoted_node_name.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/quoted_node_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/quoted_numeric.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/quoted_prop_name.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/quoted_prop_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/r_node.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/raw_arg_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/raw_node_name.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/raw_node_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/raw_prop_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/raw_string_arg.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/raw_string_backslash.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/raw_string_hash_no_esc.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/raw_string_just_backslash.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/raw_string_just_quote.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/raw_string_multiple_hash.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/raw_string_newline.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/raw_string_prop.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/raw_string_quote.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/repeated_arg.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/repeated_prop.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/same_args.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/same_name_nodes.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/sci_notation_large.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/sci_notation_small.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/semicolon_after_child.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/semicolon_in_child.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/semicolon_separated.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/semicolon_separated_nodes.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/semicolon_terminated.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/single_arg.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/single_prop.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/slash_in_bare_id.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/slashdash_arg_after_newline_esc.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/slashdash_arg_before_newline_esc.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/slashdash_child.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/slashdash_empty_child.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/slashdash_full_node.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/slashdash_in_slashdash.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/slashdash_negative_number.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/slashdash_node_in_child.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/slashdash_node_with_child.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/slashdash_only_node.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/slashdash_only_node_with_space.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/slashdash_prop.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/slashdash_raw_prop_key.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/slashdash_repeated_prop.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/space_after_arg_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/space_after_node_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/space_after_prop_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/space_in_arg_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/space_in_node_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/space_in_prop_type.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/square_bracket_in_bare_id.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/string_arg.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/string_prop.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/tab_space.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/trailing_crlf.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/trailing_underscore_hex.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/trailing_underscore_octal.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/true_prefix_in_bare_id.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/true_prefix_in_prop_key.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/true_prop_key.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/two_nodes.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/type_before_prop_key.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/unbalanced_raw_hashes.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/underscore_at_start_of_fraction.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/underscore_at_start_of_hex.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/underscore_at_start_of_int.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/underscore_before_number.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/underscore_in_exponent.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/underscore_in_float.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/underscore_in_fraction.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/underscore_in_int.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/underscore_in_octal.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/unusual_bare_id_chars_in_quoted_id.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/unusual_chars_in_bare_id.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/zero_arg.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/zero_float.kdl create mode 100644 tests/test_documents/upstream/1.0.0/input/zero_int.kdl diff --git a/COPYING b/COPYING index 65b0d54..8c81747 100644 --- a/COPYING +++ b/COPYING @@ -1,4 +1,4 @@ -Copyright (c) 2022 Thomas Jollans +Copyright (c) 2022-2024 Thomas Jollans Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/include/kdl/parser.h b/include/kdl/parser.h index d169d85..f0bfbb9 100644 --- a/include/kdl/parser.h +++ b/include/kdl/parser.h @@ -28,7 +28,7 @@ enum kdl_parse_option { KDL_DEFAULTS = 0, // Nothing special KDL_EMIT_COMMENTS = 0x001, // Emit comments (default: don't) KDL_READ_VERSION_1 = 0x20000, // Use KDL version 1.0.0 - KDL_READ_VERSION_2 = 0x40000, // Use KDL version 2.0.0-draft.4 + KDL_READ_VERSION_2 = 0x40000, // Use KDL version 2.0.0-draft.5 KDL_DETECT_VERSION = 0x70000, // Allow both KDL v2 and KDL v1 }; diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 683133d..23c0b87 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -90,83 +90,6 @@ else() endif() endif() -# Download test data -set(DOWNLOAD_TEST_DATA ON CACHE BOOL "Download test data") - -if(NOT KDL_TEST_CASES_ROOT AND DOWNLOAD_TEST_DATA) - message(STATUS "Downloading KDL test cases from GitHub") - - set(KDL_GIT_URL "https://github.com/kdl-org/kdl.git") - set(KDL_TGZ_URL "https://github.com/kdl-org/kdl/archive/refs/heads/main.tar.gz") - find_package(Git) - - set(GIT_CHECKOUT_OK OFF) - if(Git_FOUND) - set(CHECKOUT "${CMAKE_CURRENT_BINARY_DIR}/kdl") - if(EXISTS "${CHECKOUT}/.git/HEAD") - # already cloned, do a pull - execute_process(COMMAND ${GIT_EXECUTABLE} -C "${CHECKOUT}" pull - RESULT_VARIABLE GIT_PULL_RESULT) - if(NOT GIT_PULL_RESULT EQUAL 0) - message(WARNING "git pull failed") - endif() - set(GIT_CHECKOUT_OK ON) - else() - execute_process(COMMAND ${GIT_EXECUTABLE} clone ${KDL_GIT_URL} "${CHECKOUT}" - RESULT_VARIABLE GIT_CLONE_RESULT) - if(GIT_CLONE_RESULT EQUAL 0) - set(GIT_CHECKOUT_OK ON) - else() - message(WARNING "git clone failed") - endif() - endif() - endif() - if(GIT_CHECKOUT_OK) - set(KDL_TEST_CASES_ROOT "${CHECKOUT}/tests/test_cases" CACHE PATH "kdl-org test cases location") - else() - set(DOWNLOAD_OK OFF) - set(TGZ_FILE ${CMAKE_CURRENT_BINARY_DIR}/kdl.tar.gz) - if(EXISTS ${TGZ_FILE}) - message(STATUS "${TGZ_FILE} already exists") - set(DOWNLOAD_OK ON) - else() - message(STATUS "Downloading ${KDL_TGZ_URL}") - file(DOWNLOAD ${KDL_TGZ_URL} ${TGZ_FILE}.dl STATUS DOWNLOAD_STATUS) - list(GET DOWNLOAD_STATUS 0 DOWNLOAD_STATUS_CODE) - if(DOWNLOAD_STATUS_CODE EQUAL 0) - file(RENAME ${TGZ_FILE}.dl ${TGZ_FILE}) - set(DOWNLOAD_OK ON) - else() - message(WARNING "Download failed: ${DOWNLOAD_STATUS}") - endif() - endif() - - if(DOWNLOAD_OK) - if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.18) - message(STATUS "Extracting ${TGZ_FILE}") - file(ARCHIVE_EXTRACT INPUT ${TGZ_FILE} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) - set(KDL_TEST_CASES_ROOT "${CMAKE_CURRENT_BINARY_DIR}/kdl-main/tests/test_cases" CACHE PATH "kdl-org test cases location") - else() - # Old version of CMake, try tar - find_program(TAR_EXECUTABLE tar) - if(TAR_EXECUTABLE STREQUAL TAR_EXECUTABLE-NOTFOUND) - message(WARNING "tar not found, can't extract test data") - else() - message(STATUS "Extracting ${TGZ_FILE} using ${TAR_EXECUTABLE}") - execute_process(COMMAND ${TAR_EXECUTABLE} xzf ${TGZ_FILE} - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - RESULT_VARIABLE EXTRACT_RESULT) - if(EXTRACT_RESULT EQUAL 0) - set(KDL_TEST_CASES_ROOT "${CMAKE_CURRENT_BINARY_DIR}/kdl-main/tests/test_cases" CACHE PATH "kdl-org test cases location") - else() - message(WARNING "Extracting test data failed") - endif() - endif() - endif() - endif() - endif() -endif() - add_library(test_util STATIC test_util.c fs_util.c) target_compile_options(test_util PUBLIC ${KDL_COMPILE_OPTIONS}) target_include_directories(test_util PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) @@ -187,22 +110,23 @@ add_executable(kdlv2_test kdlv2_test.c) target_link_libraries(kdlv2_test kdl test_util) add_test(kdlv2_test kdlv2_test) -if(KDL_TEST_CASES_ROOT) - # Ignore some tests which require unsupported number representations - set(FUZZY_KDL_TESTS_LIST - no_decimal_exponent.kdl # float representation not consistent with other test cases - ) - string(REPLACE ";" ":" FUZZY_KDL_TESTS "${FUZZY_KDL_TESTS_LIST}") - - add_executable(example_doc_test example_doc_test.c) - target_link_libraries(example_doc_test kdl test_util ckdl-cat) - target_compile_definitions(example_doc_test PRIVATE - "KDL_TEST_CASES_ROOT=\"${KDL_TEST_CASES_ROOT}\"" - "FUZZY_KDL_TESTS=\"${FUZZY_KDL_TESTS}\"") - add_test(NAME example_doc_test COMMAND "$" "${KDL_TEST_CASES_ROOT}") -else() - message(WARNING "Test data not available, not running KDL test suite.") -endif() +################################################# +# Upstream test suite for KDL version 1.0.0 +#### +set(KDL_TEST_CASES_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/test_documents/upstream/1.0.0) +# Ignore some tests which require unsupported number representations +set(FUZZY_KDL_TESTS_LIST + no_decimal_exponent.kdl # float representation not consistent with other test cases +) +string(REPLACE ";" ":" FUZZY_KDL_TESTS "${FUZZY_KDL_TESTS_LIST}") + +add_executable(example_doc_test example_doc_test.c) +target_link_libraries(example_doc_test kdl test_util ckdl-cat) +target_compile_definitions(example_doc_test PRIVATE + "KDL_TEST_CASES_ROOT=\"${KDL_TEST_CASES_ROOT}\"" + "FUZZY_KDL_TESTS=\"${FUZZY_KDL_TESTS}\"") +add_test(NAME example_doc_test COMMAND "$" "${KDL_TEST_CASES_ROOT}") +################################################# if (WIN32 AND BUILD_SHARED_LIBS) # Copy kdl.dll to the test folder so that the tests work diff --git a/tests/test_documents/upstream/1.0.0/COPYING b/tests/test_documents/upstream/1.0.0/COPYING new file mode 100644 index 0000000..94fcf2f --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/COPYING @@ -0,0 +1 @@ +The KDL version 1.0.0 test suite was taken from the https://github.com/kdl-org/kdl repository. It is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/all_escapes.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/all_escapes.kdl new file mode 100644 index 0000000..c25f434 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/all_escapes.kdl @@ -0,0 +1 @@ +node "\"\\/\b\f\n\r\t" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/all_node_fields.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/all_node_fields.kdl new file mode 100644 index 0000000..fc8a9e4 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/all_node_fields.kdl @@ -0,0 +1,3 @@ +node "arg" prop="val" { + inner_node +} diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/arg_and_prop_same_name.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/arg_and_prop_same_name.kdl new file mode 100644 index 0000000..27d9739 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/arg_and_prop_same_name.kdl @@ -0,0 +1 @@ +node "arg" arg="val" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/arg_false_type.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/arg_false_type.kdl new file mode 100644 index 0000000..895945d --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/arg_false_type.kdl @@ -0,0 +1 @@ +node (type)false diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/arg_float_type.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/arg_float_type.kdl new file mode 100644 index 0000000..d670786 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/arg_float_type.kdl @@ -0,0 +1 @@ +node (type)2.5 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/arg_hex_type.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/arg_hex_type.kdl new file mode 100644 index 0000000..b1a494a --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/arg_hex_type.kdl @@ -0,0 +1 @@ +node (type)16 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/arg_null_type.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/arg_null_type.kdl new file mode 100644 index 0000000..476c5cd --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/arg_null_type.kdl @@ -0,0 +1 @@ +node (type)null diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/arg_raw_string_type.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/arg_raw_string_type.kdl new file mode 100644 index 0000000..2808d53 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/arg_raw_string_type.kdl @@ -0,0 +1 @@ +node (type)"str" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/arg_string_type.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/arg_string_type.kdl new file mode 100644 index 0000000..2808d53 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/arg_string_type.kdl @@ -0,0 +1 @@ +node (type)"str" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/arg_true_type.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/arg_true_type.kdl new file mode 100644 index 0000000..6d1f9bc --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/arg_true_type.kdl @@ -0,0 +1 @@ +node (type)true diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/arg_type.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/arg_type.kdl new file mode 100644 index 0000000..a0b84cf --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/arg_type.kdl @@ -0,0 +1 @@ +node (type)"arg" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/arg_zero_type.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/arg_zero_type.kdl new file mode 100644 index 0000000..73b2702 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/arg_zero_type.kdl @@ -0,0 +1 @@ +node (type)0 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/asterisk_in_block_comment.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/asterisk_in_block_comment.kdl new file mode 100644 index 0000000..64f5a0a --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/asterisk_in_block_comment.kdl @@ -0,0 +1 @@ +node diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/bare_emoji.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/bare_emoji.kdl new file mode 100644 index 0000000..60707c8 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/bare_emoji.kdl @@ -0,0 +1 @@ +😁 "happy!" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/binary.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/binary.kdl new file mode 100644 index 0000000..d14213e --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/binary.kdl @@ -0,0 +1 @@ +node 2 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/binary_trailing_underscore.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/binary_trailing_underscore.kdl new file mode 100644 index 0000000..d14213e --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/binary_trailing_underscore.kdl @@ -0,0 +1 @@ +node 2 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/binary_underscore.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/binary_underscore.kdl new file mode 100644 index 0000000..d14213e --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/binary_underscore.kdl @@ -0,0 +1 @@ +node 2 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/blank_arg_type.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/blank_arg_type.kdl new file mode 100644 index 0000000..8c6fb21 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/blank_arg_type.kdl @@ -0,0 +1 @@ +node ("")10 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/blank_node_type.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/blank_node_type.kdl new file mode 100644 index 0000000..6b064a6 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/blank_node_type.kdl @@ -0,0 +1 @@ +("")node diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/blank_prop_type.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/blank_prop_type.kdl new file mode 100644 index 0000000..c7b0e31 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/blank_prop_type.kdl @@ -0,0 +1 @@ +node key=("")true diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/block_comment.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/block_comment.kdl new file mode 100644 index 0000000..b3a0426 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/block_comment.kdl @@ -0,0 +1 @@ +node "arg" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/block_comment_after_node.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/block_comment_after_node.kdl new file mode 100644 index 0000000..b3a0426 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/block_comment_after_node.kdl @@ -0,0 +1 @@ +node "arg" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/block_comment_before_node.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/block_comment_before_node.kdl new file mode 100644 index 0000000..64f5a0a --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/block_comment_before_node.kdl @@ -0,0 +1 @@ +node diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/block_comment_before_node_no_space.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/block_comment_before_node_no_space.kdl new file mode 100644 index 0000000..64f5a0a --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/block_comment_before_node_no_space.kdl @@ -0,0 +1 @@ +node diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/block_comment_newline.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/block_comment_newline.kdl new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/block_comment_newline.kdl @@ -0,0 +1 @@ + diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/boolean_arg.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/boolean_arg.kdl new file mode 100644 index 0000000..9c7928e --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/boolean_arg.kdl @@ -0,0 +1 @@ +node false true diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/boolean_prop.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/boolean_prop.kdl new file mode 100644 index 0000000..712b60b --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/boolean_prop.kdl @@ -0,0 +1 @@ +node prop1=true prop2=false diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/commented_arg.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/commented_arg.kdl new file mode 100644 index 0000000..226fd56 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/commented_arg.kdl @@ -0,0 +1 @@ +node "arg2" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/commented_child.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/commented_child.kdl new file mode 100644 index 0000000..b3a0426 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/commented_child.kdl @@ -0,0 +1 @@ +node "arg" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/commented_line.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/commented_line.kdl new file mode 100644 index 0000000..2fa08cd --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/commented_line.kdl @@ -0,0 +1 @@ +node_2 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/commented_node.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/commented_node.kdl new file mode 100644 index 0000000..2fa08cd --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/commented_node.kdl @@ -0,0 +1 @@ +node_2 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/commented_prop.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/commented_prop.kdl new file mode 100644 index 0000000..b3a0426 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/commented_prop.kdl @@ -0,0 +1 @@ +node "arg" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/crlf_between_nodes.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/crlf_between_nodes.kdl new file mode 100644 index 0000000..1c5b5f3 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/crlf_between_nodes.kdl @@ -0,0 +1,2 @@ +node1 +node2 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/emoji.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/emoji.kdl new file mode 100644 index 0000000..3ed56e2 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/emoji.kdl @@ -0,0 +1 @@ +node "😀" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/empty.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/empty.kdl new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/empty.kdl @@ -0,0 +1 @@ + diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/empty_child.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/empty_child.kdl new file mode 100644 index 0000000..64f5a0a --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/empty_child.kdl @@ -0,0 +1 @@ +node diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/empty_child_different_lines.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/empty_child_different_lines.kdl new file mode 100644 index 0000000..64f5a0a --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/empty_child_different_lines.kdl @@ -0,0 +1 @@ +node diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/empty_child_same_line.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/empty_child_same_line.kdl new file mode 100644 index 0000000..64f5a0a --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/empty_child_same_line.kdl @@ -0,0 +1 @@ +node diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/empty_child_whitespace.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/empty_child_whitespace.kdl new file mode 100644 index 0000000..64f5a0a --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/empty_child_whitespace.kdl @@ -0,0 +1 @@ +node diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/empty_quoted_node_id.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/empty_quoted_node_id.kdl new file mode 100644 index 0000000..ebfa893 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/empty_quoted_node_id.kdl @@ -0,0 +1 @@ +"" "arg" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/empty_quoted_prop_key.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/empty_quoted_prop_key.kdl new file mode 100644 index 0000000..e6e1310 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/empty_quoted_prop_key.kdl @@ -0,0 +1 @@ +node ""="empty" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/empty_string_arg.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/empty_string_arg.kdl new file mode 100644 index 0000000..8ade134 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/empty_string_arg.kdl @@ -0,0 +1 @@ +node "" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/esc_newline_in_string.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/esc_newline_in_string.kdl new file mode 100644 index 0000000..fd38cb0 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/esc_newline_in_string.kdl @@ -0,0 +1 @@ +node "hello\nworld" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/esc_unicode_in_string.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/esc_unicode_in_string.kdl new file mode 100644 index 0000000..fd38cb0 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/esc_unicode_in_string.kdl @@ -0,0 +1 @@ +node "hello\nworld" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/escline.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/escline.kdl new file mode 100644 index 0000000..b3a0426 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/escline.kdl @@ -0,0 +1 @@ +node "arg" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/escline_line_comment.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/escline_line_comment.kdl new file mode 100644 index 0000000..8a5dc33 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/escline_line_comment.kdl @@ -0,0 +1 @@ +node "arg" "arg2\n" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/escline_node.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/escline_node.kdl new file mode 100644 index 0000000..1c5b5f3 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/escline_node.kdl @@ -0,0 +1,2 @@ +node1 +node2 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/false_prefix_in_bare_id.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/false_prefix_in_bare_id.kdl new file mode 100644 index 0000000..cd962c4 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/false_prefix_in_bare_id.kdl @@ -0,0 +1 @@ +false_id diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/false_prefix_in_prop_key.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/false_prefix_in_prop_key.kdl new file mode 100644 index 0000000..2d29843 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/false_prefix_in_prop_key.kdl @@ -0,0 +1 @@ +node false_id=1 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/hex.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/hex.kdl new file mode 100644 index 0000000..bcbc7ff --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/hex.kdl @@ -0,0 +1 @@ +node 12379813812177893520 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/hex_int.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/hex_int.kdl new file mode 100644 index 0000000..f8dcee1 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/hex_int.kdl @@ -0,0 +1 @@ +node 207698809136909011942886895 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/hex_int_underscores.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/hex_int_underscores.kdl new file mode 100644 index 0000000..78f3ce0 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/hex_int_underscores.kdl @@ -0,0 +1 @@ +node 737894400291 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/hex_leading_zero.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/hex_leading_zero.kdl new file mode 100644 index 0000000..d20bd7d --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/hex_leading_zero.kdl @@ -0,0 +1 @@ +node 1 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/int_multiple_underscore.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/int_multiple_underscore.kdl new file mode 100644 index 0000000..37cf4bf --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/int_multiple_underscore.kdl @@ -0,0 +1 @@ +node 1234 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/just_block_comment.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/just_block_comment.kdl new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/just_block_comment.kdl @@ -0,0 +1 @@ + diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/just_child.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/just_child.kdl new file mode 100644 index 0000000..ee79536 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/just_child.kdl @@ -0,0 +1,3 @@ +node { + inner_node +} diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/just_newline.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/just_newline.kdl new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/just_newline.kdl @@ -0,0 +1 @@ + diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/just_node_id.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/just_node_id.kdl new file mode 100644 index 0000000..64f5a0a --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/just_node_id.kdl @@ -0,0 +1 @@ +node diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/just_space.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/just_space.kdl new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/just_space.kdl @@ -0,0 +1 @@ + diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/leading_newline.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/leading_newline.kdl new file mode 100644 index 0000000..64f5a0a --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/leading_newline.kdl @@ -0,0 +1 @@ +node diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/leading_zero_binary.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/leading_zero_binary.kdl new file mode 100644 index 0000000..d20bd7d --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/leading_zero_binary.kdl @@ -0,0 +1 @@ +node 1 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/leading_zero_int.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/leading_zero_int.kdl new file mode 100644 index 0000000..0526c15 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/leading_zero_int.kdl @@ -0,0 +1 @@ +node 11 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/leading_zero_oct.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/leading_zero_oct.kdl new file mode 100644 index 0000000..d20bd7d --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/leading_zero_oct.kdl @@ -0,0 +1 @@ +node 1 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/multiline_comment.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/multiline_comment.kdl new file mode 100644 index 0000000..b3a0426 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/multiline_comment.kdl @@ -0,0 +1 @@ +node "arg" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/multiline_nodes.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/multiline_nodes.kdl new file mode 100644 index 0000000..bec6d05 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/multiline_nodes.kdl @@ -0,0 +1 @@ +node "arg1" "arg2" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/multiline_string.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/multiline_string.kdl new file mode 100644 index 0000000..021493e --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/multiline_string.kdl @@ -0,0 +1 @@ +node " hey\neveryone\nhow goes?\n" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/negative_exponent.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/negative_exponent.kdl new file mode 100644 index 0000000..aae8926 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/negative_exponent.kdl @@ -0,0 +1 @@ +node 1.0E-10 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/negative_float.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/negative_float.kdl new file mode 100644 index 0000000..c6a4cc5 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/negative_float.kdl @@ -0,0 +1 @@ +node -1.0 key=-10.0 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/negative_int.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/negative_int.kdl new file mode 100644 index 0000000..269da03 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/negative_int.kdl @@ -0,0 +1 @@ +node -10 prop=-15 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/nested_block_comment.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/nested_block_comment.kdl new file mode 100644 index 0000000..b3a0426 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/nested_block_comment.kdl @@ -0,0 +1 @@ +node "arg" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/nested_children.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/nested_children.kdl new file mode 100644 index 0000000..e44720d --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/nested_children.kdl @@ -0,0 +1,5 @@ +node1 { + node2 { + node + } +} diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/nested_comments.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/nested_comments.kdl new file mode 100644 index 0000000..b3a0426 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/nested_comments.kdl @@ -0,0 +1 @@ +node "arg" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/nested_multiline_block_comment.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/nested_multiline_block_comment.kdl new file mode 100644 index 0000000..b3a0426 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/nested_multiline_block_comment.kdl @@ -0,0 +1 @@ +node "arg" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/newline_between_nodes.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/newline_between_nodes.kdl new file mode 100644 index 0000000..1c5b5f3 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/newline_between_nodes.kdl @@ -0,0 +1,2 @@ +node1 +node2 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/newlines_in_block_comment.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/newlines_in_block_comment.kdl new file mode 100644 index 0000000..b3a0426 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/newlines_in_block_comment.kdl @@ -0,0 +1 @@ +node "arg" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/no_decimal_exponent.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/no_decimal_exponent.kdl new file mode 100644 index 0000000..ddf1aa6 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/no_decimal_exponent.kdl @@ -0,0 +1 @@ +node 1E+10 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/node_false.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/node_false.kdl new file mode 100644 index 0000000..ef60c44 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/node_false.kdl @@ -0,0 +1 @@ +node false diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/node_true.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/node_true.kdl new file mode 100644 index 0000000..4b02a06 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/node_true.kdl @@ -0,0 +1 @@ +node true diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/node_type.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/node_type.kdl new file mode 100644 index 0000000..c790643 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/node_type.kdl @@ -0,0 +1 @@ +(type)node diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/null_arg.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/null_arg.kdl new file mode 100644 index 0000000..c0e6cb5 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/null_arg.kdl @@ -0,0 +1 @@ +node null diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/null_prefix_in_bare_id.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/null_prefix_in_bare_id.kdl new file mode 100644 index 0000000..9e0cf15 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/null_prefix_in_bare_id.kdl @@ -0,0 +1 @@ +null_id diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/null_prefix_in_prop_key.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/null_prefix_in_prop_key.kdl new file mode 100644 index 0000000..1e1472b --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/null_prefix_in_prop_key.kdl @@ -0,0 +1 @@ +node null_id=1 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/null_prop.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/null_prop.kdl new file mode 100644 index 0000000..85ef005 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/null_prop.kdl @@ -0,0 +1 @@ +node prop=null diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/numeric_arg.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/numeric_arg.kdl new file mode 100644 index 0000000..33bfe55 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/numeric_arg.kdl @@ -0,0 +1 @@ +node 15.7 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/numeric_prop.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/numeric_prop.kdl new file mode 100644 index 0000000..934ae83 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/numeric_prop.kdl @@ -0,0 +1 @@ +node prop=10.0 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/octal.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/octal.kdl new file mode 100644 index 0000000..225217b --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/octal.kdl @@ -0,0 +1 @@ +node 16434824 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/only_cr.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/only_cr.kdl new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/only_cr.kdl @@ -0,0 +1 @@ + diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/only_line_comment.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/only_line_comment.kdl new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/only_line_comment.kdl @@ -0,0 +1 @@ + diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/only_line_comment_crlf.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/only_line_comment_crlf.kdl new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/only_line_comment_crlf.kdl @@ -0,0 +1 @@ + diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/only_line_comment_newline.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/only_line_comment_newline.kdl new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/only_line_comment_newline.kdl @@ -0,0 +1 @@ + diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/parse_all_arg_types.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/parse_all_arg_types.kdl new file mode 100644 index 0000000..2e8552c --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/parse_all_arg_types.kdl @@ -0,0 +1 @@ +node 1 1.0 1.0E+10 1.0E-10 1 7 2 "arg" "arg\\\\" true false null diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/positive_exponent.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/positive_exponent.kdl new file mode 100644 index 0000000..46dc2b9 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/positive_exponent.kdl @@ -0,0 +1 @@ +node 1.0E+10 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/positive_int.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/positive_int.kdl new file mode 100644 index 0000000..5b622c0 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/positive_int.kdl @@ -0,0 +1 @@ +node 10 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/preserve_duplicate_nodes.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/preserve_duplicate_nodes.kdl new file mode 100644 index 0000000..3e545b1 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/preserve_duplicate_nodes.kdl @@ -0,0 +1,2 @@ +node +node diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/preserve_node_order.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/preserve_node_order.kdl new file mode 100644 index 0000000..24c817f --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/preserve_node_order.kdl @@ -0,0 +1,3 @@ +node2 +node5 +node1 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/prop_false_type.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/prop_false_type.kdl new file mode 100644 index 0000000..3377323 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/prop_false_type.kdl @@ -0,0 +1 @@ +node key=(type)false diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/prop_float_type.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/prop_float_type.kdl new file mode 100644 index 0000000..79243ec --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/prop_float_type.kdl @@ -0,0 +1 @@ +node key=(type)2.5E+10 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/prop_hex_type.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/prop_hex_type.kdl new file mode 100644 index 0000000..05bef6f --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/prop_hex_type.kdl @@ -0,0 +1 @@ +node key=(type)16 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/prop_null_type.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/prop_null_type.kdl new file mode 100644 index 0000000..bafaddc --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/prop_null_type.kdl @@ -0,0 +1 @@ +node key=(type)null diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/prop_raw_string_type.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/prop_raw_string_type.kdl new file mode 100644 index 0000000..50e2d2c --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/prop_raw_string_type.kdl @@ -0,0 +1 @@ +node key=(type)"str" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/prop_string_type.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/prop_string_type.kdl new file mode 100644 index 0000000..50e2d2c --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/prop_string_type.kdl @@ -0,0 +1 @@ +node key=(type)"str" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/prop_true_type.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/prop_true_type.kdl new file mode 100644 index 0000000..c4eebb6 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/prop_true_type.kdl @@ -0,0 +1 @@ +node key=(type)true diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/prop_type.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/prop_type.kdl new file mode 100644 index 0000000..c4eebb6 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/prop_type.kdl @@ -0,0 +1 @@ +node key=(type)true diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/prop_zero_type.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/prop_zero_type.kdl new file mode 100644 index 0000000..ad243ed --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/prop_zero_type.kdl @@ -0,0 +1 @@ +node key=(type)0 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/quoted_arg_type.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/quoted_arg_type.kdl new file mode 100644 index 0000000..49ffc6a --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/quoted_arg_type.kdl @@ -0,0 +1 @@ +node ("type/")10 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/quoted_node_name.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/quoted_node_name.kdl new file mode 100644 index 0000000..672e7ff --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/quoted_node_name.kdl @@ -0,0 +1 @@ +"0node" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/quoted_node_type.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/quoted_node_type.kdl new file mode 100644 index 0000000..c66d905 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/quoted_node_type.kdl @@ -0,0 +1 @@ +("type/")node diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/quoted_numeric.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/quoted_numeric.kdl new file mode 100644 index 0000000..fa0ed33 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/quoted_numeric.kdl @@ -0,0 +1 @@ +node prop="10.0" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/quoted_prop_name.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/quoted_prop_name.kdl new file mode 100644 index 0000000..170a05a --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/quoted_prop_name.kdl @@ -0,0 +1 @@ +node "0prop"="val" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/quoted_prop_type.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/quoted_prop_type.kdl new file mode 100644 index 0000000..0e2b920 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/quoted_prop_type.kdl @@ -0,0 +1 @@ +node key=("type/")true diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/r_node.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/r_node.kdl new file mode 100644 index 0000000..4a98807 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/r_node.kdl @@ -0,0 +1 @@ +r "arg" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/raw_arg_type.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/raw_arg_type.kdl new file mode 100644 index 0000000..6d1f9bc --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/raw_arg_type.kdl @@ -0,0 +1 @@ +node (type)true diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/raw_node_name.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/raw_node_name.kdl new file mode 100644 index 0000000..984061e --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/raw_node_name.kdl @@ -0,0 +1 @@ +"\\node" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/raw_node_type.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/raw_node_type.kdl new file mode 100644 index 0000000..c790643 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/raw_node_type.kdl @@ -0,0 +1 @@ +(type)node diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/raw_prop_type.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/raw_prop_type.kdl new file mode 100644 index 0000000..c4eebb6 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/raw_prop_type.kdl @@ -0,0 +1 @@ +node key=(type)true diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/raw_string_arg.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/raw_string_arg.kdl new file mode 100644 index 0000000..a909993 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/raw_string_arg.kdl @@ -0,0 +1,3 @@ +node_1 "arg\\n" +node_2 "\"arg\\n\"and stuff" +node_3 "#\"arg\\n\"#and stuff" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/raw_string_backslash.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/raw_string_backslash.kdl new file mode 100644 index 0000000..551cf10 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/raw_string_backslash.kdl @@ -0,0 +1 @@ +node "\\n" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/raw_string_hash_no_esc.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/raw_string_hash_no_esc.kdl new file mode 100644 index 0000000..9964729 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/raw_string_hash_no_esc.kdl @@ -0,0 +1 @@ +node "#" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/raw_string_just_backslash.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/raw_string_just_backslash.kdl new file mode 100644 index 0000000..5702080 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/raw_string_just_backslash.kdl @@ -0,0 +1 @@ +node "\\" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/raw_string_just_quote.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/raw_string_just_quote.kdl new file mode 100644 index 0000000..0a76315 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/raw_string_just_quote.kdl @@ -0,0 +1 @@ +node "\"" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/raw_string_multiple_hash.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/raw_string_multiple_hash.kdl new file mode 100644 index 0000000..1ba63d1 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/raw_string_multiple_hash.kdl @@ -0,0 +1 @@ +node "\"#\"##" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/raw_string_newline.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/raw_string_newline.kdl new file mode 100644 index 0000000..d738029 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/raw_string_newline.kdl @@ -0,0 +1 @@ +node "\nhello\nworld\n" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/raw_string_prop.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/raw_string_prop.kdl new file mode 100644 index 0000000..0762d88 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/raw_string_prop.kdl @@ -0,0 +1,3 @@ +node_1 prop="arg\\n" +node_2 prop="\"arg\"\\n" +node_3 prop="#\"arg\"#\\n" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/raw_string_quote.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/raw_string_quote.kdl new file mode 100644 index 0000000..d59edb6 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/raw_string_quote.kdl @@ -0,0 +1 @@ +node "a\"b" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/repeated_arg.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/repeated_arg.kdl new file mode 100644 index 0000000..849fee0 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/repeated_arg.kdl @@ -0,0 +1 @@ +node "arg" "arg" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/repeated_prop.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/repeated_prop.kdl new file mode 100644 index 0000000..46c9236 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/repeated_prop.kdl @@ -0,0 +1 @@ +node prop=11 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/same_args.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/same_args.kdl new file mode 100644 index 0000000..6b8ae13 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/same_args.kdl @@ -0,0 +1 @@ +node "whee" "whee" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/same_name_nodes.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/same_name_nodes.kdl new file mode 100644 index 0000000..3e545b1 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/same_name_nodes.kdl @@ -0,0 +1,2 @@ +node +node diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/sci_notation_large.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/sci_notation_large.kdl new file mode 100644 index 0000000..7fbb60d --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/sci_notation_large.kdl @@ -0,0 +1 @@ +node prop=1.23E+1000 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/sci_notation_small.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/sci_notation_small.kdl new file mode 100644 index 0000000..5bd062c --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/sci_notation_small.kdl @@ -0,0 +1 @@ +node prop=1.23E-1000 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/semicolon_after_child.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/semicolon_after_child.kdl new file mode 100644 index 0000000..e3346f1 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/semicolon_after_child.kdl @@ -0,0 +1,3 @@ +node { + childnode +} diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/semicolon_in_child.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/semicolon_in_child.kdl new file mode 100644 index 0000000..9d8395e --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/semicolon_in_child.kdl @@ -0,0 +1,3 @@ +node1 { + node2 +} diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/semicolon_separated.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/semicolon_separated.kdl new file mode 100644 index 0000000..1c5b5f3 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/semicolon_separated.kdl @@ -0,0 +1,2 @@ +node1 +node2 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/semicolon_separated_nodes.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/semicolon_separated_nodes.kdl new file mode 100644 index 0000000..1c5b5f3 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/semicolon_separated_nodes.kdl @@ -0,0 +1,2 @@ +node1 +node2 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/semicolon_terminated.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/semicolon_terminated.kdl new file mode 100644 index 0000000..f50c4f2 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/semicolon_terminated.kdl @@ -0,0 +1 @@ +node1 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/single_arg.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/single_arg.kdl new file mode 100644 index 0000000..b3a0426 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/single_arg.kdl @@ -0,0 +1 @@ +node "arg" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/single_prop.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/single_prop.kdl new file mode 100644 index 0000000..a0d0062 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/single_prop.kdl @@ -0,0 +1 @@ +node prop="val" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_arg_after_newline_esc.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_arg_after_newline_esc.kdl new file mode 100644 index 0000000..226fd56 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_arg_after_newline_esc.kdl @@ -0,0 +1 @@ +node "arg2" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_arg_before_newline_esc.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_arg_before_newline_esc.kdl new file mode 100644 index 0000000..64f5a0a --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_arg_before_newline_esc.kdl @@ -0,0 +1 @@ +node diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_child.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_child.kdl new file mode 100644 index 0000000..64f5a0a --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_child.kdl @@ -0,0 +1 @@ +node diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_empty_child.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_empty_child.kdl new file mode 100644 index 0000000..64f5a0a --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_empty_child.kdl @@ -0,0 +1 @@ +node diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_full_node.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_full_node.kdl new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_full_node.kdl @@ -0,0 +1 @@ + diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_in_slashdash.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_in_slashdash.kdl new file mode 100644 index 0000000..6810417 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_in_slashdash.kdl @@ -0,0 +1 @@ +node2 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_negative_number.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_negative_number.kdl new file mode 100644 index 0000000..b76b862 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_negative_number.kdl @@ -0,0 +1 @@ +node 2.0 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_node_in_child.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_node_in_child.kdl new file mode 100644 index 0000000..f50c4f2 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_node_in_child.kdl @@ -0,0 +1 @@ +node1 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_node_with_child.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_node_with_child.kdl new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_node_with_child.kdl @@ -0,0 +1 @@ + diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_only_node.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_only_node.kdl new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_only_node.kdl @@ -0,0 +1 @@ + diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_only_node_with_space.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_only_node_with_space.kdl new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_only_node_with_space.kdl @@ -0,0 +1 @@ + diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_prop.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_prop.kdl new file mode 100644 index 0000000..b3a0426 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_prop.kdl @@ -0,0 +1 @@ +node "arg" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_raw_prop_key.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_raw_prop_key.kdl new file mode 100644 index 0000000..64f5a0a --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_raw_prop_key.kdl @@ -0,0 +1 @@ +node diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_repeated_prop.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_repeated_prop.kdl new file mode 100644 index 0000000..82c6972 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/slashdash_repeated_prop.kdl @@ -0,0 +1 @@ +node arg="correct" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/string_arg.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/string_arg.kdl new file mode 100644 index 0000000..b3a0426 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/string_arg.kdl @@ -0,0 +1 @@ +node "arg" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/string_prop.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/string_prop.kdl new file mode 100644 index 0000000..a0d0062 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/string_prop.kdl @@ -0,0 +1 @@ +node prop="val" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/tab_space.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/tab_space.kdl new file mode 100644 index 0000000..64f5a0a --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/tab_space.kdl @@ -0,0 +1 @@ +node diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/trailing_crlf.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/trailing_crlf.kdl new file mode 100644 index 0000000..64f5a0a --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/trailing_crlf.kdl @@ -0,0 +1 @@ +node diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/trailing_underscore_hex.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/trailing_underscore_hex.kdl new file mode 100644 index 0000000..f426d4d --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/trailing_underscore_hex.kdl @@ -0,0 +1 @@ +node 1194684 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/trailing_underscore_octal.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/trailing_underscore_octal.kdl new file mode 100644 index 0000000..9152a92 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/trailing_underscore_octal.kdl @@ -0,0 +1 @@ +node 83 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/true_prefix_in_bare_id.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/true_prefix_in_bare_id.kdl new file mode 100644 index 0000000..49c9d0d --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/true_prefix_in_bare_id.kdl @@ -0,0 +1 @@ +true_id diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/true_prefix_in_prop_key.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/true_prefix_in_prop_key.kdl new file mode 100644 index 0000000..2af7a1c --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/true_prefix_in_prop_key.kdl @@ -0,0 +1 @@ +node true_id=1 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/two_nodes.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/two_nodes.kdl new file mode 100644 index 0000000..1c5b5f3 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/two_nodes.kdl @@ -0,0 +1,2 @@ +node1 +node2 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/underscore_in_exponent.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/underscore_in_exponent.kdl new file mode 100644 index 0000000..a5b975d --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/underscore_in_exponent.kdl @@ -0,0 +1 @@ +node 1.0E-100 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/underscore_in_float.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/underscore_in_float.kdl new file mode 100644 index 0000000..6aafd1c --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/underscore_in_float.kdl @@ -0,0 +1 @@ +node 11.0 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/underscore_in_fraction.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/underscore_in_fraction.kdl new file mode 100644 index 0000000..29bb938 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/underscore_in_fraction.kdl @@ -0,0 +1 @@ +node 1.02 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/underscore_in_int.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/underscore_in_int.kdl new file mode 100644 index 0000000..5b622c0 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/underscore_in_int.kdl @@ -0,0 +1 @@ +node 10 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/underscore_in_octal.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/underscore_in_octal.kdl new file mode 100644 index 0000000..f4f6039 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/underscore_in_octal.kdl @@ -0,0 +1 @@ +node 342391 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/unusual_bare_id_chars_in_quoted_id.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/unusual_bare_id_chars_in_quoted_id.kdl new file mode 100644 index 0000000..d2dcd19 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/unusual_bare_id_chars_in_quoted_id.kdl @@ -0,0 +1 @@ +foo123~!@#$%^&*.:'|?+ "weeee" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/unusual_chars_in_bare_id.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/unusual_chars_in_bare_id.kdl new file mode 100644 index 0000000..d2dcd19 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/unusual_chars_in_bare_id.kdl @@ -0,0 +1 @@ +foo123~!@#$%^&*.:'|?+ "weeee" diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/zero_arg.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/zero_arg.kdl new file mode 100644 index 0000000..74405b6 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/zero_arg.kdl @@ -0,0 +1 @@ +node 0 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/zero_float.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/zero_float.kdl new file mode 100644 index 0000000..fd5b1f1 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/zero_float.kdl @@ -0,0 +1 @@ +node 0.0 diff --git a/tests/test_documents/upstream/1.0.0/expected_kdl/zero_int.kdl b/tests/test_documents/upstream/1.0.0/expected_kdl/zero_int.kdl new file mode 100644 index 0000000..74405b6 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/expected_kdl/zero_int.kdl @@ -0,0 +1 @@ +node 0 diff --git a/tests/test_documents/upstream/1.0.0/input/all_escapes.kdl b/tests/test_documents/upstream/1.0.0/input/all_escapes.kdl new file mode 100644 index 0000000..5bb1dc3 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/all_escapes.kdl @@ -0,0 +1 @@ +node "\"\\\/\b\f\n\r\t" diff --git a/tests/test_documents/upstream/1.0.0/input/all_node_fields.kdl b/tests/test_documents/upstream/1.0.0/input/all_node_fields.kdl new file mode 100644 index 0000000..719a8d1 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/all_node_fields.kdl @@ -0,0 +1,3 @@ +node "arg" prop="val" { + inner_node +} \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/arg_and_prop_same_name.kdl b/tests/test_documents/upstream/1.0.0/input/arg_and_prop_same_name.kdl new file mode 100644 index 0000000..b830f56 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/arg_and_prop_same_name.kdl @@ -0,0 +1 @@ +node "arg" arg="val" \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/arg_false_type.kdl b/tests/test_documents/upstream/1.0.0/input/arg_false_type.kdl new file mode 100644 index 0000000..895945d --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/arg_false_type.kdl @@ -0,0 +1 @@ +node (type)false diff --git a/tests/test_documents/upstream/1.0.0/input/arg_float_type.kdl b/tests/test_documents/upstream/1.0.0/input/arg_float_type.kdl new file mode 100644 index 0000000..fd6947e --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/arg_float_type.kdl @@ -0,0 +1 @@ +node (type)2.5 \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/arg_hex_type.kdl b/tests/test_documents/upstream/1.0.0/input/arg_hex_type.kdl new file mode 100644 index 0000000..ec44f6c --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/arg_hex_type.kdl @@ -0,0 +1 @@ +node (type)0x10 diff --git a/tests/test_documents/upstream/1.0.0/input/arg_null_type.kdl b/tests/test_documents/upstream/1.0.0/input/arg_null_type.kdl new file mode 100644 index 0000000..476c5cd --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/arg_null_type.kdl @@ -0,0 +1 @@ +node (type)null diff --git a/tests/test_documents/upstream/1.0.0/input/arg_raw_string_type.kdl b/tests/test_documents/upstream/1.0.0/input/arg_raw_string_type.kdl new file mode 100644 index 0000000..2808d53 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/arg_raw_string_type.kdl @@ -0,0 +1 @@ +node (type)"str" diff --git a/tests/test_documents/upstream/1.0.0/input/arg_string_type.kdl b/tests/test_documents/upstream/1.0.0/input/arg_string_type.kdl new file mode 100644 index 0000000..1a141b2 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/arg_string_type.kdl @@ -0,0 +1 @@ +node (type)"str" \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/arg_true_type.kdl b/tests/test_documents/upstream/1.0.0/input/arg_true_type.kdl new file mode 100644 index 0000000..6d1f9bc --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/arg_true_type.kdl @@ -0,0 +1 @@ +node (type)true diff --git a/tests/test_documents/upstream/1.0.0/input/arg_type.kdl b/tests/test_documents/upstream/1.0.0/input/arg_type.kdl new file mode 100644 index 0000000..a0b84cf --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/arg_type.kdl @@ -0,0 +1 @@ +node (type)"arg" diff --git a/tests/test_documents/upstream/1.0.0/input/arg_zero_type.kdl b/tests/test_documents/upstream/1.0.0/input/arg_zero_type.kdl new file mode 100644 index 0000000..73b2702 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/arg_zero_type.kdl @@ -0,0 +1 @@ +node (type)0 diff --git a/tests/test_documents/upstream/1.0.0/input/asterisk_in_block_comment.kdl b/tests/test_documents/upstream/1.0.0/input/asterisk_in_block_comment.kdl new file mode 100644 index 0000000..46ec76f --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/asterisk_in_block_comment.kdl @@ -0,0 +1 @@ +node /* * */ \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/backslash_in_bare_id.kdl b/tests/test_documents/upstream/1.0.0/input/backslash_in_bare_id.kdl new file mode 100644 index 0000000..5615277 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/backslash_in_bare_id.kdl @@ -0,0 +1 @@ +foo123\bar "weeee" diff --git a/tests/test_documents/upstream/1.0.0/input/bare_arg.kdl b/tests/test_documents/upstream/1.0.0/input/bare_arg.kdl new file mode 100644 index 0000000..ec2a21f --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/bare_arg.kdl @@ -0,0 +1 @@ +node a \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/bare_emoji.kdl b/tests/test_documents/upstream/1.0.0/input/bare_emoji.kdl new file mode 100644 index 0000000..60707c8 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/bare_emoji.kdl @@ -0,0 +1 @@ +😁 "happy!" diff --git a/tests/test_documents/upstream/1.0.0/input/binary.kdl b/tests/test_documents/upstream/1.0.0/input/binary.kdl new file mode 100644 index 0000000..bf12920 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/binary.kdl @@ -0,0 +1 @@ +node 0b10 \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/binary_trailing_underscore.kdl b/tests/test_documents/upstream/1.0.0/input/binary_trailing_underscore.kdl new file mode 100644 index 0000000..6da7588 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/binary_trailing_underscore.kdl @@ -0,0 +1 @@ +node 0b10_ \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/binary_underscore.kdl b/tests/test_documents/upstream/1.0.0/input/binary_underscore.kdl new file mode 100644 index 0000000..c914517 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/binary_underscore.kdl @@ -0,0 +1 @@ +node 0b1_0 diff --git a/tests/test_documents/upstream/1.0.0/input/blank_arg_type.kdl b/tests/test_documents/upstream/1.0.0/input/blank_arg_type.kdl new file mode 100644 index 0000000..0b298e6 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/blank_arg_type.kdl @@ -0,0 +1 @@ +node ("")10 \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/blank_node_type.kdl b/tests/test_documents/upstream/1.0.0/input/blank_node_type.kdl new file mode 100644 index 0000000..6b064a6 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/blank_node_type.kdl @@ -0,0 +1 @@ +("")node diff --git a/tests/test_documents/upstream/1.0.0/input/blank_prop_type.kdl b/tests/test_documents/upstream/1.0.0/input/blank_prop_type.kdl new file mode 100644 index 0000000..898f90d --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/blank_prop_type.kdl @@ -0,0 +1 @@ +node key=("")true \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/block_comment.kdl b/tests/test_documents/upstream/1.0.0/input/block_comment.kdl new file mode 100644 index 0000000..e6eddb9 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/block_comment.kdl @@ -0,0 +1 @@ +node /* comment */ "arg" \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/block_comment_after_node.kdl b/tests/test_documents/upstream/1.0.0/input/block_comment_after_node.kdl new file mode 100644 index 0000000..e7777ed --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/block_comment_after_node.kdl @@ -0,0 +1 @@ +node /* hey */ "arg" diff --git a/tests/test_documents/upstream/1.0.0/input/block_comment_before_node.kdl b/tests/test_documents/upstream/1.0.0/input/block_comment_before_node.kdl new file mode 100644 index 0000000..5ad653e --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/block_comment_before_node.kdl @@ -0,0 +1 @@ +/* hey */ node \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/block_comment_before_node_no_space.kdl b/tests/test_documents/upstream/1.0.0/input/block_comment_before_node_no_space.kdl new file mode 100644 index 0000000..1221234 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/block_comment_before_node_no_space.kdl @@ -0,0 +1 @@ +/* hey*/node diff --git a/tests/test_documents/upstream/1.0.0/input/block_comment_newline.kdl b/tests/test_documents/upstream/1.0.0/input/block_comment_newline.kdl new file mode 100644 index 0000000..14ac75d --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/block_comment_newline.kdl @@ -0,0 +1 @@ +/* hey */ diff --git a/tests/test_documents/upstream/1.0.0/input/boolean_arg.kdl b/tests/test_documents/upstream/1.0.0/input/boolean_arg.kdl new file mode 100644 index 0000000..f099893 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/boolean_arg.kdl @@ -0,0 +1 @@ +node false true \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/boolean_prop.kdl b/tests/test_documents/upstream/1.0.0/input/boolean_prop.kdl new file mode 100644 index 0000000..61e3111 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/boolean_prop.kdl @@ -0,0 +1 @@ +node prop1=true prop2=false \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/brackets_in_bare_id.kdl b/tests/test_documents/upstream/1.0.0/input/brackets_in_bare_id.kdl new file mode 100644 index 0000000..b0d39c5 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/brackets_in_bare_id.kdl @@ -0,0 +1 @@ +foo123{bar}foo "weeee" diff --git a/tests/test_documents/upstream/1.0.0/input/chevrons_in_bare_id.kdl b/tests/test_documents/upstream/1.0.0/input/chevrons_in_bare_id.kdl new file mode 100644 index 0000000..4b6610e --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/chevrons_in_bare_id.kdl @@ -0,0 +1 @@ +foo123foo "weeee" diff --git a/tests/test_documents/upstream/1.0.0/input/comma_in_bare_id.kdl b/tests/test_documents/upstream/1.0.0/input/comma_in_bare_id.kdl new file mode 100644 index 0000000..656df91 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/comma_in_bare_id.kdl @@ -0,0 +1 @@ +foo123,bar "weeee" diff --git a/tests/test_documents/upstream/1.0.0/input/comment_after_arg_type.kdl b/tests/test_documents/upstream/1.0.0/input/comment_after_arg_type.kdl new file mode 100644 index 0000000..f88b7c1 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/comment_after_arg_type.kdl @@ -0,0 +1 @@ +node (type)/*huh*/10 diff --git a/tests/test_documents/upstream/1.0.0/input/comment_after_node_type.kdl b/tests/test_documents/upstream/1.0.0/input/comment_after_node_type.kdl new file mode 100644 index 0000000..55ab980 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/comment_after_node_type.kdl @@ -0,0 +1 @@ +(type)/*huh*/node diff --git a/tests/test_documents/upstream/1.0.0/input/comment_after_prop_type.kdl b/tests/test_documents/upstream/1.0.0/input/comment_after_prop_type.kdl new file mode 100644 index 0000000..c9b1858 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/comment_after_prop_type.kdl @@ -0,0 +1 @@ +node key=(type)/*huh*/10 diff --git a/tests/test_documents/upstream/1.0.0/input/comment_in_arg_type.kdl b/tests/test_documents/upstream/1.0.0/input/comment_in_arg_type.kdl new file mode 100644 index 0000000..39742ac --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/comment_in_arg_type.kdl @@ -0,0 +1 @@ +node (type/*huh*/)10 diff --git a/tests/test_documents/upstream/1.0.0/input/comment_in_node_type.kdl b/tests/test_documents/upstream/1.0.0/input/comment_in_node_type.kdl new file mode 100644 index 0000000..8cda2e5 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/comment_in_node_type.kdl @@ -0,0 +1 @@ +(type/*huh*/)node diff --git a/tests/test_documents/upstream/1.0.0/input/comment_in_prop_type.kdl b/tests/test_documents/upstream/1.0.0/input/comment_in_prop_type.kdl new file mode 100644 index 0000000..10adb3b --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/comment_in_prop_type.kdl @@ -0,0 +1 @@ +node key=(type/*huh*/)10 diff --git a/tests/test_documents/upstream/1.0.0/input/commented_arg.kdl b/tests/test_documents/upstream/1.0.0/input/commented_arg.kdl new file mode 100644 index 0000000..e389cd2 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/commented_arg.kdl @@ -0,0 +1 @@ +node /- "arg1" "arg2" \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/commented_child.kdl b/tests/test_documents/upstream/1.0.0/input/commented_child.kdl new file mode 100644 index 0000000..e13c479 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/commented_child.kdl @@ -0,0 +1,3 @@ +node "arg" /- { + inner_node +} \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/commented_line.kdl b/tests/test_documents/upstream/1.0.0/input/commented_line.kdl new file mode 100644 index 0000000..bc8582c --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/commented_line.kdl @@ -0,0 +1,2 @@ +// node_1 +node_2 \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/commented_node.kdl b/tests/test_documents/upstream/1.0.0/input/commented_node.kdl new file mode 100644 index 0000000..c9e5d12 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/commented_node.kdl @@ -0,0 +1,2 @@ +/- node_1 +node_2 diff --git a/tests/test_documents/upstream/1.0.0/input/commented_prop.kdl b/tests/test_documents/upstream/1.0.0/input/commented_prop.kdl new file mode 100644 index 0000000..acedc83 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/commented_prop.kdl @@ -0,0 +1 @@ +node /- prop="val" "arg" \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/crlf_between_nodes.kdl b/tests/test_documents/upstream/1.0.0/input/crlf_between_nodes.kdl new file mode 100644 index 0000000..4d9cb21 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/crlf_between_nodes.kdl @@ -0,0 +1,2 @@ +node1 +node2 \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/dash_dash.kdl b/tests/test_documents/upstream/1.0.0/input/dash_dash.kdl new file mode 100644 index 0000000..759ddc5 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/dash_dash.kdl @@ -0,0 +1 @@ +node -- \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/dot_but_no_fraction.kdl b/tests/test_documents/upstream/1.0.0/input/dot_but_no_fraction.kdl new file mode 100644 index 0000000..48553fc --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/dot_but_no_fraction.kdl @@ -0,0 +1 @@ +node 1. \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/dot_but_no_fraction_before_exponent.kdl b/tests/test_documents/upstream/1.0.0/input/dot_but_no_fraction_before_exponent.kdl new file mode 100644 index 0000000..8fb8fb8 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/dot_but_no_fraction_before_exponent.kdl @@ -0,0 +1 @@ +node 1.e7 \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/dot_in_exponent.kdl b/tests/test_documents/upstream/1.0.0/input/dot_in_exponent.kdl new file mode 100644 index 0000000..fab0d78 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/dot_in_exponent.kdl @@ -0,0 +1 @@ +node 1.0.0 \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/dot_zero.kdl b/tests/test_documents/upstream/1.0.0/input/dot_zero.kdl new file mode 100644 index 0000000..e8c0592 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/dot_zero.kdl @@ -0,0 +1 @@ +node .0 \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/emoji.kdl b/tests/test_documents/upstream/1.0.0/input/emoji.kdl new file mode 100644 index 0000000..3ed56e2 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/emoji.kdl @@ -0,0 +1 @@ +node "😀" diff --git a/tests/test_documents/upstream/1.0.0/input/empty.kdl b/tests/test_documents/upstream/1.0.0/input/empty.kdl new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_documents/upstream/1.0.0/input/empty_arg_type.kdl b/tests/test_documents/upstream/1.0.0/input/empty_arg_type.kdl new file mode 100644 index 0000000..bf22b6d --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/empty_arg_type.kdl @@ -0,0 +1 @@ +node ()10 diff --git a/tests/test_documents/upstream/1.0.0/input/empty_child.kdl b/tests/test_documents/upstream/1.0.0/input/empty_child.kdl new file mode 100644 index 0000000..be1cc03 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/empty_child.kdl @@ -0,0 +1,2 @@ +node { +} \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/empty_child_different_lines.kdl b/tests/test_documents/upstream/1.0.0/input/empty_child_different_lines.kdl new file mode 100644 index 0000000..be1cc03 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/empty_child_different_lines.kdl @@ -0,0 +1,2 @@ +node { +} \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/empty_child_same_line.kdl b/tests/test_documents/upstream/1.0.0/input/empty_child_same_line.kdl new file mode 100644 index 0000000..efba1b1 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/empty_child_same_line.kdl @@ -0,0 +1 @@ +node {} \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/empty_child_whitespace.kdl b/tests/test_documents/upstream/1.0.0/input/empty_child_whitespace.kdl new file mode 100644 index 0000000..405df30 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/empty_child_whitespace.kdl @@ -0,0 +1,3 @@ +node { + + } \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/empty_node_type.kdl b/tests/test_documents/upstream/1.0.0/input/empty_node_type.kdl new file mode 100644 index 0000000..e4163c0 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/empty_node_type.kdl @@ -0,0 +1 @@ +()node diff --git a/tests/test_documents/upstream/1.0.0/input/empty_prop_type.kdl b/tests/test_documents/upstream/1.0.0/input/empty_prop_type.kdl new file mode 100644 index 0000000..0515094 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/empty_prop_type.kdl @@ -0,0 +1 @@ +node key=()false diff --git a/tests/test_documents/upstream/1.0.0/input/empty_quoted_node_id.kdl b/tests/test_documents/upstream/1.0.0/input/empty_quoted_node_id.kdl new file mode 100644 index 0000000..2aeb594 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/empty_quoted_node_id.kdl @@ -0,0 +1 @@ +"" "arg" \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/empty_quoted_prop_key.kdl b/tests/test_documents/upstream/1.0.0/input/empty_quoted_prop_key.kdl new file mode 100644 index 0000000..e6e1310 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/empty_quoted_prop_key.kdl @@ -0,0 +1 @@ +node ""="empty" diff --git a/tests/test_documents/upstream/1.0.0/input/empty_string_arg.kdl b/tests/test_documents/upstream/1.0.0/input/empty_string_arg.kdl new file mode 100644 index 0000000..8ade134 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/empty_string_arg.kdl @@ -0,0 +1 @@ +node "" diff --git a/tests/test_documents/upstream/1.0.0/input/esc_newline_in_string.kdl b/tests/test_documents/upstream/1.0.0/input/esc_newline_in_string.kdl new file mode 100644 index 0000000..393ee37 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/esc_newline_in_string.kdl @@ -0,0 +1 @@ +node "hello\nworld" \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/esc_unicode_in_string.kdl b/tests/test_documents/upstream/1.0.0/input/esc_unicode_in_string.kdl new file mode 100644 index 0000000..285ed9c --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/esc_unicode_in_string.kdl @@ -0,0 +1 @@ +node "hello\u{0a}world" diff --git a/tests/test_documents/upstream/1.0.0/input/escline.kdl b/tests/test_documents/upstream/1.0.0/input/escline.kdl new file mode 100644 index 0000000..9010e07 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/escline.kdl @@ -0,0 +1,2 @@ +node \ + "arg" \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/escline_comment_node.kdl b/tests/test_documents/upstream/1.0.0/input/escline_comment_node.kdl new file mode 100644 index 0000000..030c245 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/escline_comment_node.kdl @@ -0,0 +1,3 @@ +node1 + \// hey + node2 \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/escline_line_comment.kdl b/tests/test_documents/upstream/1.0.0/input/escline_line_comment.kdl new file mode 100644 index 0000000..31f19fd --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/escline_line_comment.kdl @@ -0,0 +1,4 @@ +node \ // comment + "arg" \// comment + "arg2 +" \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/escline_node.kdl b/tests/test_documents/upstream/1.0.0/input/escline_node.kdl new file mode 100644 index 0000000..1c5b5f3 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/escline_node.kdl @@ -0,0 +1,2 @@ +node1 +node2 diff --git a/tests/test_documents/upstream/1.0.0/input/false_prefix_in_bare_id.kdl b/tests/test_documents/upstream/1.0.0/input/false_prefix_in_bare_id.kdl new file mode 100644 index 0000000..cd962c4 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/false_prefix_in_bare_id.kdl @@ -0,0 +1 @@ +false_id diff --git a/tests/test_documents/upstream/1.0.0/input/false_prefix_in_prop_key.kdl b/tests/test_documents/upstream/1.0.0/input/false_prefix_in_prop_key.kdl new file mode 100644 index 0000000..2d29843 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/false_prefix_in_prop_key.kdl @@ -0,0 +1 @@ +node false_id=1 diff --git a/tests/test_documents/upstream/1.0.0/input/false_prop_key.kdl b/tests/test_documents/upstream/1.0.0/input/false_prop_key.kdl new file mode 100644 index 0000000..a032c0b --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/false_prop_key.kdl @@ -0,0 +1 @@ +node false=1 diff --git a/tests/test_documents/upstream/1.0.0/input/hex.kdl b/tests/test_documents/upstream/1.0.0/input/hex.kdl new file mode 100644 index 0000000..ec764dd --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/hex.kdl @@ -0,0 +1 @@ +node 0xabcdef1234567890 \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/hex_int.kdl b/tests/test_documents/upstream/1.0.0/input/hex_int.kdl new file mode 100644 index 0000000..c2f421a --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/hex_int.kdl @@ -0,0 +1 @@ +node 0xABCDEF0123456789abcdef diff --git a/tests/test_documents/upstream/1.0.0/input/hex_int_underscores.kdl b/tests/test_documents/upstream/1.0.0/input/hex_int_underscores.kdl new file mode 100644 index 0000000..8b7bd68 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/hex_int_underscores.kdl @@ -0,0 +1 @@ +node 0xABC_def_0123 \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/hex_leading_zero.kdl b/tests/test_documents/upstream/1.0.0/input/hex_leading_zero.kdl new file mode 100644 index 0000000..b2c98d0 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/hex_leading_zero.kdl @@ -0,0 +1 @@ +node 0x01 \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/illegal_char_in_binary.kdl b/tests/test_documents/upstream/1.0.0/input/illegal_char_in_binary.kdl new file mode 100644 index 0000000..1f4bd50 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/illegal_char_in_binary.kdl @@ -0,0 +1 @@ +node 0bx01 diff --git a/tests/test_documents/upstream/1.0.0/input/illegal_char_in_hex.kdl b/tests/test_documents/upstream/1.0.0/input/illegal_char_in_hex.kdl new file mode 100644 index 0000000..b55e1a6 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/illegal_char_in_hex.kdl @@ -0,0 +1 @@ +node 0x10g10 \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/illegal_char_in_octal.kdl b/tests/test_documents/upstream/1.0.0/input/illegal_char_in_octal.kdl new file mode 100644 index 0000000..4e36196 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/illegal_char_in_octal.kdl @@ -0,0 +1 @@ +node 0o45678 \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/int_multiple_underscore.kdl b/tests/test_documents/upstream/1.0.0/input/int_multiple_underscore.kdl new file mode 100644 index 0000000..04ded62 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/int_multiple_underscore.kdl @@ -0,0 +1 @@ +node 1_2_3_4 \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/just_block_comment.kdl b/tests/test_documents/upstream/1.0.0/input/just_block_comment.kdl new file mode 100644 index 0000000..4015df6 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/just_block_comment.kdl @@ -0,0 +1 @@ +/* hey */ \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/just_child.kdl b/tests/test_documents/upstream/1.0.0/input/just_child.kdl new file mode 100644 index 0000000..444022e --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/just_child.kdl @@ -0,0 +1,3 @@ +node { + inner_node +} \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/just_newline.kdl b/tests/test_documents/upstream/1.0.0/input/just_newline.kdl new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/just_newline.kdl @@ -0,0 +1 @@ + diff --git a/tests/test_documents/upstream/1.0.0/input/just_node_id.kdl b/tests/test_documents/upstream/1.0.0/input/just_node_id.kdl new file mode 100644 index 0000000..32b6e49 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/just_node_id.kdl @@ -0,0 +1 @@ +node \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/just_space.kdl b/tests/test_documents/upstream/1.0.0/input/just_space.kdl new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/just_space.kdl @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/just_space_in_arg_type.kdl b/tests/test_documents/upstream/1.0.0/input/just_space_in_arg_type.kdl new file mode 100644 index 0000000..38c9217 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/just_space_in_arg_type.kdl @@ -0,0 +1 @@ +node ( )false diff --git a/tests/test_documents/upstream/1.0.0/input/just_space_in_node_type.kdl b/tests/test_documents/upstream/1.0.0/input/just_space_in_node_type.kdl new file mode 100644 index 0000000..8fb5d89 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/just_space_in_node_type.kdl @@ -0,0 +1 @@ +( )node diff --git a/tests/test_documents/upstream/1.0.0/input/just_space_in_prop_type.kdl b/tests/test_documents/upstream/1.0.0/input/just_space_in_prop_type.kdl new file mode 100644 index 0000000..a00603c --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/just_space_in_prop_type.kdl @@ -0,0 +1 @@ +node key=()0x10 diff --git a/tests/test_documents/upstream/1.0.0/input/just_type_no_arg.kdl b/tests/test_documents/upstream/1.0.0/input/just_type_no_arg.kdl new file mode 100644 index 0000000..a36c881 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/just_type_no_arg.kdl @@ -0,0 +1 @@ +node (type) diff --git a/tests/test_documents/upstream/1.0.0/input/just_type_no_node_id.kdl b/tests/test_documents/upstream/1.0.0/input/just_type_no_node_id.kdl new file mode 100644 index 0000000..9b03c44 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/just_type_no_node_id.kdl @@ -0,0 +1 @@ +(type) diff --git a/tests/test_documents/upstream/1.0.0/input/just_type_no_prop.kdl b/tests/test_documents/upstream/1.0.0/input/just_type_no_prop.kdl new file mode 100644 index 0000000..eab7fc6 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/just_type_no_prop.kdl @@ -0,0 +1 @@ +node key=(type) diff --git a/tests/test_documents/upstream/1.0.0/input/leading_newline.kdl b/tests/test_documents/upstream/1.0.0/input/leading_newline.kdl new file mode 100644 index 0000000..fce4a83 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/leading_newline.kdl @@ -0,0 +1,2 @@ + +node \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/leading_zero_binary.kdl b/tests/test_documents/upstream/1.0.0/input/leading_zero_binary.kdl new file mode 100644 index 0000000..fa8209d --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/leading_zero_binary.kdl @@ -0,0 +1 @@ +node 0b01 diff --git a/tests/test_documents/upstream/1.0.0/input/leading_zero_int.kdl b/tests/test_documents/upstream/1.0.0/input/leading_zero_int.kdl new file mode 100644 index 0000000..b4e520a --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/leading_zero_int.kdl @@ -0,0 +1 @@ +node 011 diff --git a/tests/test_documents/upstream/1.0.0/input/leading_zero_oct.kdl b/tests/test_documents/upstream/1.0.0/input/leading_zero_oct.kdl new file mode 100644 index 0000000..d0eb382 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/leading_zero_oct.kdl @@ -0,0 +1 @@ +node 0o01 diff --git a/tests/test_documents/upstream/1.0.0/input/multiline_comment.kdl b/tests/test_documents/upstream/1.0.0/input/multiline_comment.kdl new file mode 100644 index 0000000..26485bc --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/multiline_comment.kdl @@ -0,0 +1,4 @@ +node /* +some +comments +*/ "arg" \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/multiline_nodes.kdl b/tests/test_documents/upstream/1.0.0/input/multiline_nodes.kdl new file mode 100644 index 0000000..3dc907e --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/multiline_nodes.kdl @@ -0,0 +1,3 @@ +node \ + "arg1" \// comment + "arg2" \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/multiline_string.kdl b/tests/test_documents/upstream/1.0.0/input/multiline_string.kdl new file mode 100644 index 0000000..603cddd --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/multiline_string.kdl @@ -0,0 +1,4 @@ +node " hey +everyone +how goes? +" \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/multiple_dots_in_float.kdl b/tests/test_documents/upstream/1.0.0/input/multiple_dots_in_float.kdl new file mode 100644 index 0000000..fab0d78 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/multiple_dots_in_float.kdl @@ -0,0 +1 @@ +node 1.0.0 \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/multiple_dots_in_float_before_exponent.kdl b/tests/test_documents/upstream/1.0.0/input/multiple_dots_in_float_before_exponent.kdl new file mode 100644 index 0000000..434af05 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/multiple_dots_in_float_before_exponent.kdl @@ -0,0 +1 @@ +node 1.0.0e7 \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/multiple_es_in_float.kdl b/tests/test_documents/upstream/1.0.0/input/multiple_es_in_float.kdl new file mode 100644 index 0000000..6506c5c --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/multiple_es_in_float.kdl @@ -0,0 +1 @@ +node 1.0E10e10 diff --git a/tests/test_documents/upstream/1.0.0/input/multiple_x_in_hex.kdl b/tests/test_documents/upstream/1.0.0/input/multiple_x_in_hex.kdl new file mode 100644 index 0000000..013d805 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/multiple_x_in_hex.kdl @@ -0,0 +1 @@ +node 0xx10 \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/negative_exponent.kdl b/tests/test_documents/upstream/1.0.0/input/negative_exponent.kdl new file mode 100644 index 0000000..6790669 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/negative_exponent.kdl @@ -0,0 +1 @@ +node 1.0e-10 \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/negative_float.kdl b/tests/test_documents/upstream/1.0.0/input/negative_float.kdl new file mode 100644 index 0000000..5536e1f --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/negative_float.kdl @@ -0,0 +1 @@ +node -1.0 key=-10.0 \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/negative_int.kdl b/tests/test_documents/upstream/1.0.0/input/negative_int.kdl new file mode 100644 index 0000000..c71a208 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/negative_int.kdl @@ -0,0 +1 @@ +node -10 prop=-15 \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/nested_block_comment.kdl b/tests/test_documents/upstream/1.0.0/input/nested_block_comment.kdl new file mode 100644 index 0000000..d7f765c --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/nested_block_comment.kdl @@ -0,0 +1 @@ +node /* hi /* there */ everyone */ "arg" \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/nested_children.kdl b/tests/test_documents/upstream/1.0.0/input/nested_children.kdl new file mode 100644 index 0000000..40d2742 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/nested_children.kdl @@ -0,0 +1,5 @@ +node1 { + node2 { + node + } +} \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/nested_comments.kdl b/tests/test_documents/upstream/1.0.0/input/nested_comments.kdl new file mode 100644 index 0000000..8b3aad6 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/nested_comments.kdl @@ -0,0 +1 @@ +node /*/* nested */*/ "arg" \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/nested_multiline_block_comment.kdl b/tests/test_documents/upstream/1.0.0/input/nested_multiline_block_comment.kdl new file mode 100644 index 0000000..9d8e0ca --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/nested_multiline_block_comment.kdl @@ -0,0 +1,7 @@ +node /* +hey /* +how's +*/ + it going + */ "arg" + \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/newline_between_nodes.kdl b/tests/test_documents/upstream/1.0.0/input/newline_between_nodes.kdl new file mode 100644 index 0000000..1c5b5f3 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/newline_between_nodes.kdl @@ -0,0 +1,2 @@ +node1 +node2 diff --git a/tests/test_documents/upstream/1.0.0/input/newlines_in_block_comment.kdl b/tests/test_documents/upstream/1.0.0/input/newlines_in_block_comment.kdl new file mode 100644 index 0000000..a5cd2b1 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/newlines_in_block_comment.kdl @@ -0,0 +1,3 @@ +node /* hey so +I was thinking +about newts */ "arg" \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/no_decimal_exponent.kdl b/tests/test_documents/upstream/1.0.0/input/no_decimal_exponent.kdl new file mode 100644 index 0000000..6dc6c6a --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/no_decimal_exponent.kdl @@ -0,0 +1 @@ +node 1e10 \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/no_digits_in_hex.kdl b/tests/test_documents/upstream/1.0.0/input/no_digits_in_hex.kdl new file mode 100644 index 0000000..700e453 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/no_digits_in_hex.kdl @@ -0,0 +1 @@ +node 0x \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/node_false.kdl b/tests/test_documents/upstream/1.0.0/input/node_false.kdl new file mode 100644 index 0000000..ef60c44 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/node_false.kdl @@ -0,0 +1 @@ +node false diff --git a/tests/test_documents/upstream/1.0.0/input/node_true.kdl b/tests/test_documents/upstream/1.0.0/input/node_true.kdl new file mode 100644 index 0000000..4b02a06 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/node_true.kdl @@ -0,0 +1 @@ +node true diff --git a/tests/test_documents/upstream/1.0.0/input/node_type.kdl b/tests/test_documents/upstream/1.0.0/input/node_type.kdl new file mode 100644 index 0000000..72b265d --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/node_type.kdl @@ -0,0 +1 @@ +(type)node \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/null_arg.kdl b/tests/test_documents/upstream/1.0.0/input/null_arg.kdl new file mode 100644 index 0000000..a5ce001 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/null_arg.kdl @@ -0,0 +1 @@ +node null \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/null_prefix_in_bare_id.kdl b/tests/test_documents/upstream/1.0.0/input/null_prefix_in_bare_id.kdl new file mode 100644 index 0000000..9e0cf15 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/null_prefix_in_bare_id.kdl @@ -0,0 +1 @@ +null_id diff --git a/tests/test_documents/upstream/1.0.0/input/null_prefix_in_prop_key.kdl b/tests/test_documents/upstream/1.0.0/input/null_prefix_in_prop_key.kdl new file mode 100644 index 0000000..1e1472b --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/null_prefix_in_prop_key.kdl @@ -0,0 +1 @@ +node null_id=1 diff --git a/tests/test_documents/upstream/1.0.0/input/null_prop.kdl b/tests/test_documents/upstream/1.0.0/input/null_prop.kdl new file mode 100644 index 0000000..847256f --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/null_prop.kdl @@ -0,0 +1 @@ +node prop=null \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/null_prop_key.kdl b/tests/test_documents/upstream/1.0.0/input/null_prop_key.kdl new file mode 100644 index 0000000..6896d42 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/null_prop_key.kdl @@ -0,0 +1 @@ +node null=1 diff --git a/tests/test_documents/upstream/1.0.0/input/numeric_arg.kdl b/tests/test_documents/upstream/1.0.0/input/numeric_arg.kdl new file mode 100644 index 0000000..23a6fbe --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/numeric_arg.kdl @@ -0,0 +1 @@ +node 15.7 \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/numeric_prop.kdl b/tests/test_documents/upstream/1.0.0/input/numeric_prop.kdl new file mode 100644 index 0000000..0cf22bf --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/numeric_prop.kdl @@ -0,0 +1 @@ +node prop=10.0 \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/octal.kdl b/tests/test_documents/upstream/1.0.0/input/octal.kdl new file mode 100644 index 0000000..9674d51 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/octal.kdl @@ -0,0 +1 @@ +node 0o76543210 \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/only_cr.kdl b/tests/test_documents/upstream/1.0.0/input/only_cr.kdl new file mode 100644 index 0000000..67c3297 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/only_cr.kdl @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/only_line_comment.kdl b/tests/test_documents/upstream/1.0.0/input/only_line_comment.kdl new file mode 100644 index 0000000..edc7a22 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/only_line_comment.kdl @@ -0,0 +1 @@ +// hi \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/only_line_comment_crlf.kdl b/tests/test_documents/upstream/1.0.0/input/only_line_comment_crlf.kdl new file mode 100644 index 0000000..fef83a9 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/only_line_comment_crlf.kdl @@ -0,0 +1 @@ +// comment diff --git a/tests/test_documents/upstream/1.0.0/input/only_line_comment_newline.kdl b/tests/test_documents/upstream/1.0.0/input/only_line_comment_newline.kdl new file mode 100644 index 0000000..faba1e1 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/only_line_comment_newline.kdl @@ -0,0 +1 @@ +// hiiii diff --git a/tests/test_documents/upstream/1.0.0/input/parens_in_bare_id.kdl b/tests/test_documents/upstream/1.0.0/input/parens_in_bare_id.kdl new file mode 100644 index 0000000..92459d8 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/parens_in_bare_id.kdl @@ -0,0 +1 @@ +foo123(bar)foo "weeee" diff --git a/tests/test_documents/upstream/1.0.0/input/parse_all_arg_types.kdl b/tests/test_documents/upstream/1.0.0/input/parse_all_arg_types.kdl new file mode 100644 index 0000000..30b9072 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/parse_all_arg_types.kdl @@ -0,0 +1 @@ +node 1 1.0 1.0e10 1.0e-10 0x01 0o07 0b10 "arg" r"arg\\" true false null \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/positive_exponent.kdl b/tests/test_documents/upstream/1.0.0/input/positive_exponent.kdl new file mode 100644 index 0000000..1eaa4b8 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/positive_exponent.kdl @@ -0,0 +1 @@ +node 1.0e+10 \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/positive_int.kdl b/tests/test_documents/upstream/1.0.0/input/positive_int.kdl new file mode 100644 index 0000000..d57df8a --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/positive_int.kdl @@ -0,0 +1 @@ +node +10 \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/preserve_duplicate_nodes.kdl b/tests/test_documents/upstream/1.0.0/input/preserve_duplicate_nodes.kdl new file mode 100644 index 0000000..3e545b1 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/preserve_duplicate_nodes.kdl @@ -0,0 +1,2 @@ +node +node diff --git a/tests/test_documents/upstream/1.0.0/input/preserve_node_order.kdl b/tests/test_documents/upstream/1.0.0/input/preserve_node_order.kdl new file mode 100644 index 0000000..5c36850 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/preserve_node_order.kdl @@ -0,0 +1,3 @@ +node2 +node5 +node1 \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/prop_false_type.kdl b/tests/test_documents/upstream/1.0.0/input/prop_false_type.kdl new file mode 100644 index 0000000..3377323 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/prop_false_type.kdl @@ -0,0 +1 @@ +node key=(type)false diff --git a/tests/test_documents/upstream/1.0.0/input/prop_float_type.kdl b/tests/test_documents/upstream/1.0.0/input/prop_float_type.kdl new file mode 100644 index 0000000..c1c2095 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/prop_float_type.kdl @@ -0,0 +1 @@ +node key=(type)2.5E10 diff --git a/tests/test_documents/upstream/1.0.0/input/prop_hex_type.kdl b/tests/test_documents/upstream/1.0.0/input/prop_hex_type.kdl new file mode 100644 index 0000000..d819d6a --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/prop_hex_type.kdl @@ -0,0 +1 @@ +node key=(type)0x10 diff --git a/tests/test_documents/upstream/1.0.0/input/prop_null_type.kdl b/tests/test_documents/upstream/1.0.0/input/prop_null_type.kdl new file mode 100644 index 0000000..bafaddc --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/prop_null_type.kdl @@ -0,0 +1 @@ +node key=(type)null diff --git a/tests/test_documents/upstream/1.0.0/input/prop_raw_string_type.kdl b/tests/test_documents/upstream/1.0.0/input/prop_raw_string_type.kdl new file mode 100644 index 0000000..a038cfa --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/prop_raw_string_type.kdl @@ -0,0 +1 @@ +node key=(type)r"str" diff --git a/tests/test_documents/upstream/1.0.0/input/prop_string_type.kdl b/tests/test_documents/upstream/1.0.0/input/prop_string_type.kdl new file mode 100644 index 0000000..50e2d2c --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/prop_string_type.kdl @@ -0,0 +1 @@ +node key=(type)"str" diff --git a/tests/test_documents/upstream/1.0.0/input/prop_true_type.kdl b/tests/test_documents/upstream/1.0.0/input/prop_true_type.kdl new file mode 100644 index 0000000..c4eebb6 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/prop_true_type.kdl @@ -0,0 +1 @@ +node key=(type)true diff --git a/tests/test_documents/upstream/1.0.0/input/prop_type.kdl b/tests/test_documents/upstream/1.0.0/input/prop_type.kdl new file mode 100644 index 0000000..d69294f --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/prop_type.kdl @@ -0,0 +1 @@ +node key=(type)true \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/prop_zero_type.kdl b/tests/test_documents/upstream/1.0.0/input/prop_zero_type.kdl new file mode 100644 index 0000000..ad243ed --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/prop_zero_type.kdl @@ -0,0 +1 @@ +node key=(type)0 diff --git a/tests/test_documents/upstream/1.0.0/input/question_mark_at_start_of_int.kdl b/tests/test_documents/upstream/1.0.0/input/question_mark_at_start_of_int.kdl new file mode 100644 index 0000000..ba82916 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/question_mark_at_start_of_int.kdl @@ -0,0 +1 @@ +node ?10 \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/question_mark_before_number.kdl b/tests/test_documents/upstream/1.0.0/input/question_mark_before_number.kdl new file mode 100644 index 0000000..532ef22 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/question_mark_before_number.kdl @@ -0,0 +1 @@ +node ?15 \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/quote_in_bare_id.kdl b/tests/test_documents/upstream/1.0.0/input/quote_in_bare_id.kdl new file mode 100644 index 0000000..405f763 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/quote_in_bare_id.kdl @@ -0,0 +1 @@ +foo123"bar "weeee" diff --git a/tests/test_documents/upstream/1.0.0/input/quoted_arg_type.kdl b/tests/test_documents/upstream/1.0.0/input/quoted_arg_type.kdl new file mode 100644 index 0000000..95c94c1 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/quoted_arg_type.kdl @@ -0,0 +1 @@ +node ("type/")10 \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/quoted_node_name.kdl b/tests/test_documents/upstream/1.0.0/input/quoted_node_name.kdl new file mode 100644 index 0000000..e76d593 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/quoted_node_name.kdl @@ -0,0 +1 @@ +"0node" \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/quoted_node_type.kdl b/tests/test_documents/upstream/1.0.0/input/quoted_node_type.kdl new file mode 100644 index 0000000..c66d905 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/quoted_node_type.kdl @@ -0,0 +1 @@ +("type/")node diff --git a/tests/test_documents/upstream/1.0.0/input/quoted_numeric.kdl b/tests/test_documents/upstream/1.0.0/input/quoted_numeric.kdl new file mode 100644 index 0000000..5939268 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/quoted_numeric.kdl @@ -0,0 +1 @@ +node prop="10.0" \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/quoted_prop_name.kdl b/tests/test_documents/upstream/1.0.0/input/quoted_prop_name.kdl new file mode 100644 index 0000000..73ec6dd --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/quoted_prop_name.kdl @@ -0,0 +1 @@ +node "0prop"="val" \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/quoted_prop_type.kdl b/tests/test_documents/upstream/1.0.0/input/quoted_prop_type.kdl new file mode 100644 index 0000000..0e2b920 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/quoted_prop_type.kdl @@ -0,0 +1 @@ +node key=("type/")true diff --git a/tests/test_documents/upstream/1.0.0/input/r_node.kdl b/tests/test_documents/upstream/1.0.0/input/r_node.kdl new file mode 100644 index 0000000..4a98807 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/r_node.kdl @@ -0,0 +1 @@ +r "arg" diff --git a/tests/test_documents/upstream/1.0.0/input/raw_arg_type.kdl b/tests/test_documents/upstream/1.0.0/input/raw_arg_type.kdl new file mode 100644 index 0000000..c5739b1 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/raw_arg_type.kdl @@ -0,0 +1 @@ +node (type)true \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/raw_node_name.kdl b/tests/test_documents/upstream/1.0.0/input/raw_node_name.kdl new file mode 100644 index 0000000..0d38371 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/raw_node_name.kdl @@ -0,0 +1 @@ +r"\node" \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/raw_node_type.kdl b/tests/test_documents/upstream/1.0.0/input/raw_node_type.kdl new file mode 100644 index 0000000..72b265d --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/raw_node_type.kdl @@ -0,0 +1 @@ +(type)node \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/raw_prop_type.kdl b/tests/test_documents/upstream/1.0.0/input/raw_prop_type.kdl new file mode 100644 index 0000000..d69294f --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/raw_prop_type.kdl @@ -0,0 +1 @@ +node key=(type)true \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/raw_string_arg.kdl b/tests/test_documents/upstream/1.0.0/input/raw_string_arg.kdl new file mode 100644 index 0000000..6b7581f --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/raw_string_arg.kdl @@ -0,0 +1,3 @@ +node_1 r"arg\n" +node_2 r#""arg\n"and stuff"# +node_3 r##"#"arg\n"#and stuff"## \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/raw_string_backslash.kdl b/tests/test_documents/upstream/1.0.0/input/raw_string_backslash.kdl new file mode 100644 index 0000000..0f7ca45 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/raw_string_backslash.kdl @@ -0,0 +1 @@ +node r"\n" diff --git a/tests/test_documents/upstream/1.0.0/input/raw_string_hash_no_esc.kdl b/tests/test_documents/upstream/1.0.0/input/raw_string_hash_no_esc.kdl new file mode 100644 index 0000000..c8fa3c4 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/raw_string_hash_no_esc.kdl @@ -0,0 +1 @@ +node r"#" diff --git a/tests/test_documents/upstream/1.0.0/input/raw_string_just_backslash.kdl b/tests/test_documents/upstream/1.0.0/input/raw_string_just_backslash.kdl new file mode 100644 index 0000000..9aefa73 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/raw_string_just_backslash.kdl @@ -0,0 +1 @@ +node r"\" diff --git a/tests/test_documents/upstream/1.0.0/input/raw_string_just_quote.kdl b/tests/test_documents/upstream/1.0.0/input/raw_string_just_quote.kdl new file mode 100644 index 0000000..b8333ca --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/raw_string_just_quote.kdl @@ -0,0 +1 @@ +node r#"""# diff --git a/tests/test_documents/upstream/1.0.0/input/raw_string_multiple_hash.kdl b/tests/test_documents/upstream/1.0.0/input/raw_string_multiple_hash.kdl new file mode 100644 index 0000000..e6d054c --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/raw_string_multiple_hash.kdl @@ -0,0 +1 @@ +node r###""#"##"### diff --git a/tests/test_documents/upstream/1.0.0/input/raw_string_newline.kdl b/tests/test_documents/upstream/1.0.0/input/raw_string_newline.kdl new file mode 100644 index 0000000..ef39d3c --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/raw_string_newline.kdl @@ -0,0 +1,4 @@ +node r" +hello +world +" diff --git a/tests/test_documents/upstream/1.0.0/input/raw_string_prop.kdl b/tests/test_documents/upstream/1.0.0/input/raw_string_prop.kdl new file mode 100644 index 0000000..a6c352a --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/raw_string_prop.kdl @@ -0,0 +1,3 @@ +node_1 prop=r"arg\n" +node_2 prop=r#""arg"\n"# +node_3 prop=r##"#"arg"#\n"## \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/raw_string_quote.kdl b/tests/test_documents/upstream/1.0.0/input/raw_string_quote.kdl new file mode 100644 index 0000000..cd7419c --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/raw_string_quote.kdl @@ -0,0 +1 @@ +node r#"a"b"# \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/repeated_arg.kdl b/tests/test_documents/upstream/1.0.0/input/repeated_arg.kdl new file mode 100644 index 0000000..beab120 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/repeated_arg.kdl @@ -0,0 +1 @@ +node "arg" "arg" \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/repeated_prop.kdl b/tests/test_documents/upstream/1.0.0/input/repeated_prop.kdl new file mode 100644 index 0000000..ac42834 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/repeated_prop.kdl @@ -0,0 +1 @@ +node prop=10 prop=11 \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/same_args.kdl b/tests/test_documents/upstream/1.0.0/input/same_args.kdl new file mode 100644 index 0000000..c412de8 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/same_args.kdl @@ -0,0 +1 @@ +node "whee" "whee" \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/same_name_nodes.kdl b/tests/test_documents/upstream/1.0.0/input/same_name_nodes.kdl new file mode 100644 index 0000000..3e545b1 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/same_name_nodes.kdl @@ -0,0 +1,2 @@ +node +node diff --git a/tests/test_documents/upstream/1.0.0/input/sci_notation_large.kdl b/tests/test_documents/upstream/1.0.0/input/sci_notation_large.kdl new file mode 100644 index 0000000..e8385f6 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/sci_notation_large.kdl @@ -0,0 +1 @@ +node prop=1.23E+1000 \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/sci_notation_small.kdl b/tests/test_documents/upstream/1.0.0/input/sci_notation_small.kdl new file mode 100644 index 0000000..300c7d8 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/sci_notation_small.kdl @@ -0,0 +1 @@ +node prop=1.23E-1000 \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/semicolon_after_child.kdl b/tests/test_documents/upstream/1.0.0/input/semicolon_after_child.kdl new file mode 100644 index 0000000..81f2634 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/semicolon_after_child.kdl @@ -0,0 +1,3 @@ +node { + childnode +}; diff --git a/tests/test_documents/upstream/1.0.0/input/semicolon_in_child.kdl b/tests/test_documents/upstream/1.0.0/input/semicolon_in_child.kdl new file mode 100644 index 0000000..ec6fff1 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/semicolon_in_child.kdl @@ -0,0 +1,3 @@ +node1 { + node2; +} \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/semicolon_separated.kdl b/tests/test_documents/upstream/1.0.0/input/semicolon_separated.kdl new file mode 100644 index 0000000..3324f79 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/semicolon_separated.kdl @@ -0,0 +1 @@ +node1;node2 \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/semicolon_separated_nodes.kdl b/tests/test_documents/upstream/1.0.0/input/semicolon_separated_nodes.kdl new file mode 100644 index 0000000..3450f49 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/semicolon_separated_nodes.kdl @@ -0,0 +1 @@ +node1; node2; \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/semicolon_terminated.kdl b/tests/test_documents/upstream/1.0.0/input/semicolon_terminated.kdl new file mode 100644 index 0000000..c8b9d2d --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/semicolon_terminated.kdl @@ -0,0 +1 @@ +node1; \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/single_arg.kdl b/tests/test_documents/upstream/1.0.0/input/single_arg.kdl new file mode 100644 index 0000000..e5161d1 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/single_arg.kdl @@ -0,0 +1 @@ +node "arg" \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/single_prop.kdl b/tests/test_documents/upstream/1.0.0/input/single_prop.kdl new file mode 100644 index 0000000..4c29c14 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/single_prop.kdl @@ -0,0 +1 @@ +node prop="val" \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/slash_in_bare_id.kdl b/tests/test_documents/upstream/1.0.0/input/slash_in_bare_id.kdl new file mode 100644 index 0000000..1139c88 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/slash_in_bare_id.kdl @@ -0,0 +1 @@ +foo123/bar "weeee" diff --git a/tests/test_documents/upstream/1.0.0/input/slashdash_arg_after_newline_esc.kdl b/tests/test_documents/upstream/1.0.0/input/slashdash_arg_after_newline_esc.kdl new file mode 100644 index 0000000..059b3e1 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/slashdash_arg_after_newline_esc.kdl @@ -0,0 +1,2 @@ +node \ + /- "arg" "arg2" diff --git a/tests/test_documents/upstream/1.0.0/input/slashdash_arg_before_newline_esc.kdl b/tests/test_documents/upstream/1.0.0/input/slashdash_arg_before_newline_esc.kdl new file mode 100644 index 0000000..f58e4a7 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/slashdash_arg_before_newline_esc.kdl @@ -0,0 +1,2 @@ +node /- \ + "arg" diff --git a/tests/test_documents/upstream/1.0.0/input/slashdash_child.kdl b/tests/test_documents/upstream/1.0.0/input/slashdash_child.kdl new file mode 100644 index 0000000..70fb1e9 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/slashdash_child.kdl @@ -0,0 +1,3 @@ +node /- { + node2 +} diff --git a/tests/test_documents/upstream/1.0.0/input/slashdash_empty_child.kdl b/tests/test_documents/upstream/1.0.0/input/slashdash_empty_child.kdl new file mode 100644 index 0000000..644c21b --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/slashdash_empty_child.kdl @@ -0,0 +1,2 @@ +node /- { +} diff --git a/tests/test_documents/upstream/1.0.0/input/slashdash_full_node.kdl b/tests/test_documents/upstream/1.0.0/input/slashdash_full_node.kdl new file mode 100644 index 0000000..de2eb2a --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/slashdash_full_node.kdl @@ -0,0 +1,2 @@ +/- node 1.0 "a" b="b +" \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/slashdash_in_slashdash.kdl b/tests/test_documents/upstream/1.0.0/input/slashdash_in_slashdash.kdl new file mode 100644 index 0000000..cb43150 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/slashdash_in_slashdash.kdl @@ -0,0 +1,2 @@ +/- node1 /- 1.0 +node2 \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/slashdash_negative_number.kdl b/tests/test_documents/upstream/1.0.0/input/slashdash_negative_number.kdl new file mode 100644 index 0000000..241de28 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/slashdash_negative_number.kdl @@ -0,0 +1 @@ +node /--1.0 2.0 \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/slashdash_node_in_child.kdl b/tests/test_documents/upstream/1.0.0/input/slashdash_node_in_child.kdl new file mode 100644 index 0000000..77fd44a --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/slashdash_node_in_child.kdl @@ -0,0 +1,3 @@ +node1 { + /- node2 +} \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/slashdash_node_with_child.kdl b/tests/test_documents/upstream/1.0.0/input/slashdash_node_with_child.kdl new file mode 100644 index 0000000..d3063dd --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/slashdash_node_with_child.kdl @@ -0,0 +1,3 @@ +/- node { + node2 +} \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/slashdash_only_node.kdl b/tests/test_documents/upstream/1.0.0/input/slashdash_only_node.kdl new file mode 100644 index 0000000..d404630 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/slashdash_only_node.kdl @@ -0,0 +1 @@ +/-node diff --git a/tests/test_documents/upstream/1.0.0/input/slashdash_only_node_with_space.kdl b/tests/test_documents/upstream/1.0.0/input/slashdash_only_node_with_space.kdl new file mode 100644 index 0000000..ab2af84 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/slashdash_only_node_with_space.kdl @@ -0,0 +1 @@ +/- node \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/slashdash_prop.kdl b/tests/test_documents/upstream/1.0.0/input/slashdash_prop.kdl new file mode 100644 index 0000000..3d7b806 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/slashdash_prop.kdl @@ -0,0 +1 @@ +node /- key="value" "arg" diff --git a/tests/test_documents/upstream/1.0.0/input/slashdash_raw_prop_key.kdl b/tests/test_documents/upstream/1.0.0/input/slashdash_raw_prop_key.kdl new file mode 100644 index 0000000..c9ad5ad --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/slashdash_raw_prop_key.kdl @@ -0,0 +1 @@ +node /- key="value" diff --git a/tests/test_documents/upstream/1.0.0/input/slashdash_repeated_prop.kdl b/tests/test_documents/upstream/1.0.0/input/slashdash_repeated_prop.kdl new file mode 100644 index 0000000..b427175 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/slashdash_repeated_prop.kdl @@ -0,0 +1 @@ +node arg="correct" /- arg="wrong" diff --git a/tests/test_documents/upstream/1.0.0/input/space_after_arg_type.kdl b/tests/test_documents/upstream/1.0.0/input/space_after_arg_type.kdl new file mode 100644 index 0000000..2fe3698 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/space_after_arg_type.kdl @@ -0,0 +1 @@ +node (type) 10 diff --git a/tests/test_documents/upstream/1.0.0/input/space_after_node_type.kdl b/tests/test_documents/upstream/1.0.0/input/space_after_node_type.kdl new file mode 100644 index 0000000..f401065 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/space_after_node_type.kdl @@ -0,0 +1 @@ +(type) node diff --git a/tests/test_documents/upstream/1.0.0/input/space_after_prop_type.kdl b/tests/test_documents/upstream/1.0.0/input/space_after_prop_type.kdl new file mode 100644 index 0000000..a891dfd --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/space_after_prop_type.kdl @@ -0,0 +1 @@ +node key=(type) false diff --git a/tests/test_documents/upstream/1.0.0/input/space_in_arg_type.kdl b/tests/test_documents/upstream/1.0.0/input/space_in_arg_type.kdl new file mode 100644 index 0000000..2f9ca24 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/space_in_arg_type.kdl @@ -0,0 +1 @@ +node (type )false diff --git a/tests/test_documents/upstream/1.0.0/input/space_in_node_type.kdl b/tests/test_documents/upstream/1.0.0/input/space_in_node_type.kdl new file mode 100644 index 0000000..929365b --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/space_in_node_type.kdl @@ -0,0 +1 @@ +( type)node diff --git a/tests/test_documents/upstream/1.0.0/input/space_in_prop_type.kdl b/tests/test_documents/upstream/1.0.0/input/space_in_prop_type.kdl new file mode 100644 index 0000000..4e9c750 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/space_in_prop_type.kdl @@ -0,0 +1 @@ +node key=(type )false diff --git a/tests/test_documents/upstream/1.0.0/input/square_bracket_in_bare_id.kdl b/tests/test_documents/upstream/1.0.0/input/square_bracket_in_bare_id.kdl new file mode 100644 index 0000000..2dd54e9 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/square_bracket_in_bare_id.kdl @@ -0,0 +1 @@ +foo123[bar]foo "weeee" diff --git a/tests/test_documents/upstream/1.0.0/input/string_arg.kdl b/tests/test_documents/upstream/1.0.0/input/string_arg.kdl new file mode 100644 index 0000000..e5161d1 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/string_arg.kdl @@ -0,0 +1 @@ +node "arg" \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/string_prop.kdl b/tests/test_documents/upstream/1.0.0/input/string_prop.kdl new file mode 100644 index 0000000..4c29c14 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/string_prop.kdl @@ -0,0 +1 @@ +node prop="val" \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/tab_space.kdl b/tests/test_documents/upstream/1.0.0/input/tab_space.kdl new file mode 100644 index 0000000..64f5a0a --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/tab_space.kdl @@ -0,0 +1 @@ +node diff --git a/tests/test_documents/upstream/1.0.0/input/trailing_crlf.kdl b/tests/test_documents/upstream/1.0.0/input/trailing_crlf.kdl new file mode 100644 index 0000000..64f5a0a --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/trailing_crlf.kdl @@ -0,0 +1 @@ +node diff --git a/tests/test_documents/upstream/1.0.0/input/trailing_underscore_hex.kdl b/tests/test_documents/upstream/1.0.0/input/trailing_underscore_hex.kdl new file mode 100644 index 0000000..bdf65bc --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/trailing_underscore_hex.kdl @@ -0,0 +1 @@ +node 0x123abc_ \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/trailing_underscore_octal.kdl b/tests/test_documents/upstream/1.0.0/input/trailing_underscore_octal.kdl new file mode 100644 index 0000000..1d27c18 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/trailing_underscore_octal.kdl @@ -0,0 +1 @@ +node 0o123_ diff --git a/tests/test_documents/upstream/1.0.0/input/true_prefix_in_bare_id.kdl b/tests/test_documents/upstream/1.0.0/input/true_prefix_in_bare_id.kdl new file mode 100644 index 0000000..49c9d0d --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/true_prefix_in_bare_id.kdl @@ -0,0 +1 @@ +true_id diff --git a/tests/test_documents/upstream/1.0.0/input/true_prefix_in_prop_key.kdl b/tests/test_documents/upstream/1.0.0/input/true_prefix_in_prop_key.kdl new file mode 100644 index 0000000..2af7a1c --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/true_prefix_in_prop_key.kdl @@ -0,0 +1 @@ +node true_id=1 diff --git a/tests/test_documents/upstream/1.0.0/input/true_prop_key.kdl b/tests/test_documents/upstream/1.0.0/input/true_prop_key.kdl new file mode 100644 index 0000000..e88c36f --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/true_prop_key.kdl @@ -0,0 +1 @@ +node true=1 diff --git a/tests/test_documents/upstream/1.0.0/input/two_nodes.kdl b/tests/test_documents/upstream/1.0.0/input/two_nodes.kdl new file mode 100644 index 0000000..1c5b5f3 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/two_nodes.kdl @@ -0,0 +1,2 @@ +node1 +node2 diff --git a/tests/test_documents/upstream/1.0.0/input/type_before_prop_key.kdl b/tests/test_documents/upstream/1.0.0/input/type_before_prop_key.kdl new file mode 100644 index 0000000..1b19b0d --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/type_before_prop_key.kdl @@ -0,0 +1 @@ +node (type)key=10 diff --git a/tests/test_documents/upstream/1.0.0/input/unbalanced_raw_hashes.kdl b/tests/test_documents/upstream/1.0.0/input/unbalanced_raw_hashes.kdl new file mode 100644 index 0000000..7deb72f --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/unbalanced_raw_hashes.kdl @@ -0,0 +1 @@ +node r##"foo"# diff --git a/tests/test_documents/upstream/1.0.0/input/underscore_at_start_of_fraction.kdl b/tests/test_documents/upstream/1.0.0/input/underscore_at_start_of_fraction.kdl new file mode 100644 index 0000000..30fb7cc --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/underscore_at_start_of_fraction.kdl @@ -0,0 +1 @@ +node 1._7 \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/underscore_at_start_of_hex.kdl b/tests/test_documents/upstream/1.0.0/input/underscore_at_start_of_hex.kdl new file mode 100644 index 0000000..2de0c48 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/underscore_at_start_of_hex.kdl @@ -0,0 +1 @@ +node 0x_10 \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/underscore_at_start_of_int.kdl b/tests/test_documents/upstream/1.0.0/input/underscore_at_start_of_int.kdl new file mode 100644 index 0000000..b854b60 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/underscore_at_start_of_int.kdl @@ -0,0 +1 @@ +node _15 \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/underscore_before_number.kdl b/tests/test_documents/upstream/1.0.0/input/underscore_before_number.kdl new file mode 100644 index 0000000..788656b --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/underscore_before_number.kdl @@ -0,0 +1 @@ +node _15 diff --git a/tests/test_documents/upstream/1.0.0/input/underscore_in_exponent.kdl b/tests/test_documents/upstream/1.0.0/input/underscore_in_exponent.kdl new file mode 100644 index 0000000..329c736 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/underscore_in_exponent.kdl @@ -0,0 +1 @@ +node 1.0e-10_0 diff --git a/tests/test_documents/upstream/1.0.0/input/underscore_in_float.kdl b/tests/test_documents/upstream/1.0.0/input/underscore_in_float.kdl new file mode 100644 index 0000000..f039b6a --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/underscore_in_float.kdl @@ -0,0 +1 @@ +node 1_1.0 diff --git a/tests/test_documents/upstream/1.0.0/input/underscore_in_fraction.kdl b/tests/test_documents/upstream/1.0.0/input/underscore_in_fraction.kdl new file mode 100644 index 0000000..b1a091a --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/underscore_in_fraction.kdl @@ -0,0 +1 @@ +node 1.0_2 \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/underscore_in_int.kdl b/tests/test_documents/upstream/1.0.0/input/underscore_in_int.kdl new file mode 100644 index 0000000..19250d3 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/underscore_in_int.kdl @@ -0,0 +1 @@ +node 1_0 diff --git a/tests/test_documents/upstream/1.0.0/input/underscore_in_octal.kdl b/tests/test_documents/upstream/1.0.0/input/underscore_in_octal.kdl new file mode 100644 index 0000000..8a57ec1 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/underscore_in_octal.kdl @@ -0,0 +1 @@ +node 0o012_3456_7 \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/unusual_bare_id_chars_in_quoted_id.kdl b/tests/test_documents/upstream/1.0.0/input/unusual_bare_id_chars_in_quoted_id.kdl new file mode 100644 index 0000000..e37de20 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/unusual_bare_id_chars_in_quoted_id.kdl @@ -0,0 +1 @@ +"foo123~!@#$%^&*.:'|?+" "weeee" \ No newline at end of file diff --git a/tests/test_documents/upstream/1.0.0/input/unusual_chars_in_bare_id.kdl b/tests/test_documents/upstream/1.0.0/input/unusual_chars_in_bare_id.kdl new file mode 100644 index 0000000..d2dcd19 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/unusual_chars_in_bare_id.kdl @@ -0,0 +1 @@ +foo123~!@#$%^&*.:'|?+ "weeee" diff --git a/tests/test_documents/upstream/1.0.0/input/zero_arg.kdl b/tests/test_documents/upstream/1.0.0/input/zero_arg.kdl new file mode 100644 index 0000000..74405b6 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/zero_arg.kdl @@ -0,0 +1 @@ +node 0 diff --git a/tests/test_documents/upstream/1.0.0/input/zero_float.kdl b/tests/test_documents/upstream/1.0.0/input/zero_float.kdl new file mode 100644 index 0000000..fd5b1f1 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/zero_float.kdl @@ -0,0 +1 @@ +node 0.0 diff --git a/tests/test_documents/upstream/1.0.0/input/zero_int.kdl b/tests/test_documents/upstream/1.0.0/input/zero_int.kdl new file mode 100644 index 0000000..74405b6 --- /dev/null +++ b/tests/test_documents/upstream/1.0.0/input/zero_int.kdl @@ -0,0 +1 @@ +node 0 From b8fe101eb6c187f498c4f0954f63e8ba83ada1ab Mon Sep 17 00:00:00 2001 From: Thomas Jollans Date: Sun, 26 May 2024 13:02:44 +0200 Subject: [PATCH 26/45] Add v2 test suite (not run by default yet) --- tests/CMakeLists.txt | 31 ++++++++++++++----- tests/example_doc_test.c | 9 +++++- tests/test_documents/upstream/1.0.0/COPYING | 7 ++++- .../upstream/2.0.0.draft/.gitattributes | 1 + .../upstream/2.0.0.draft/COPYING | 6 ++++ .../2.0.0.draft/expected_kdl/all_escapes.kdl | 1 + .../expected_kdl/all_node_fields.kdl | 3 ++ .../expected_kdl/arg_and_prop_same_name.kdl | 1 + .../2.0.0.draft/expected_kdl/arg_bare.kdl | 1 + .../expected_kdl/arg_false_type.kdl | 1 + .../expected_kdl/arg_float_type.kdl | 1 + .../2.0.0.draft/expected_kdl/arg_hex_type.kdl | 1 + .../expected_kdl/arg_null_type.kdl | 1 + .../expected_kdl/arg_raw_string_type.kdl | 1 + .../expected_kdl/arg_string_type.kdl | 1 + .../expected_kdl/arg_true_type.kdl | 1 + .../2.0.0.draft/expected_kdl/arg_type.kdl | 1 + .../expected_kdl/arg_zero_type.kdl | 1 + .../asterisk_in_block_comment.kdl | 1 + .../2.0.0.draft/expected_kdl/bare_emoji.kdl | 1 + .../expected_kdl/bare_ident_dot.kdl | 1 + .../expected_kdl/bare_ident_sign.kdl | 1 + .../expected_kdl/bare_ident_sign_dot.kdl | 1 + .../2.0.0.draft/expected_kdl/binary.kdl | 1 + .../binary_trailing_underscore.kdl | 1 + .../expected_kdl/binary_underscore.kdl | 1 + .../expected_kdl/blank_arg_type.kdl | 1 + .../expected_kdl/blank_node_type.kdl | 1 + .../expected_kdl/blank_prop_type.kdl | 1 + .../expected_kdl/block_comment.kdl | 1 + .../expected_kdl/block_comment_after_node.kdl | 1 + .../block_comment_before_node.kdl | 1 + .../block_comment_before_node_no_space.kdl | 1 + .../expected_kdl/block_comment_newline.kdl | 1 + .../2.0.0.draft/expected_kdl/bom_initial.kdl | 1 + .../2.0.0.draft/expected_kdl/boolean_arg.kdl | 1 + .../2.0.0.draft/expected_kdl/boolean_prop.kdl | 1 + .../expected_kdl/chevrons_in_bare_id.kdl | 1 + .../expected_kdl/comma_in_bare_id.kdl | 1 + .../expected_kdl/comment_after_arg_type.kdl | 1 + .../expected_kdl/comment_after_node_type.kdl | 1 + .../expected_kdl/comment_after_prop_type.kdl | 1 + .../expected_kdl/comment_and_newline.kdl | 2 ++ .../expected_kdl/comment_in_arg_type.kdl | 1 + .../expected_kdl/comment_in_node_type.kdl | 1 + .../expected_kdl/comment_in_prop_type.kdl | 1 + .../expected_kdl/commented_arg.kdl | 1 + .../expected_kdl/commented_child.kdl | 1 + .../expected_kdl/commented_line.kdl | 1 + .../expected_kdl/commented_node.kdl | 1 + .../expected_kdl/commented_prop.kdl | 1 + .../expected_kdl/crlf_between_nodes.kdl | 2 ++ .../2.0.0.draft/expected_kdl/dash_dash.kdl | 1 + .../2.0.0.draft/expected_kdl/emoji.kdl | 1 + .../2.0.0.draft/expected_kdl/empty.kdl | 1 + .../2.0.0.draft/expected_kdl/empty_child.kdl | 1 + .../empty_child_different_lines.kdl | 1 + .../expected_kdl/empty_child_same_line.kdl | 1 + .../expected_kdl/empty_child_whitespace.kdl | 1 + .../expected_kdl/empty_line_comment.kdl | 1 + .../expected_kdl/empty_quoted_node_id.kdl | 1 + .../expected_kdl/empty_quoted_prop_key.kdl | 1 + .../expected_kdl/empty_string_arg.kdl | 1 + .../expected_kdl/eof_after_escape.kdl | 1 + .../expected_kdl/esc_newline_in_string.kdl | 1 + .../expected_kdl/esc_unicode_in_string.kdl | 1 + .../expected_kdl/escaped_whitespace.kdl | 1 + .../2.0.0.draft/expected_kdl/escline.kdl | 1 + .../expected_kdl/escline_line_comment.kdl | 1 + .../2.0.0.draft/expected_kdl/escline_node.kdl | 2 ++ .../expected_kdl/false_prefix_in_bare_id.kdl | 1 + .../expected_kdl/false_prefix_in_prop_key.kdl | 1 + .../expected_kdl/floating_point_keywords.kdl | 1 + .../upstream/2.0.0.draft/expected_kdl/hex.kdl | 1 + .../2.0.0.draft/expected_kdl/hex_int.kdl | 1 + .../expected_kdl/hex_int_underscores.kdl | 1 + .../expected_kdl/hex_leading_zero.kdl | 1 + .../expected_kdl/initial_slashdash.kdl | 1 + .../expected_kdl/int_multiple_underscore.kdl | 1 + .../expected_kdl/just_block_comment.kdl | 1 + .../2.0.0.draft/expected_kdl/just_child.kdl | 3 ++ .../2.0.0.draft/expected_kdl/just_newline.kdl | 1 + .../2.0.0.draft/expected_kdl/just_node_id.kdl | 1 + .../2.0.0.draft/expected_kdl/just_space.kdl | 1 + .../expected_kdl/leading_newline.kdl | 1 + .../expected_kdl/leading_zero_binary.kdl | 1 + .../expected_kdl/leading_zero_int.kdl | 1 + .../expected_kdl/leading_zero_oct.kdl | 1 + .../expected_kdl/multiline_comment.kdl | 1 + .../expected_kdl/multiline_nodes.kdl | 1 + .../expected_kdl/multiline_raw_string.kdl | 1 + .../multiline_raw_string_indented.kdl | 1 + .../expected_kdl/multiline_string.kdl | 1 + .../multiline_string_indented.kdl | 1 + .../expected_kdl/negative_exponent.kdl | 1 + .../expected_kdl/negative_float.kdl | 1 + .../2.0.0.draft/expected_kdl/negative_int.kdl | 1 + .../expected_kdl/nested_block_comment.kdl | 1 + .../expected_kdl/nested_children.kdl | 5 +++ .../expected_kdl/nested_comments.kdl | 1 + .../nested_multiline_block_comment.kdl | 1 + .../expected_kdl/newline_between_nodes.kdl | 2 ++ .../newlines_in_block_comment.kdl | 1 + .../expected_kdl/no_decimal_exponent.kdl | 1 + .../2.0.0.draft/expected_kdl/node_false.kdl | 1 + .../2.0.0.draft/expected_kdl/node_true.kdl | 1 + .../2.0.0.draft/expected_kdl/node_type.kdl | 1 + .../2.0.0.draft/expected_kdl/null_arg.kdl | 1 + .../expected_kdl/null_prefix_in_bare_id.kdl | 1 + .../expected_kdl/null_prefix_in_prop_key.kdl | 1 + .../2.0.0.draft/expected_kdl/null_prop.kdl | 1 + .../2.0.0.draft/expected_kdl/numeric_arg.kdl | 1 + .../2.0.0.draft/expected_kdl/numeric_prop.kdl | 1 + .../2.0.0.draft/expected_kdl/octal.kdl | 1 + .../2.0.0.draft/expected_kdl/only_cr.kdl | 1 + .../expected_kdl/only_line_comment.kdl | 1 + .../expected_kdl/only_line_comment_crlf.kdl | 1 + .../only_line_comment_newline.kdl | 1 + .../expected_kdl/optional_child_semicolon.kdl | 5 +++ .../expected_kdl/parse_all_arg_types.kdl | 1 + .../expected_kdl/positive_exponent.kdl | 1 + .../2.0.0.draft/expected_kdl/positive_int.kdl | 1 + .../expected_kdl/preserve_duplicate_nodes.kdl | 2 ++ .../expected_kdl/preserve_node_order.kdl | 3 ++ .../expected_kdl/prop_false_type.kdl | 1 + .../expected_kdl/prop_float_type.kdl | 1 + .../expected_kdl/prop_hex_type.kdl | 1 + .../expected_kdl/prop_identifier_type.kdl | 1 + .../expected_kdl/prop_null_type.kdl | 1 + .../expected_kdl/prop_raw_string_type.kdl | 1 + .../expected_kdl/prop_string_type.kdl | 1 + .../expected_kdl/prop_true_type.kdl | 1 + .../2.0.0.draft/expected_kdl/prop_type.kdl | 1 + .../expected_kdl/prop_zero_type.kdl | 1 + .../question_mark_before_number.kdl | 1 + .../expected_kdl/quoted_arg_type.kdl | 1 + .../expected_kdl/quoted_node_name.kdl | 1 + .../expected_kdl/quoted_node_type.kdl | 1 + .../expected_kdl/quoted_numeric.kdl | 1 + .../expected_kdl/quoted_prop_name.kdl | 1 + .../expected_kdl/quoted_prop_type.kdl | 1 + .../2.0.0.draft/expected_kdl/r_node.kdl | 1 + .../2.0.0.draft/expected_kdl/raw_arg_type.kdl | 1 + .../expected_kdl/raw_node_name.kdl | 1 + .../expected_kdl/raw_node_type.kdl | 1 + .../expected_kdl/raw_prop_type.kdl | 1 + .../expected_kdl/raw_string_arg.kdl | 2 ++ .../expected_kdl/raw_string_backslash.kdl | 1 + .../expected_kdl/raw_string_hash_no_esc.kdl | 1 + .../raw_string_just_backslash.kdl | 1 + .../expected_kdl/raw_string_just_quote.kdl | 1 + .../expected_kdl/raw_string_multiple_hash.kdl | 1 + .../expected_kdl/raw_string_newline.kdl | 1 + .../expected_kdl/raw_string_prop.kdl | 2 ++ .../expected_kdl/raw_string_quote.kdl | 1 + .../2.0.0.draft/expected_kdl/repeated_arg.kdl | 1 + .../expected_kdl/repeated_prop.kdl | 1 + .../expected_kdl/same_name_nodes.kdl | 2 ++ .../expected_kdl/sci_notation_large.kdl | 1 + .../expected_kdl/sci_notation_small.kdl | 1 + .../expected_kdl/semicolon_after_child.kdl | 3 ++ .../expected_kdl/semicolon_in_child.kdl | 3 ++ .../expected_kdl/semicolon_separated.kdl | 2 ++ .../semicolon_separated_nodes.kdl | 2 ++ .../expected_kdl/semicolon_terminated.kdl | 1 + .../2.0.0.draft/expected_kdl/single_arg.kdl | 1 + .../2.0.0.draft/expected_kdl/single_prop.kdl | 1 + .../slashdash_arg_after_newline_esc.kdl | 1 + .../slashdash_arg_before_newline_esc.kdl | 1 + .../expected_kdl/slashdash_child.kdl | 1 + .../expected_kdl/slashdash_empty_child.kdl | 1 + .../expected_kdl/slashdash_full_node.kdl | 1 + .../expected_kdl/slashdash_in_slashdash.kdl | 1 + .../slashdash_negative_number.kdl | 1 + .../expected_kdl/slashdash_node_in_child.kdl | 1 + .../slashdash_node_with_child.kdl | 1 + .../expected_kdl/slashdash_only_node.kdl | 1 + .../slashdash_only_node_with_space.kdl | 1 + .../expected_kdl/slashdash_prop.kdl | 1 + .../expected_kdl/slashdash_raw_prop_key.kdl | 1 + .../expected_kdl/slashdash_repeated_prop.kdl | 1 + .../expected_kdl/space_after_arg_type.kdl | 1 + .../expected_kdl/space_after_node_type.kdl | 1 + .../expected_kdl/space_after_prop_type.kdl | 1 + .../expected_kdl/space_around_prop_marker.kdl | 1 + .../expected_kdl/space_in_arg_type.kdl | 1 + .../expected_kdl/space_in_node_type.kdl | 1 + .../expected_kdl/space_in_prop_type.kdl | 1 + .../2.0.0.draft/expected_kdl/string_arg.kdl | 1 + .../string_escaped_literal_whitespace.kdl | 1 + .../2.0.0.draft/expected_kdl/string_prop.kdl | 1 + .../2.0.0.draft/expected_kdl/tab_space.kdl | 1 + .../expected_kdl/trailing_crlf.kdl | 1 + .../expected_kdl/trailing_underscore_hex.kdl | 1 + .../trailing_underscore_octal.kdl | 1 + .../expected_kdl/true_prefix_in_bare_id.kdl | 1 + .../expected_kdl/true_prefix_in_prop_key.kdl | 1 + .../2.0.0.draft/expected_kdl/two_nodes.kdl | 2 ++ .../expected_kdl/underscore_before_number.kdl | 1 + .../expected_kdl/underscore_in_exponent.kdl | 1 + .../expected_kdl/underscore_in_float.kdl | 1 + .../expected_kdl/underscore_in_fraction.kdl | 1 + .../expected_kdl/underscore_in_int.kdl | 1 + .../expected_kdl/underscore_in_octal.kdl | 1 + .../expected_kdl/unicode_equals_signs.kdl | 1 + .../unusual_bare_id_chars_in_quoted_id.kdl | 1 + .../expected_kdl/unusual_chars_in_bare_id.kdl | 1 + .../expected_kdl/vertical_tab_whitespace.kdl | 1 + .../2.0.0.draft/expected_kdl/zero_arg.kdl | 1 + .../2.0.0.draft/expected_kdl/zero_float.kdl | 1 + .../2.0.0.draft/expected_kdl/zero_int.kdl | 1 + .../2.0.0.draft/input/all_escapes.kdl | 1 + .../2.0.0.draft/input/all_node_fields.kdl | 3 ++ .../input/arg_and_prop_same_name.kdl | 1 + .../upstream/2.0.0.draft/input/arg_bare.kdl | 1 + .../2.0.0.draft/input/arg_false_type.kdl | 1 + .../2.0.0.draft/input/arg_float_type.kdl | 1 + .../2.0.0.draft/input/arg_hex_type.kdl | 1 + .../2.0.0.draft/input/arg_null_type.kdl | 1 + .../2.0.0.draft/input/arg_raw_string_type.kdl | 1 + .../2.0.0.draft/input/arg_string_type.kdl | 1 + .../2.0.0.draft/input/arg_true_type.kdl | 1 + .../upstream/2.0.0.draft/input/arg_type.kdl | 1 + .../2.0.0.draft/input/arg_zero_type.kdl | 1 + .../input/asterisk_in_block_comment.kdl | 1 + .../upstream/2.0.0.draft/input/bare_emoji.kdl | 1 + .../2.0.0.draft/input/bare_ident_dot.kdl | 1 + .../2.0.0.draft/input/bare_ident_numeric.kdl | 1 + .../input/bare_ident_numeric_dot.kdl | 1 + .../input/bare_ident_numeric_sign.kdl | 1 + .../2.0.0.draft/input/bare_ident_sign.kdl | 1 + .../2.0.0.draft/input/bare_ident_sign_dot.kdl | 1 + .../upstream/2.0.0.draft/input/binary.kdl | 1 + .../input/binary_trailing_underscore.kdl | 1 + .../2.0.0.draft/input/binary_underscore.kdl | 1 + .../2.0.0.draft/input/blank_arg_type.kdl | 1 + .../2.0.0.draft/input/blank_node_type.kdl | 1 + .../2.0.0.draft/input/blank_prop_type.kdl | 1 + .../2.0.0.draft/input/block_comment.kdl | 1 + .../input/block_comment_after_node.kdl | 1 + .../input/block_comment_before_node.kdl | 1 + .../block_comment_before_node_no_space.kdl | 1 + .../input/block_comment_newline.kdl | 1 + .../2.0.0.draft/input/bom_initial.kdl | 1 + .../upstream/2.0.0.draft/input/bom_later.kdl | 1 + .../2.0.0.draft/input/boolean_arg.kdl | 1 + .../2.0.0.draft/input/boolean_prop.kdl | 1 + .../2.0.0.draft/input/brackets_in_bare_id.kdl | 1 + .../2.0.0.draft/input/chevrons_in_bare_id.kdl | 1 + .../2.0.0.draft/input/comma_in_bare_id.kdl | 1 + .../input/comment_after_arg_type.kdl | 1 + .../input/comment_after_node_type.kdl | 1 + .../input/comment_after_prop_type.kdl | 1 + .../2.0.0.draft/input/comment_and_newline.kdl | 2 ++ .../2.0.0.draft/input/comment_in_arg_type.kdl | 1 + .../input/comment_in_node_type.kdl | 1 + .../input/comment_in_prop_type.kdl | 1 + .../2.0.0.draft/input/commented_arg.kdl | 1 + .../2.0.0.draft/input/commented_child.kdl | 3 ++ .../2.0.0.draft/input/commented_line.kdl | 2 ++ .../2.0.0.draft/input/commented_node.kdl | 3 ++ .../2.0.0.draft/input/commented_prop.kdl | 1 + .../2.0.0.draft/input/crlf_between_nodes.kdl | 2 ++ .../upstream/2.0.0.draft/input/dash_dash.kdl | 1 + .../2.0.0.draft/input/dot_but_no_fraction.kdl | 1 + .../dot_but_no_fraction_before_exponent.kdl | 1 + .../2.0.0.draft/input/dot_in_exponent.kdl | 1 + .../upstream/2.0.0.draft/input/dot_zero.kdl | 1 + .../upstream/2.0.0.draft/input/emoji.kdl | 1 + .../upstream/2.0.0.draft/input/empty.kdl | 0 .../2.0.0.draft/input/empty_arg_type.kdl | 1 + .../2.0.0.draft/input/empty_child.kdl | 2 ++ .../input/empty_child_different_lines.kdl | 2 ++ .../input/empty_child_same_line.kdl | 1 + .../input/empty_child_whitespace.kdl | 3 ++ .../2.0.0.draft/input/empty_line_comment.kdl | 2 ++ .../2.0.0.draft/input/empty_node_type.kdl | 1 + .../2.0.0.draft/input/empty_prop_type.kdl | 1 + .../input/empty_quoted_node_id.kdl | 1 + .../input/empty_quoted_prop_key.kdl | 1 + .../2.0.0.draft/input/empty_string_arg.kdl | 1 + .../2.0.0.draft/input/eof_after_escape.kdl | 1 + .../input/err_backslash_in_bare_id.kdl | 1 + .../input/esc_newline_in_string.kdl | 1 + .../input/esc_unicode_in_string.kdl | 1 + .../2.0.0.draft/input/escaped_whitespace.kdl | 15 +++++++++ .../upstream/2.0.0.draft/input/escline.kdl | 2 ++ .../input/escline_line_comment.kdl | 3 ++ .../2.0.0.draft/input/escline_node.kdl | 2 ++ .../input/false_prefix_in_bare_id.kdl | 1 + .../input/false_prefix_in_prop_key.kdl | 1 + .../2.0.0.draft/input/false_prop_key.kdl | 1 + ...t_keyword_identifier_strings_error.kdl.kdl | 1 + .../input/floating_point_keywords.kdl | 1 + .../upstream/2.0.0.draft/input/hash_in_id.kdl | 1 + .../upstream/2.0.0.draft/input/hex.kdl | 1 + .../upstream/2.0.0.draft/input/hex_int.kdl | 1 + .../2.0.0.draft/input/hex_int_underscores.kdl | 1 + .../2.0.0.draft/input/hex_leading_zero.kdl | 1 + .../input/illegal_char_in_binary.kdl | 1 + .../2.0.0.draft/input/illegal_char_in_hex.kdl | 1 + .../input/illegal_char_in_octal.kdl | 1 + .../2.0.0.draft/input/initial_slashdash.kdl | 2 ++ .../input/int_multiple_underscore.kdl | 1 + .../2.0.0.draft/input/just_block_comment.kdl | 1 + .../upstream/2.0.0.draft/input/just_child.kdl | 3 ++ .../2.0.0.draft/input/just_newline.kdl | 1 + .../2.0.0.draft/input/just_node_id.kdl | 1 + .../upstream/2.0.0.draft/input/just_space.kdl | 1 + .../input/just_space_in_arg_type.kdl | 1 + .../input/just_space_in_node_type.kdl | 1 + .../input/just_space_in_prop_type.kdl | 1 + .../2.0.0.draft/input/just_type_no_arg.kdl | 1 + .../input/just_type_no_node_id.kdl | 1 + .../2.0.0.draft/input/just_type_no_prop.kdl | 1 + .../2.0.0.draft/input/leading_newline.kdl | 2 ++ .../2.0.0.draft/input/leading_zero_binary.kdl | 1 + .../2.0.0.draft/input/leading_zero_int.kdl | 1 + .../2.0.0.draft/input/leading_zero_oct.kdl | 1 + .../2.0.0.draft/input/multiline_comment.kdl | 4 +++ .../2.0.0.draft/input/multiline_nodes.kdl | 3 ++ .../input/multiline_raw_string.kdl | 5 +++ .../input/multiline_raw_string_indented.kdl | 5 +++ ...ng_non_matching_prefix_character_error.kdl | 5 +++ ...string_non_matching_prefix_count_error.kdl | 5 +++ .../2.0.0.draft/input/multiline_string.kdl | 5 +++ .../input/multiline_string_indented.kdl | 5 +++ ...ng_non_matching_prefix_character_error.kdl | 5 +++ ...string_non_matching_prefix_count_error.kdl | 5 +++ .../input/multiple_dots_in_float.kdl | 1 + ...multiple_dots_in_float_before_exponent.kdl | 1 + .../input/multiple_es_in_float.kdl | 1 + .../2.0.0.draft/input/multiple_x_in_hex.kdl | 1 + .../2.0.0.draft/input/negative_exponent.kdl | 1 + .../2.0.0.draft/input/negative_float.kdl | 1 + .../2.0.0.draft/input/negative_int.kdl | 1 + .../input/nested_block_comment.kdl | 1 + .../2.0.0.draft/input/nested_children.kdl | 5 +++ .../2.0.0.draft/input/nested_comments.kdl | 1 + .../input/nested_multiline_block_comment.kdl | 6 ++++ .../input/newline_between_nodes.kdl | 2 ++ .../input/newlines_in_block_comment.kdl | 3 ++ .../2.0.0.draft/input/no_decimal_exponent.kdl | 1 + .../2.0.0.draft/input/no_digits_in_hex.kdl | 1 + .../2.0.0.draft/input/no_integer_digit.kdl | 1 + .../2.0.0.draft/input/no_solidus_escape.kdl | 1 + .../upstream/2.0.0.draft/input/node_false.kdl | 1 + .../upstream/2.0.0.draft/input/node_true.kdl | 1 + .../upstream/2.0.0.draft/input/node_type.kdl | 1 + .../upstream/2.0.0.draft/input/null_arg.kdl | 1 + .../input/null_prefix_in_bare_id.kdl | 1 + .../input/null_prefix_in_prop_key.kdl | 1 + .../upstream/2.0.0.draft/input/null_prop.kdl | 1 + .../2.0.0.draft/input/null_prop_key.kdl | 1 + .../2.0.0.draft/input/numeric_arg.kdl | 1 + .../2.0.0.draft/input/numeric_prop.kdl | 1 + .../upstream/2.0.0.draft/input/octal.kdl | 1 + .../upstream/2.0.0.draft/input/only_cr.kdl | 1 + .../2.0.0.draft/input/only_line_comment.kdl | 1 + .../input/only_line_comment_crlf.kdl | 1 + .../input/only_line_comment_newline.kdl | 1 + .../input/optional_child_semicolon.kdl | 1 + .../2.0.0.draft/input/parens_in_bare_id.kdl | 1 + .../2.0.0.draft/input/parse_all_arg_types.kdl | 1 + .../2.0.0.draft/input/positive_exponent.kdl | 1 + .../2.0.0.draft/input/positive_int.kdl | 1 + .../input/preserve_duplicate_nodes.kdl | 2 ++ .../2.0.0.draft/input/preserve_node_order.kdl | 3 ++ .../2.0.0.draft/input/prop_false_type.kdl | 1 + .../2.0.0.draft/input/prop_float_type.kdl | 1 + .../2.0.0.draft/input/prop_hex_type.kdl | 1 + .../input/prop_identifier_type.kdl | 1 + .../2.0.0.draft/input/prop_null_type.kdl | 1 + .../input/prop_raw_string_type.kdl | 1 + .../2.0.0.draft/input/prop_string_type.kdl | 1 + .../2.0.0.draft/input/prop_true_type.kdl | 1 + .../upstream/2.0.0.draft/input/prop_type.kdl | 1 + .../2.0.0.draft/input/prop_zero_type.kdl | 1 + .../input/question_mark_before_number.kdl | 1 + .../2.0.0.draft/input/quote_in_bare_id.kdl | 1 + .../2.0.0.draft/input/quoted_arg_type.kdl | 1 + .../2.0.0.draft/input/quoted_node_name.kdl | 1 + .../2.0.0.draft/input/quoted_node_type.kdl | 1 + .../2.0.0.draft/input/quoted_numeric.kdl | 1 + .../2.0.0.draft/input/quoted_prop_name.kdl | 1 + .../2.0.0.draft/input/quoted_prop_type.kdl | 1 + .../upstream/2.0.0.draft/input/r_node.kdl | 1 + .../2.0.0.draft/input/raw_arg_type.kdl | 1 + .../2.0.0.draft/input/raw_node_name.kdl | 1 + .../2.0.0.draft/input/raw_node_type.kdl | 1 + .../2.0.0.draft/input/raw_prop_type.kdl | 1 + .../2.0.0.draft/input/raw_string_arg.kdl | 2 ++ .../input/raw_string_backslash.kdl | 1 + .../input/raw_string_hash_no_esc.kdl | 1 + .../input/raw_string_just_backslash.kdl | 1 + .../input/raw_string_just_quote.kdl | 1 + .../input/raw_string_multiple_hash.kdl | 1 + .../2.0.0.draft/input/raw_string_newline.kdl | 4 +++ .../2.0.0.draft/input/raw_string_prop.kdl | 2 ++ .../2.0.0.draft/input/raw_string_quote.kdl | 1 + .../2.0.0.draft/input/repeated_arg.kdl | 1 + .../2.0.0.draft/input/repeated_prop.kdl | 1 + .../2.0.0.draft/input/same_name_nodes.kdl | 2 ++ .../2.0.0.draft/input/sci_notation_large.kdl | 1 + .../2.0.0.draft/input/sci_notation_small.kdl | 1 + .../input/semicolon_after_child.kdl | 3 ++ .../2.0.0.draft/input/semicolon_in_child.kdl | 3 ++ .../2.0.0.draft/input/semicolon_separated.kdl | 1 + .../input/semicolon_separated_nodes.kdl | 1 + .../input/semicolon_terminated.kdl | 1 + .../upstream/2.0.0.draft/input/single_arg.kdl | 1 + .../2.0.0.draft/input/single_prop.kdl | 1 + .../2.0.0.draft/input/slash_in_bare_id.kdl | 1 + .../input/slashdash_arg_after_newline_esc.kdl | 2 ++ .../slashdash_arg_before_newline_esc.kdl | 2 ++ .../2.0.0.draft/input/slashdash_child.kdl | 3 ++ .../input/slashdash_empty_child.kdl | 2 ++ .../2.0.0.draft/input/slashdash_full_node.kdl | 3 ++ .../input/slashdash_in_slashdash.kdl | 2 ++ .../input/slashdash_negative_number.kdl | 1 + .../input/slashdash_node_in_child.kdl | 3 ++ .../input/slashdash_node_with_child.kdl | 3 ++ .../2.0.0.draft/input/slashdash_only_node.kdl | 1 + .../input/slashdash_only_node_with_space.kdl | 1 + .../2.0.0.draft/input/slashdash_prop.kdl | 1 + .../input/slashdash_raw_prop_key.kdl | 1 + .../input/slashdash_repeated_prop.kdl | 1 + .../input/space_after_arg_type.kdl | 1 + .../input/space_after_node_type.kdl | 1 + .../input/space_after_prop_type.kdl | 1 + .../input/space_around_prop_marker.kdl | 1 + .../2.0.0.draft/input/space_in_arg_type.kdl | 1 + .../2.0.0.draft/input/space_in_node_type.kdl | 1 + .../2.0.0.draft/input/space_in_prop_type.kdl | 1 + .../input/square_bracket_in_bare_id.kdl | 1 + .../upstream/2.0.0.draft/input/string_arg.kdl | 1 + .../string_escaped_literal_whitespace.kdl | 2 ++ .../2.0.0.draft/input/string_prop.kdl | 1 + .../upstream/2.0.0.draft/input/tab_space.kdl | 1 + .../2.0.0.draft/input/trailing_crlf.kdl | 1 + .../input/trailing_underscore_hex.kdl | 1 + .../input/trailing_underscore_octal.kdl | 1 + .../input/true_prefix_in_bare_id.kdl | 1 + .../input/true_prefix_in_prop_key.kdl | 1 + .../2.0.0.draft/input/true_prop_key.kdl | 1 + .../upstream/2.0.0.draft/input/two_nodes.kdl | 2 ++ .../input/type_before_prop_key.kdl | 1 + .../input/unbalanced_raw_hashes.kdl | 1 + .../input/underscore_at_start_of_fraction.kdl | 1 + .../input/underscore_at_start_of_hex.kdl | 1 + .../input/underscore_before_number.kdl | 1 + .../input/underscore_in_exponent.kdl | 1 + .../2.0.0.draft/input/underscore_in_float.kdl | 1 + .../input/underscore_in_fraction.kdl | 1 + .../2.0.0.draft/input/underscore_in_int.kdl | 1 + .../2.0.0.draft/input/underscore_in_octal.kdl | 1 + .../2.0.0.draft/input/unicode_delete.kdl | 2 ++ .../input/unicode_equals_signs.kdl | 4 +++ .../2.0.0.draft/input/unicode_fsi.kdl | 2 ++ .../2.0.0.draft/input/unicode_lre.kdl | 2 ++ .../2.0.0.draft/input/unicode_lri.kdl | 2 ++ .../2.0.0.draft/input/unicode_lrm.kdl | 2 ++ .../2.0.0.draft/input/unicode_lro.kdl | 2 ++ .../2.0.0.draft/input/unicode_pdf.kdl | 2 ++ .../2.0.0.draft/input/unicode_pdi.kdl | 2 ++ .../2.0.0.draft/input/unicode_rle.kdl | 2 ++ .../2.0.0.draft/input/unicode_rli.kdl | 2 ++ .../2.0.0.draft/input/unicode_rlm.kdl | 2 ++ .../2.0.0.draft/input/unicode_rlo.kdl | 2 ++ .../2.0.0.draft/input/unicode_under_0x20.kdl | 2 ++ .../unusual_bare_id_chars_in_quoted_id.kdl | 1 + .../input/unusual_chars_in_bare_id.kdl | 1 + .../input/vertical_tab_whitespace.kdl | 1 + .../upstream/2.0.0.draft/input/zero_arg.kdl | 1 + .../upstream/2.0.0.draft/input/zero_float.kdl | 1 + .../upstream/2.0.0.draft/input/zero_int.kdl | 1 + 476 files changed, 672 insertions(+), 9 deletions(-) create mode 100644 tests/test_documents/upstream/2.0.0.draft/.gitattributes create mode 100644 tests/test_documents/upstream/2.0.0.draft/COPYING create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/all_escapes.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/all_node_fields.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/arg_and_prop_same_name.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/arg_bare.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/arg_false_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/arg_float_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/arg_hex_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/arg_null_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/arg_raw_string_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/arg_string_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/arg_true_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/arg_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/arg_zero_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/asterisk_in_block_comment.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/bare_emoji.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/bare_ident_dot.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/bare_ident_sign.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/bare_ident_sign_dot.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/binary.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/binary_trailing_underscore.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/binary_underscore.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/blank_arg_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/blank_node_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/blank_prop_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/block_comment.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/block_comment_after_node.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/block_comment_before_node.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/block_comment_before_node_no_space.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/block_comment_newline.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/bom_initial.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/boolean_arg.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/boolean_prop.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/chevrons_in_bare_id.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/comma_in_bare_id.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/comment_after_arg_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/comment_after_node_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/comment_after_prop_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/comment_and_newline.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/comment_in_arg_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/comment_in_node_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/comment_in_prop_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/commented_arg.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/commented_child.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/commented_line.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/commented_node.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/commented_prop.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/crlf_between_nodes.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/dash_dash.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/emoji.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/empty.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/empty_child.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/empty_child_different_lines.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/empty_child_same_line.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/empty_child_whitespace.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/empty_line_comment.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/empty_quoted_node_id.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/empty_quoted_prop_key.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/empty_string_arg.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/eof_after_escape.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/esc_newline_in_string.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/esc_unicode_in_string.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/escaped_whitespace.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/escline.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/escline_line_comment.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/escline_node.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/false_prefix_in_bare_id.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/false_prefix_in_prop_key.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/floating_point_keywords.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/hex.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/hex_int.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/hex_int_underscores.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/hex_leading_zero.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/initial_slashdash.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/int_multiple_underscore.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/just_block_comment.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/just_child.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/just_newline.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/just_node_id.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/just_space.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/leading_newline.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/leading_zero_binary.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/leading_zero_int.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/leading_zero_oct.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/multiline_comment.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/multiline_nodes.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/multiline_raw_string.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/multiline_raw_string_indented.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/multiline_string.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/multiline_string_indented.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/negative_exponent.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/negative_float.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/negative_int.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/nested_block_comment.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/nested_children.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/nested_comments.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/nested_multiline_block_comment.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/newline_between_nodes.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/newlines_in_block_comment.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/no_decimal_exponent.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/node_false.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/node_true.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/node_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/null_arg.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/null_prefix_in_bare_id.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/null_prefix_in_prop_key.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/null_prop.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/numeric_arg.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/numeric_prop.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/octal.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/only_cr.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/only_line_comment.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/only_line_comment_crlf.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/only_line_comment_newline.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/optional_child_semicolon.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/parse_all_arg_types.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/positive_exponent.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/positive_int.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/preserve_duplicate_nodes.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/preserve_node_order.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/prop_false_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/prop_float_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/prop_hex_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/prop_identifier_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/prop_null_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/prop_raw_string_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/prop_string_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/prop_true_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/prop_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/prop_zero_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/question_mark_before_number.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/quoted_arg_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/quoted_node_name.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/quoted_node_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/quoted_numeric.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/quoted_prop_name.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/quoted_prop_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/r_node.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_arg_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_node_name.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_node_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_prop_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_string_arg.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_string_backslash.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_string_hash_no_esc.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_string_just_backslash.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_string_just_quote.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_string_multiple_hash.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_string_newline.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_string_prop.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_string_quote.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/repeated_arg.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/repeated_prop.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/same_name_nodes.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/sci_notation_large.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/sci_notation_small.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/semicolon_after_child.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/semicolon_in_child.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/semicolon_separated.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/semicolon_separated_nodes.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/semicolon_terminated.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/single_arg.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/single_prop.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_arg_after_newline_esc.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_arg_before_newline_esc.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_child.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_empty_child.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_full_node.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_in_slashdash.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_negative_number.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_node_in_child.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_node_with_child.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_only_node.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_only_node_with_space.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_prop.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_raw_prop_key.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_repeated_prop.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/space_after_arg_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/space_after_node_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/space_after_prop_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/space_around_prop_marker.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/space_in_arg_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/space_in_node_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/space_in_prop_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/string_arg.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/string_escaped_literal_whitespace.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/string_prop.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/tab_space.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/trailing_crlf.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/trailing_underscore_hex.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/trailing_underscore_octal.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/true_prefix_in_bare_id.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/true_prefix_in_prop_key.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/two_nodes.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/underscore_before_number.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/underscore_in_exponent.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/underscore_in_float.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/underscore_in_fraction.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/underscore_in_int.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/underscore_in_octal.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/unicode_equals_signs.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/unusual_bare_id_chars_in_quoted_id.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/unusual_chars_in_bare_id.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/vertical_tab_whitespace.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/zero_arg.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/zero_float.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/expected_kdl/zero_int.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/all_escapes.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/all_node_fields.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/arg_and_prop_same_name.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/arg_bare.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/arg_false_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/arg_float_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/arg_hex_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/arg_null_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/arg_raw_string_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/arg_string_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/arg_true_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/arg_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/arg_zero_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/asterisk_in_block_comment.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/bare_emoji.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/bare_ident_dot.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/bare_ident_numeric.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/bare_ident_numeric_dot.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/bare_ident_numeric_sign.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/bare_ident_sign.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/bare_ident_sign_dot.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/binary.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/binary_trailing_underscore.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/binary_underscore.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/blank_arg_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/blank_node_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/blank_prop_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/block_comment.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/block_comment_after_node.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/block_comment_before_node.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/block_comment_before_node_no_space.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/block_comment_newline.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/bom_initial.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/bom_later.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/boolean_arg.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/boolean_prop.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/brackets_in_bare_id.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/chevrons_in_bare_id.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/comma_in_bare_id.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/comment_after_arg_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/comment_after_node_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/comment_after_prop_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/comment_and_newline.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/comment_in_arg_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/comment_in_node_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/comment_in_prop_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/commented_arg.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/commented_child.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/commented_line.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/commented_node.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/commented_prop.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/crlf_between_nodes.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/dash_dash.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/dot_but_no_fraction.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/dot_but_no_fraction_before_exponent.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/dot_in_exponent.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/dot_zero.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/emoji.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/empty.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/empty_arg_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/empty_child.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/empty_child_different_lines.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/empty_child_same_line.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/empty_child_whitespace.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/empty_line_comment.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/empty_node_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/empty_prop_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/empty_quoted_node_id.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/empty_quoted_prop_key.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/empty_string_arg.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/eof_after_escape.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/err_backslash_in_bare_id.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/esc_newline_in_string.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/esc_unicode_in_string.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/escaped_whitespace.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/escline.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/escline_line_comment.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/escline_node.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/false_prefix_in_bare_id.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/false_prefix_in_prop_key.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/false_prop_key.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/floating_point_keyword_identifier_strings_error.kdl.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/floating_point_keywords.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/hash_in_id.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/hex.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/hex_int.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/hex_int_underscores.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/hex_leading_zero.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/illegal_char_in_binary.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/illegal_char_in_hex.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/illegal_char_in_octal.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/initial_slashdash.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/int_multiple_underscore.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/just_block_comment.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/just_child.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/just_newline.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/just_node_id.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/just_space.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/just_space_in_arg_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/just_space_in_node_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/just_space_in_prop_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/just_type_no_arg.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/just_type_no_node_id.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/just_type_no_prop.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/leading_newline.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/leading_zero_binary.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/leading_zero_int.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/leading_zero_oct.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/multiline_comment.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/multiline_nodes.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/multiline_raw_string.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/multiline_raw_string_indented.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/multiline_raw_string_non_matching_prefix_character_error.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/multiline_raw_string_non_matching_prefix_count_error.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/multiline_string.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/multiline_string_indented.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/multiline_string_non_matching_prefix_character_error.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/multiline_string_non_matching_prefix_count_error.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/multiple_dots_in_float.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/multiple_dots_in_float_before_exponent.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/multiple_es_in_float.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/multiple_x_in_hex.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/negative_exponent.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/negative_float.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/negative_int.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/nested_block_comment.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/nested_children.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/nested_comments.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/nested_multiline_block_comment.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/newline_between_nodes.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/newlines_in_block_comment.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/no_decimal_exponent.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/no_digits_in_hex.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/no_integer_digit.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/no_solidus_escape.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/node_false.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/node_true.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/node_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/null_arg.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/null_prefix_in_bare_id.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/null_prefix_in_prop_key.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/null_prop.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/null_prop_key.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/numeric_arg.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/numeric_prop.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/octal.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/only_cr.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/only_line_comment.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/only_line_comment_crlf.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/only_line_comment_newline.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/optional_child_semicolon.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/parens_in_bare_id.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/parse_all_arg_types.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/positive_exponent.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/positive_int.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/preserve_duplicate_nodes.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/preserve_node_order.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/prop_false_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/prop_float_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/prop_hex_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/prop_identifier_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/prop_null_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/prop_raw_string_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/prop_string_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/prop_true_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/prop_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/prop_zero_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/question_mark_before_number.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/quote_in_bare_id.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/quoted_arg_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/quoted_node_name.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/quoted_node_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/quoted_numeric.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/quoted_prop_name.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/quoted_prop_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/r_node.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/raw_arg_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/raw_node_name.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/raw_node_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/raw_prop_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/raw_string_arg.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/raw_string_backslash.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/raw_string_hash_no_esc.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/raw_string_just_backslash.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/raw_string_just_quote.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/raw_string_multiple_hash.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/raw_string_newline.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/raw_string_prop.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/raw_string_quote.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/repeated_arg.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/repeated_prop.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/same_name_nodes.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/sci_notation_large.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/sci_notation_small.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/semicolon_after_child.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/semicolon_in_child.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/semicolon_separated.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/semicolon_separated_nodes.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/semicolon_terminated.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/single_arg.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/single_prop.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/slash_in_bare_id.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/slashdash_arg_after_newline_esc.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/slashdash_arg_before_newline_esc.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/slashdash_child.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/slashdash_empty_child.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/slashdash_full_node.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/slashdash_in_slashdash.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/slashdash_negative_number.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/slashdash_node_in_child.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/slashdash_node_with_child.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/slashdash_only_node.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/slashdash_only_node_with_space.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/slashdash_prop.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/slashdash_raw_prop_key.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/slashdash_repeated_prop.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/space_after_arg_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/space_after_node_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/space_after_prop_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/space_around_prop_marker.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/space_in_arg_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/space_in_node_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/space_in_prop_type.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/square_bracket_in_bare_id.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/string_arg.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/string_escaped_literal_whitespace.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/string_prop.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/tab_space.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/trailing_crlf.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/trailing_underscore_hex.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/trailing_underscore_octal.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/true_prefix_in_bare_id.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/true_prefix_in_prop_key.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/true_prop_key.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/two_nodes.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/type_before_prop_key.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/unbalanced_raw_hashes.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/underscore_at_start_of_fraction.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/underscore_at_start_of_hex.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/underscore_before_number.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/underscore_in_exponent.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/underscore_in_float.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/underscore_in_fraction.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/underscore_in_int.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/underscore_in_octal.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/unicode_delete.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/unicode_equals_signs.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/unicode_fsi.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/unicode_lre.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/unicode_lri.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/unicode_lrm.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/unicode_lro.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/unicode_pdf.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/unicode_pdi.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/unicode_rle.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/unicode_rli.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/unicode_rlm.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/unicode_rlo.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/unicode_under_0x20.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/unusual_bare_id_chars_in_quoted_id.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/unusual_chars_in_bare_id.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/vertical_tab_whitespace.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/zero_arg.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/zero_float.kdl create mode 100644 tests/test_documents/upstream/2.0.0.draft/input/zero_int.kdl diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 23c0b87..1d22693 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -115,17 +115,34 @@ add_test(kdlv2_test kdlv2_test) #### set(KDL_TEST_CASES_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/test_documents/upstream/1.0.0) # Ignore some tests which require unsupported number representations -set(FUZZY_KDL_TESTS_LIST +set(FUZZY_KDL_TESTS_LIST_V1 no_decimal_exponent.kdl # float representation not consistent with other test cases ) -string(REPLACE ";" ":" FUZZY_KDL_TESTS "${FUZZY_KDL_TESTS_LIST}") +string(REPLACE ";" ":" FUZZY_KDL_TESTS_V1 "${FUZZY_KDL_TESTS_LIST_V1}") -add_executable(example_doc_test example_doc_test.c) -target_link_libraries(example_doc_test kdl test_util ckdl-cat) -target_compile_definitions(example_doc_test PRIVATE +add_executable(example_doc_test_v1 example_doc_test.c) +target_link_libraries(example_doc_test_v1 kdl test_util ckdl-cat) +target_compile_definitions(example_doc_test_v1 PRIVATE "KDL_TEST_CASES_ROOT=\"${KDL_TEST_CASES_ROOT}\"" - "FUZZY_KDL_TESTS=\"${FUZZY_KDL_TESTS}\"") -add_test(NAME example_doc_test COMMAND "$" "${KDL_TEST_CASES_ROOT}") + "FUZZY_KDL_TESTS=\"${FUZZY_KDL_TESTS_V1}\"" + "KDL_VERSION=KDL_VERSION_1") +add_test(NAME example_doc_test_v1 COMMAND "$" "${KDL_TEST_CASES_ROOT}") +################################################# +# Upstream test suite for KDL version 2.0.0 +#### +set(KDL_TEST_CASES_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/test_documents/upstream/2.0.0.draft) +# Ignore some tests which require unsupported number representations +set(FUZZY_KDL_TESTS_LIST_V2 +) +string(REPLACE ";" ":" FUZZY_KDL_TESTS_V2 "${FUZZY_KDL_TESTS_LIST_V2}") + +add_executable(example_doc_test_v2 example_doc_test.c) +target_link_libraries(example_doc_test_v2 kdl test_util ckdl-cat) +target_compile_definitions(example_doc_test_v2 PRIVATE + "KDL_TEST_CASES_ROOT=\"${KDL_TEST_CASES_ROOT}\"" + "FUZZY_KDL_TESTS=\"${FUZZY_KDL_TESTS_V2}\"" + "KDL_VERSION=KDL_VERSION_2") +# add_test(NAME example_doc_test_v2 COMMAND "$" "${KDL_TEST_CASES_ROOT}") ################################################# if (WIN32 AND BUILD_SHARED_LIBS) diff --git a/tests/example_doc_test.c b/tests/example_doc_test.c index fee1195..ddb68c9 100644 --- a/tests/example_doc_test.c +++ b/tests/example_doc_test.c @@ -1,3 +1,7 @@ +#ifndef KDL_VERSION +# define KDL_VERSION KDL_VERSION_1 +#endif + #include "fs_util.h" #include "test_util.h" @@ -39,11 +43,14 @@ static void do_test_case(void* user_data) test_opts.float_mode.capital_e = true; test_opts.float_mode.always_write_decimal_point = true; test_opts.float_mode.exponent_plus = true; + test_opts.version = KDL_VERSION; + + kdl_parse_option parse_opts = KDL_VERSION == KDL_VERSION_1 ? KDL_READ_VERSION_1 : KDL_READ_VERSION_2; struct test_case* tc = (struct test_case*)user_data; FILE* in = fopen(tc->input_path, "r"); ASSERT(in != NULL); - kdl_owned_string s = kdl_cat_file_to_string_opt(in, &test_opts); + kdl_owned_string s = kdl_cat_file_to_string_ex(in, parse_opts, &test_opts); if (tc->ground_truth_path == NULL) { // parse error expected ASSERT2(s.data == NULL, "Parsing should fail"); diff --git a/tests/test_documents/upstream/1.0.0/COPYING b/tests/test_documents/upstream/1.0.0/COPYING index 94fcf2f..0c02db7 100644 --- a/tests/test_documents/upstream/1.0.0/COPYING +++ b/tests/test_documents/upstream/1.0.0/COPYING @@ -1 +1,6 @@ -The KDL version 1.0.0 test suite was taken from the https://github.com/kdl-org/kdl repository. It is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. +The KDL version 1.0.0 test suite was taken from the +https://github.com/kdl-org/kdl repository. It is licensed under the +Creative Commons Attribution-ShareAlike 4.0 International License. +To view a copy of this license, visit +http://creativecommons.org/licenses/by-sa/4.0/ or send a letter to +Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. diff --git a/tests/test_documents/upstream/2.0.0.draft/.gitattributes b/tests/test_documents/upstream/2.0.0.draft/.gitattributes new file mode 100644 index 0000000..e1c25e4 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/.gitattributes @@ -0,0 +1 @@ +*.kdl -text \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/COPYING b/tests/test_documents/upstream/2.0.0.draft/COPYING new file mode 100644 index 0000000..0c02db7 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/COPYING @@ -0,0 +1,6 @@ +The KDL version 1.0.0 test suite was taken from the +https://github.com/kdl-org/kdl repository. It is licensed under the +Creative Commons Attribution-ShareAlike 4.0 International License. +To view a copy of this license, visit +http://creativecommons.org/licenses/by-sa/4.0/ or send a letter to +Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/all_escapes.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/all_escapes.kdl new file mode 100644 index 0000000..de0d0a0 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/all_escapes.kdl @@ -0,0 +1 @@ +node "\"\\\b\f\n\r\t " diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/all_node_fields.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/all_node_fields.kdl new file mode 100644 index 0000000..9f4ceb5 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/all_node_fields.kdl @@ -0,0 +1,3 @@ +node arg prop=val { + inner_node +} diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/arg_and_prop_same_name.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/arg_and_prop_same_name.kdl new file mode 100644 index 0000000..ee5ace5 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/arg_and_prop_same_name.kdl @@ -0,0 +1 @@ +node arg arg=val diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/arg_bare.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/arg_bare.kdl new file mode 100644 index 0000000..2fa9785 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/arg_bare.kdl @@ -0,0 +1 @@ +node a diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/arg_false_type.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/arg_false_type.kdl new file mode 100644 index 0000000..92003d9 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/arg_false_type.kdl @@ -0,0 +1 @@ +node (type)#false diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/arg_float_type.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/arg_float_type.kdl new file mode 100644 index 0000000..d670786 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/arg_float_type.kdl @@ -0,0 +1 @@ +node (type)2.5 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/arg_hex_type.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/arg_hex_type.kdl new file mode 100644 index 0000000..b1a494a --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/arg_hex_type.kdl @@ -0,0 +1 @@ +node (type)16 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/arg_null_type.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/arg_null_type.kdl new file mode 100644 index 0000000..cd66101 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/arg_null_type.kdl @@ -0,0 +1 @@ +node (type)#null diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/arg_raw_string_type.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/arg_raw_string_type.kdl new file mode 100644 index 0000000..a4859b6 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/arg_raw_string_type.kdl @@ -0,0 +1 @@ +node (type)str diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/arg_string_type.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/arg_string_type.kdl new file mode 100644 index 0000000..a4859b6 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/arg_string_type.kdl @@ -0,0 +1 @@ +node (type)str diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/arg_true_type.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/arg_true_type.kdl new file mode 100644 index 0000000..20243a3 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/arg_true_type.kdl @@ -0,0 +1 @@ +node (type)#true diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/arg_type.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/arg_type.kdl new file mode 100644 index 0000000..79a093d --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/arg_type.kdl @@ -0,0 +1 @@ +node (type)arg diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/arg_zero_type.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/arg_zero_type.kdl new file mode 100644 index 0000000..73b2702 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/arg_zero_type.kdl @@ -0,0 +1 @@ +node (type)0 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/asterisk_in_block_comment.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/asterisk_in_block_comment.kdl new file mode 100644 index 0000000..64f5a0a --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/asterisk_in_block_comment.kdl @@ -0,0 +1 @@ +node diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/bare_emoji.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/bare_emoji.kdl new file mode 100644 index 0000000..c67d0b9 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/bare_emoji.kdl @@ -0,0 +1 @@ +😁 happy! diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/bare_ident_dot.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/bare_ident_dot.kdl new file mode 100644 index 0000000..4ea1fa6 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/bare_ident_dot.kdl @@ -0,0 +1 @@ +node . diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/bare_ident_sign.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/bare_ident_sign.kdl new file mode 100644 index 0000000..34594d7 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/bare_ident_sign.kdl @@ -0,0 +1 @@ +node + diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/bare_ident_sign_dot.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/bare_ident_sign_dot.kdl new file mode 100644 index 0000000..a37a5c3 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/bare_ident_sign_dot.kdl @@ -0,0 +1 @@ +node +. diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/binary.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/binary.kdl new file mode 100644 index 0000000..d14213e --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/binary.kdl @@ -0,0 +1 @@ +node 2 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/binary_trailing_underscore.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/binary_trailing_underscore.kdl new file mode 100644 index 0000000..d14213e --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/binary_trailing_underscore.kdl @@ -0,0 +1 @@ +node 2 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/binary_underscore.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/binary_underscore.kdl new file mode 100644 index 0000000..d14213e --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/binary_underscore.kdl @@ -0,0 +1 @@ +node 2 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/blank_arg_type.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/blank_arg_type.kdl new file mode 100644 index 0000000..8c6fb21 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/blank_arg_type.kdl @@ -0,0 +1 @@ +node ("")10 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/blank_node_type.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/blank_node_type.kdl new file mode 100644 index 0000000..6b064a6 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/blank_node_type.kdl @@ -0,0 +1 @@ +("")node diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/blank_prop_type.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/blank_prop_type.kdl new file mode 100644 index 0000000..e00c6d2 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/blank_prop_type.kdl @@ -0,0 +1 @@ +node key=("")#true diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/block_comment.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/block_comment.kdl new file mode 100644 index 0000000..1b3db2c --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/block_comment.kdl @@ -0,0 +1 @@ +node arg diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/block_comment_after_node.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/block_comment_after_node.kdl new file mode 100644 index 0000000..1b3db2c --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/block_comment_after_node.kdl @@ -0,0 +1 @@ +node arg diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/block_comment_before_node.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/block_comment_before_node.kdl new file mode 100644 index 0000000..64f5a0a --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/block_comment_before_node.kdl @@ -0,0 +1 @@ +node diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/block_comment_before_node_no_space.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/block_comment_before_node_no_space.kdl new file mode 100644 index 0000000..64f5a0a --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/block_comment_before_node_no_space.kdl @@ -0,0 +1 @@ +node diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/block_comment_newline.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/block_comment_newline.kdl new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/block_comment_newline.kdl @@ -0,0 +1 @@ + diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/bom_initial.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/bom_initial.kdl new file mode 100644 index 0000000..1b3db2c --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/bom_initial.kdl @@ -0,0 +1 @@ +node arg diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/boolean_arg.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/boolean_arg.kdl new file mode 100644 index 0000000..e0cdf1a --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/boolean_arg.kdl @@ -0,0 +1 @@ +node #false #true diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/boolean_prop.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/boolean_prop.kdl new file mode 100644 index 0000000..f89da9b --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/boolean_prop.kdl @@ -0,0 +1 @@ +node prop1=#true prop2=#false diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/chevrons_in_bare_id.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/chevrons_in_bare_id.kdl new file mode 100644 index 0000000..58b2436 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/chevrons_in_bare_id.kdl @@ -0,0 +1 @@ +foo123foo weeee diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/comma_in_bare_id.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/comma_in_bare_id.kdl new file mode 100644 index 0000000..86c78fd --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/comma_in_bare_id.kdl @@ -0,0 +1 @@ +foo123,bar weeee diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/comment_after_arg_type.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/comment_after_arg_type.kdl new file mode 100644 index 0000000..51dcb98 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/comment_after_arg_type.kdl @@ -0,0 +1 @@ +node (type)10 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/comment_after_node_type.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/comment_after_node_type.kdl new file mode 100644 index 0000000..c790643 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/comment_after_node_type.kdl @@ -0,0 +1 @@ +(type)node diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/comment_after_prop_type.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/comment_after_prop_type.kdl new file mode 100644 index 0000000..843551b --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/comment_after_prop_type.kdl @@ -0,0 +1 @@ +node key=(type)10 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/comment_and_newline.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/comment_and_newline.kdl new file mode 100644 index 0000000..1c5b5f3 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/comment_and_newline.kdl @@ -0,0 +1,2 @@ +node1 +node2 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/comment_in_arg_type.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/comment_in_arg_type.kdl new file mode 100644 index 0000000..51dcb98 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/comment_in_arg_type.kdl @@ -0,0 +1 @@ +node (type)10 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/comment_in_node_type.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/comment_in_node_type.kdl new file mode 100644 index 0000000..c790643 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/comment_in_node_type.kdl @@ -0,0 +1 @@ +(type)node diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/comment_in_prop_type.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/comment_in_prop_type.kdl new file mode 100644 index 0000000..843551b --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/comment_in_prop_type.kdl @@ -0,0 +1 @@ +node key=(type)10 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/commented_arg.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/commented_arg.kdl new file mode 100644 index 0000000..2e98005 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/commented_arg.kdl @@ -0,0 +1 @@ +node arg2 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/commented_child.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/commented_child.kdl new file mode 100644 index 0000000..1b3db2c --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/commented_child.kdl @@ -0,0 +1 @@ +node arg diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/commented_line.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/commented_line.kdl new file mode 100644 index 0000000..2fa08cd --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/commented_line.kdl @@ -0,0 +1 @@ +node_2 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/commented_node.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/commented_node.kdl new file mode 100644 index 0000000..2fa08cd --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/commented_node.kdl @@ -0,0 +1 @@ +node_2 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/commented_prop.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/commented_prop.kdl new file mode 100644 index 0000000..1b3db2c --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/commented_prop.kdl @@ -0,0 +1 @@ +node arg diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/crlf_between_nodes.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/crlf_between_nodes.kdl new file mode 100644 index 0000000..1c5b5f3 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/crlf_between_nodes.kdl @@ -0,0 +1,2 @@ +node1 +node2 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/dash_dash.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/dash_dash.kdl new file mode 100644 index 0000000..9f6111a --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/dash_dash.kdl @@ -0,0 +1 @@ +node -- diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/emoji.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/emoji.kdl new file mode 100644 index 0000000..88df78a --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/emoji.kdl @@ -0,0 +1 @@ +node 😀 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/empty.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/empty.kdl new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/empty.kdl @@ -0,0 +1 @@ + diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/empty_child.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/empty_child.kdl new file mode 100644 index 0000000..64f5a0a --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/empty_child.kdl @@ -0,0 +1 @@ +node diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/empty_child_different_lines.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/empty_child_different_lines.kdl new file mode 100644 index 0000000..64f5a0a --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/empty_child_different_lines.kdl @@ -0,0 +1 @@ +node diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/empty_child_same_line.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/empty_child_same_line.kdl new file mode 100644 index 0000000..64f5a0a --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/empty_child_same_line.kdl @@ -0,0 +1 @@ +node diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/empty_child_whitespace.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/empty_child_whitespace.kdl new file mode 100644 index 0000000..64f5a0a --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/empty_child_whitespace.kdl @@ -0,0 +1 @@ +node diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/empty_line_comment.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/empty_line_comment.kdl new file mode 100644 index 0000000..64f5a0a --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/empty_line_comment.kdl @@ -0,0 +1 @@ +node diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/empty_quoted_node_id.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/empty_quoted_node_id.kdl new file mode 100644 index 0000000..94694bc --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/empty_quoted_node_id.kdl @@ -0,0 +1 @@ +"" arg diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/empty_quoted_prop_key.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/empty_quoted_prop_key.kdl new file mode 100644 index 0000000..e541793 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/empty_quoted_prop_key.kdl @@ -0,0 +1 @@ +node ""=empty diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/empty_string_arg.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/empty_string_arg.kdl new file mode 100644 index 0000000..8ade134 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/empty_string_arg.kdl @@ -0,0 +1 @@ +node "" diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/eof_after_escape.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/eof_after_escape.kdl new file mode 100644 index 0000000..64f5a0a --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/eof_after_escape.kdl @@ -0,0 +1 @@ +node diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/esc_newline_in_string.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/esc_newline_in_string.kdl new file mode 100644 index 0000000..fd38cb0 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/esc_newline_in_string.kdl @@ -0,0 +1 @@ +node "hello\nworld" diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/esc_unicode_in_string.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/esc_unicode_in_string.kdl new file mode 100644 index 0000000..fd38cb0 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/esc_unicode_in_string.kdl @@ -0,0 +1 @@ +node "hello\nworld" diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/escaped_whitespace.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/escaped_whitespace.kdl new file mode 100644 index 0000000..45dd408 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/escaped_whitespace.kdl @@ -0,0 +1 @@ +node "Hello\n\tWorld" "Hello\n\tWorld" "Hello\n\tWorld" "Hello\n\tWorld" "Hello\n\tWorld" diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/escline.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/escline.kdl new file mode 100644 index 0000000..1b3db2c --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/escline.kdl @@ -0,0 +1 @@ +node arg diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/escline_line_comment.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/escline_line_comment.kdl new file mode 100644 index 0000000..4d38bee --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/escline_line_comment.kdl @@ -0,0 +1 @@ +node arg arg2 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/escline_node.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/escline_node.kdl new file mode 100644 index 0000000..1c5b5f3 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/escline_node.kdl @@ -0,0 +1,2 @@ +node1 +node2 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/false_prefix_in_bare_id.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/false_prefix_in_bare_id.kdl new file mode 100644 index 0000000..cd962c4 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/false_prefix_in_bare_id.kdl @@ -0,0 +1 @@ +false_id diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/false_prefix_in_prop_key.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/false_prefix_in_prop_key.kdl new file mode 100644 index 0000000..2d29843 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/false_prefix_in_prop_key.kdl @@ -0,0 +1 @@ +node false_id=1 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/floating_point_keywords.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/floating_point_keywords.kdl new file mode 100644 index 0000000..973a259 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/floating_point_keywords.kdl @@ -0,0 +1 @@ +floats #inf #-inf #nan diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/hex.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/hex.kdl new file mode 100644 index 0000000..bcbc7ff --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/hex.kdl @@ -0,0 +1 @@ +node 12379813812177893520 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/hex_int.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/hex_int.kdl new file mode 100644 index 0000000..f8dcee1 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/hex_int.kdl @@ -0,0 +1 @@ +node 207698809136909011942886895 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/hex_int_underscores.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/hex_int_underscores.kdl new file mode 100644 index 0000000..78f3ce0 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/hex_int_underscores.kdl @@ -0,0 +1 @@ +node 737894400291 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/hex_leading_zero.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/hex_leading_zero.kdl new file mode 100644 index 0000000..d20bd7d --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/hex_leading_zero.kdl @@ -0,0 +1 @@ +node 1 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/initial_slashdash.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/initial_slashdash.kdl new file mode 100644 index 0000000..d74a990 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/initial_slashdash.kdl @@ -0,0 +1 @@ +another-node diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/int_multiple_underscore.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/int_multiple_underscore.kdl new file mode 100644 index 0000000..37cf4bf --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/int_multiple_underscore.kdl @@ -0,0 +1 @@ +node 1234 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/just_block_comment.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/just_block_comment.kdl new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/just_block_comment.kdl @@ -0,0 +1 @@ + diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/just_child.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/just_child.kdl new file mode 100644 index 0000000..ee79536 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/just_child.kdl @@ -0,0 +1,3 @@ +node { + inner_node +} diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/just_newline.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/just_newline.kdl new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/just_newline.kdl @@ -0,0 +1 @@ + diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/just_node_id.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/just_node_id.kdl new file mode 100644 index 0000000..64f5a0a --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/just_node_id.kdl @@ -0,0 +1 @@ +node diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/just_space.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/just_space.kdl new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/just_space.kdl @@ -0,0 +1 @@ + diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/leading_newline.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/leading_newline.kdl new file mode 100644 index 0000000..64f5a0a --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/leading_newline.kdl @@ -0,0 +1 @@ +node diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/leading_zero_binary.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/leading_zero_binary.kdl new file mode 100644 index 0000000..d20bd7d --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/leading_zero_binary.kdl @@ -0,0 +1 @@ +node 1 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/leading_zero_int.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/leading_zero_int.kdl new file mode 100644 index 0000000..0526c15 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/leading_zero_int.kdl @@ -0,0 +1 @@ +node 11 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/leading_zero_oct.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/leading_zero_oct.kdl new file mode 100644 index 0000000..d20bd7d --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/leading_zero_oct.kdl @@ -0,0 +1 @@ +node 1 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/multiline_comment.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/multiline_comment.kdl new file mode 100644 index 0000000..1b3db2c --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/multiline_comment.kdl @@ -0,0 +1 @@ +node arg diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/multiline_nodes.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/multiline_nodes.kdl new file mode 100644 index 0000000..7c27fb0 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/multiline_nodes.kdl @@ -0,0 +1 @@ +node arg1 arg2 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/multiline_raw_string.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/multiline_raw_string.kdl new file mode 100644 index 0000000..3c31c47 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/multiline_raw_string.kdl @@ -0,0 +1 @@ +node "hey\neveryone\nhow goes?" diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/multiline_raw_string_indented.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/multiline_raw_string_indented.kdl new file mode 100644 index 0000000..f693b84 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/multiline_raw_string_indented.kdl @@ -0,0 +1 @@ +node " hey\n everyone\n how goes?" diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/multiline_string.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/multiline_string.kdl new file mode 100644 index 0000000..3c31c47 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/multiline_string.kdl @@ -0,0 +1 @@ +node "hey\neveryone\nhow goes?" diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/multiline_string_indented.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/multiline_string_indented.kdl new file mode 100644 index 0000000..f693b84 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/multiline_string_indented.kdl @@ -0,0 +1 @@ +node " hey\n everyone\n how goes?" diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/negative_exponent.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/negative_exponent.kdl new file mode 100644 index 0000000..aae8926 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/negative_exponent.kdl @@ -0,0 +1 @@ +node 1.0E-10 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/negative_float.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/negative_float.kdl new file mode 100644 index 0000000..c6a4cc5 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/negative_float.kdl @@ -0,0 +1 @@ +node -1.0 key=-10.0 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/negative_int.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/negative_int.kdl new file mode 100644 index 0000000..269da03 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/negative_int.kdl @@ -0,0 +1 @@ +node -10 prop=-15 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/nested_block_comment.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/nested_block_comment.kdl new file mode 100644 index 0000000..1b3db2c --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/nested_block_comment.kdl @@ -0,0 +1 @@ +node arg diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/nested_children.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/nested_children.kdl new file mode 100644 index 0000000..e44720d --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/nested_children.kdl @@ -0,0 +1,5 @@ +node1 { + node2 { + node + } +} diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/nested_comments.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/nested_comments.kdl new file mode 100644 index 0000000..1b3db2c --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/nested_comments.kdl @@ -0,0 +1 @@ +node arg diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/nested_multiline_block_comment.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/nested_multiline_block_comment.kdl new file mode 100644 index 0000000..1b3db2c --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/nested_multiline_block_comment.kdl @@ -0,0 +1 @@ +node arg diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/newline_between_nodes.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/newline_between_nodes.kdl new file mode 100644 index 0000000..1c5b5f3 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/newline_between_nodes.kdl @@ -0,0 +1,2 @@ +node1 +node2 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/newlines_in_block_comment.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/newlines_in_block_comment.kdl new file mode 100644 index 0000000..1b3db2c --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/newlines_in_block_comment.kdl @@ -0,0 +1 @@ +node arg diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/no_decimal_exponent.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/no_decimal_exponent.kdl new file mode 100644 index 0000000..ddf1aa6 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/no_decimal_exponent.kdl @@ -0,0 +1 @@ +node 1E+10 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/node_false.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/node_false.kdl new file mode 100644 index 0000000..3bab782 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/node_false.kdl @@ -0,0 +1 @@ +node #false diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/node_true.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/node_true.kdl new file mode 100644 index 0000000..de00dcd --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/node_true.kdl @@ -0,0 +1 @@ +node #true diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/node_type.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/node_type.kdl new file mode 100644 index 0000000..c790643 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/node_type.kdl @@ -0,0 +1 @@ +(type)node diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/null_arg.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/null_arg.kdl new file mode 100644 index 0000000..bed8dbf --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/null_arg.kdl @@ -0,0 +1 @@ +node #null diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/null_prefix_in_bare_id.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/null_prefix_in_bare_id.kdl new file mode 100644 index 0000000..9e0cf15 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/null_prefix_in_bare_id.kdl @@ -0,0 +1 @@ +null_id diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/null_prefix_in_prop_key.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/null_prefix_in_prop_key.kdl new file mode 100644 index 0000000..1e1472b --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/null_prefix_in_prop_key.kdl @@ -0,0 +1 @@ +node null_id=1 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/null_prop.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/null_prop.kdl new file mode 100644 index 0000000..c463e98 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/null_prop.kdl @@ -0,0 +1 @@ +node prop=#null diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/numeric_arg.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/numeric_arg.kdl new file mode 100644 index 0000000..33bfe55 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/numeric_arg.kdl @@ -0,0 +1 @@ +node 15.7 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/numeric_prop.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/numeric_prop.kdl new file mode 100644 index 0000000..934ae83 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/numeric_prop.kdl @@ -0,0 +1 @@ +node prop=10.0 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/octal.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/octal.kdl new file mode 100644 index 0000000..225217b --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/octal.kdl @@ -0,0 +1 @@ +node 16434824 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/only_cr.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/only_cr.kdl new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/only_cr.kdl @@ -0,0 +1 @@ + diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/only_line_comment.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/only_line_comment.kdl new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/only_line_comment.kdl @@ -0,0 +1 @@ + diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/only_line_comment_crlf.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/only_line_comment_crlf.kdl new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/only_line_comment_crlf.kdl @@ -0,0 +1 @@ + diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/only_line_comment_newline.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/only_line_comment_newline.kdl new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/only_line_comment_newline.kdl @@ -0,0 +1 @@ + diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/optional_child_semicolon.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/optional_child_semicolon.kdl new file mode 100644 index 0000000..25eaa7d --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/optional_child_semicolon.kdl @@ -0,0 +1,5 @@ +node { + foo + bar + baz +} diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/parse_all_arg_types.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/parse_all_arg_types.kdl new file mode 100644 index 0000000..773df95 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/parse_all_arg_types.kdl @@ -0,0 +1 @@ +node 1 1.0 1.0E+10 1.0E-10 1 7 2 arg arg "arg\\" #true #false #null diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/positive_exponent.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/positive_exponent.kdl new file mode 100644 index 0000000..46dc2b9 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/positive_exponent.kdl @@ -0,0 +1 @@ +node 1.0E+10 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/positive_int.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/positive_int.kdl new file mode 100644 index 0000000..5b622c0 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/positive_int.kdl @@ -0,0 +1 @@ +node 10 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/preserve_duplicate_nodes.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/preserve_duplicate_nodes.kdl new file mode 100644 index 0000000..3e545b1 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/preserve_duplicate_nodes.kdl @@ -0,0 +1,2 @@ +node +node diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/preserve_node_order.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/preserve_node_order.kdl new file mode 100644 index 0000000..24c817f --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/preserve_node_order.kdl @@ -0,0 +1,3 @@ +node2 +node5 +node1 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/prop_false_type.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/prop_false_type.kdl new file mode 100644 index 0000000..eb544ef --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/prop_false_type.kdl @@ -0,0 +1 @@ +node key=(type)#false diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/prop_float_type.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/prop_float_type.kdl new file mode 100644 index 0000000..79243ec --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/prop_float_type.kdl @@ -0,0 +1 @@ +node key=(type)2.5E+10 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/prop_hex_type.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/prop_hex_type.kdl new file mode 100644 index 0000000..05bef6f --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/prop_hex_type.kdl @@ -0,0 +1 @@ +node key=(type)16 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/prop_identifier_type.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/prop_identifier_type.kdl new file mode 100644 index 0000000..7df052b --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/prop_identifier_type.kdl @@ -0,0 +1 @@ +node key=(type)str diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/prop_null_type.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/prop_null_type.kdl new file mode 100644 index 0000000..1c25b6f --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/prop_null_type.kdl @@ -0,0 +1 @@ +node key=(type)#null diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/prop_raw_string_type.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/prop_raw_string_type.kdl new file mode 100644 index 0000000..7df052b --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/prop_raw_string_type.kdl @@ -0,0 +1 @@ +node key=(type)str diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/prop_string_type.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/prop_string_type.kdl new file mode 100644 index 0000000..7df052b --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/prop_string_type.kdl @@ -0,0 +1 @@ +node key=(type)str diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/prop_true_type.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/prop_true_type.kdl new file mode 100644 index 0000000..01404b8 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/prop_true_type.kdl @@ -0,0 +1 @@ +node key=(type)#true diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/prop_type.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/prop_type.kdl new file mode 100644 index 0000000..01404b8 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/prop_type.kdl @@ -0,0 +1 @@ +node key=(type)#true diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/prop_zero_type.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/prop_zero_type.kdl new file mode 100644 index 0000000..ad243ed --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/prop_zero_type.kdl @@ -0,0 +1 @@ +node key=(type)0 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/question_mark_before_number.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/question_mark_before_number.kdl new file mode 100644 index 0000000..7745a9e --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/question_mark_before_number.kdl @@ -0,0 +1 @@ +node ?15 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/quoted_arg_type.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/quoted_arg_type.kdl new file mode 100644 index 0000000..49ffc6a --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/quoted_arg_type.kdl @@ -0,0 +1 @@ +node ("type/")10 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/quoted_node_name.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/quoted_node_name.kdl new file mode 100644 index 0000000..672e7ff --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/quoted_node_name.kdl @@ -0,0 +1 @@ +"0node" diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/quoted_node_type.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/quoted_node_type.kdl new file mode 100644 index 0000000..c66d905 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/quoted_node_type.kdl @@ -0,0 +1 @@ +("type/")node diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/quoted_numeric.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/quoted_numeric.kdl new file mode 100644 index 0000000..fa0ed33 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/quoted_numeric.kdl @@ -0,0 +1 @@ +node prop="10.0" diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/quoted_prop_name.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/quoted_prop_name.kdl new file mode 100644 index 0000000..8ee5e08 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/quoted_prop_name.kdl @@ -0,0 +1 @@ +node "0prop"=val diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/quoted_prop_type.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/quoted_prop_type.kdl new file mode 100644 index 0000000..beca5f2 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/quoted_prop_type.kdl @@ -0,0 +1 @@ +node key=("type/")#true diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/r_node.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/r_node.kdl new file mode 100644 index 0000000..282cc04 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/r_node.kdl @@ -0,0 +1 @@ +r arg diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_arg_type.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_arg_type.kdl new file mode 100644 index 0000000..20243a3 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_arg_type.kdl @@ -0,0 +1 @@ +node (type)#true diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_node_name.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_node_name.kdl new file mode 100644 index 0000000..984061e --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_node_name.kdl @@ -0,0 +1 @@ +"\\node" diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_node_type.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_node_type.kdl new file mode 100644 index 0000000..c790643 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_node_type.kdl @@ -0,0 +1 @@ +(type)node diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_prop_type.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_prop_type.kdl new file mode 100644 index 0000000..01404b8 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_prop_type.kdl @@ -0,0 +1 @@ +node key=(type)#true diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_string_arg.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_string_arg.kdl new file mode 100644 index 0000000..24f8d65 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_string_arg.kdl @@ -0,0 +1,2 @@ +node_1 "\"arg\\n\"and #stuff" +node_2 "#\"arg\\n\"#and #stuff" diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_string_backslash.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_string_backslash.kdl new file mode 100644 index 0000000..551cf10 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_string_backslash.kdl @@ -0,0 +1 @@ +node "\\n" diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_string_hash_no_esc.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_string_hash_no_esc.kdl new file mode 100644 index 0000000..9964729 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_string_hash_no_esc.kdl @@ -0,0 +1 @@ +node "#" diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_string_just_backslash.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_string_just_backslash.kdl new file mode 100644 index 0000000..5702080 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_string_just_backslash.kdl @@ -0,0 +1 @@ +node "\\" diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_string_just_quote.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_string_just_quote.kdl new file mode 100644 index 0000000..0a76315 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_string_just_quote.kdl @@ -0,0 +1 @@ +node "\"" diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_string_multiple_hash.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_string_multiple_hash.kdl new file mode 100644 index 0000000..1ba63d1 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_string_multiple_hash.kdl @@ -0,0 +1 @@ +node "\"#\"##" diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_string_newline.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_string_newline.kdl new file mode 100644 index 0000000..fd38cb0 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_string_newline.kdl @@ -0,0 +1 @@ +node "hello\nworld" diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_string_prop.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_string_prop.kdl new file mode 100644 index 0000000..6a1b5ee --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_string_prop.kdl @@ -0,0 +1,2 @@ +node_1 prop="\"arg#\"\\n" +node_2 prop="#\"arg#\"#\\n" diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_string_quote.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_string_quote.kdl new file mode 100644 index 0000000..d59edb6 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/raw_string_quote.kdl @@ -0,0 +1 @@ +node "a\"b" diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/repeated_arg.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/repeated_arg.kdl new file mode 100644 index 0000000..6525757 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/repeated_arg.kdl @@ -0,0 +1 @@ +node arg arg diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/repeated_prop.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/repeated_prop.kdl new file mode 100644 index 0000000..46c9236 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/repeated_prop.kdl @@ -0,0 +1 @@ +node prop=11 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/same_name_nodes.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/same_name_nodes.kdl new file mode 100644 index 0000000..3e545b1 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/same_name_nodes.kdl @@ -0,0 +1,2 @@ +node +node diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/sci_notation_large.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/sci_notation_large.kdl new file mode 100644 index 0000000..7fbb60d --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/sci_notation_large.kdl @@ -0,0 +1 @@ +node prop=1.23E+1000 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/sci_notation_small.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/sci_notation_small.kdl new file mode 100644 index 0000000..5bd062c --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/sci_notation_small.kdl @@ -0,0 +1 @@ +node prop=1.23E-1000 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/semicolon_after_child.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/semicolon_after_child.kdl new file mode 100644 index 0000000..e3346f1 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/semicolon_after_child.kdl @@ -0,0 +1,3 @@ +node { + childnode +} diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/semicolon_in_child.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/semicolon_in_child.kdl new file mode 100644 index 0000000..9d8395e --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/semicolon_in_child.kdl @@ -0,0 +1,3 @@ +node1 { + node2 +} diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/semicolon_separated.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/semicolon_separated.kdl new file mode 100644 index 0000000..1c5b5f3 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/semicolon_separated.kdl @@ -0,0 +1,2 @@ +node1 +node2 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/semicolon_separated_nodes.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/semicolon_separated_nodes.kdl new file mode 100644 index 0000000..1c5b5f3 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/semicolon_separated_nodes.kdl @@ -0,0 +1,2 @@ +node1 +node2 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/semicolon_terminated.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/semicolon_terminated.kdl new file mode 100644 index 0000000..f50c4f2 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/semicolon_terminated.kdl @@ -0,0 +1 @@ +node1 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/single_arg.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/single_arg.kdl new file mode 100644 index 0000000..1b3db2c --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/single_arg.kdl @@ -0,0 +1 @@ +node arg diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/single_prop.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/single_prop.kdl new file mode 100644 index 0000000..282aa3b --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/single_prop.kdl @@ -0,0 +1 @@ +node prop=val diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_arg_after_newline_esc.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_arg_after_newline_esc.kdl new file mode 100644 index 0000000..2e98005 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_arg_after_newline_esc.kdl @@ -0,0 +1 @@ +node arg2 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_arg_before_newline_esc.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_arg_before_newline_esc.kdl new file mode 100644 index 0000000..64f5a0a --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_arg_before_newline_esc.kdl @@ -0,0 +1 @@ +node diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_child.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_child.kdl new file mode 100644 index 0000000..64f5a0a --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_child.kdl @@ -0,0 +1 @@ +node diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_empty_child.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_empty_child.kdl new file mode 100644 index 0000000..64f5a0a --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_empty_child.kdl @@ -0,0 +1 @@ +node diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_full_node.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_full_node.kdl new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_full_node.kdl @@ -0,0 +1 @@ + diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_in_slashdash.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_in_slashdash.kdl new file mode 100644 index 0000000..6810417 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_in_slashdash.kdl @@ -0,0 +1 @@ +node2 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_negative_number.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_negative_number.kdl new file mode 100644 index 0000000..b76b862 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_negative_number.kdl @@ -0,0 +1 @@ +node 2.0 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_node_in_child.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_node_in_child.kdl new file mode 100644 index 0000000..f50c4f2 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_node_in_child.kdl @@ -0,0 +1 @@ +node1 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_node_with_child.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_node_with_child.kdl new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_node_with_child.kdl @@ -0,0 +1 @@ + diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_only_node.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_only_node.kdl new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_only_node.kdl @@ -0,0 +1 @@ + diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_only_node_with_space.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_only_node_with_space.kdl new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_only_node_with_space.kdl @@ -0,0 +1 @@ + diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_prop.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_prop.kdl new file mode 100644 index 0000000..1b3db2c --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_prop.kdl @@ -0,0 +1 @@ +node arg diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_raw_prop_key.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_raw_prop_key.kdl new file mode 100644 index 0000000..64f5a0a --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_raw_prop_key.kdl @@ -0,0 +1 @@ +node diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_repeated_prop.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_repeated_prop.kdl new file mode 100644 index 0000000..dce25a7 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/slashdash_repeated_prop.kdl @@ -0,0 +1 @@ +node arg=correct diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/space_after_arg_type.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/space_after_arg_type.kdl new file mode 100644 index 0000000..51dcb98 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/space_after_arg_type.kdl @@ -0,0 +1 @@ +node (type)10 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/space_after_node_type.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/space_after_node_type.kdl new file mode 100644 index 0000000..c790643 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/space_after_node_type.kdl @@ -0,0 +1 @@ +(type)node diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/space_after_prop_type.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/space_after_prop_type.kdl new file mode 100644 index 0000000..eb544ef --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/space_after_prop_type.kdl @@ -0,0 +1 @@ +node key=(type)#false diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/space_around_prop_marker.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/space_around_prop_marker.kdl new file mode 100644 index 0000000..30a026f --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/space_around_prop_marker.kdl @@ -0,0 +1 @@ +node foo=bar diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/space_in_arg_type.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/space_in_arg_type.kdl new file mode 100644 index 0000000..92003d9 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/space_in_arg_type.kdl @@ -0,0 +1 @@ +node (type)#false diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/space_in_node_type.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/space_in_node_type.kdl new file mode 100644 index 0000000..c790643 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/space_in_node_type.kdl @@ -0,0 +1 @@ +(type)node diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/space_in_prop_type.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/space_in_prop_type.kdl new file mode 100644 index 0000000..eb544ef --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/space_in_prop_type.kdl @@ -0,0 +1 @@ +node key=(type)#false diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/string_arg.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/string_arg.kdl new file mode 100644 index 0000000..1b3db2c --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/string_arg.kdl @@ -0,0 +1 @@ +node arg diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/string_escaped_literal_whitespace.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/string_escaped_literal_whitespace.kdl new file mode 100644 index 0000000..3169ad9 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/string_escaped_literal_whitespace.kdl @@ -0,0 +1 @@ +node "Hello World Stuff" diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/string_prop.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/string_prop.kdl new file mode 100644 index 0000000..282aa3b --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/string_prop.kdl @@ -0,0 +1 @@ +node prop=val diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/tab_space.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/tab_space.kdl new file mode 100644 index 0000000..64f5a0a --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/tab_space.kdl @@ -0,0 +1 @@ +node diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/trailing_crlf.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/trailing_crlf.kdl new file mode 100644 index 0000000..64f5a0a --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/trailing_crlf.kdl @@ -0,0 +1 @@ +node diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/trailing_underscore_hex.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/trailing_underscore_hex.kdl new file mode 100644 index 0000000..f426d4d --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/trailing_underscore_hex.kdl @@ -0,0 +1 @@ +node 1194684 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/trailing_underscore_octal.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/trailing_underscore_octal.kdl new file mode 100644 index 0000000..9152a92 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/trailing_underscore_octal.kdl @@ -0,0 +1 @@ +node 83 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/true_prefix_in_bare_id.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/true_prefix_in_bare_id.kdl new file mode 100644 index 0000000..49c9d0d --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/true_prefix_in_bare_id.kdl @@ -0,0 +1 @@ +true_id diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/true_prefix_in_prop_key.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/true_prefix_in_prop_key.kdl new file mode 100644 index 0000000..2af7a1c --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/true_prefix_in_prop_key.kdl @@ -0,0 +1 @@ +node true_id=1 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/two_nodes.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/two_nodes.kdl new file mode 100644 index 0000000..1c5b5f3 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/two_nodes.kdl @@ -0,0 +1,2 @@ +node1 +node2 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/underscore_before_number.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/underscore_before_number.kdl new file mode 100644 index 0000000..788656b --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/underscore_before_number.kdl @@ -0,0 +1 @@ +node _15 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/underscore_in_exponent.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/underscore_in_exponent.kdl new file mode 100644 index 0000000..a5b975d --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/underscore_in_exponent.kdl @@ -0,0 +1 @@ +node 1.0E-100 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/underscore_in_float.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/underscore_in_float.kdl new file mode 100644 index 0000000..6aafd1c --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/underscore_in_float.kdl @@ -0,0 +1 @@ +node 11.0 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/underscore_in_fraction.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/underscore_in_fraction.kdl new file mode 100644 index 0000000..29bb938 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/underscore_in_fraction.kdl @@ -0,0 +1 @@ +node 1.02 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/underscore_in_int.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/underscore_in_int.kdl new file mode 100644 index 0000000..5b622c0 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/underscore_in_int.kdl @@ -0,0 +1 @@ +node 10 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/underscore_in_octal.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/underscore_in_octal.kdl new file mode 100644 index 0000000..f4f6039 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/underscore_in_octal.kdl @@ -0,0 +1 @@ +node 342391 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/unicode_equals_signs.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/unicode_equals_signs.kdl new file mode 100644 index 0000000..4ab6443 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/unicode_equals_signs.kdl @@ -0,0 +1 @@ +node p1=val1 p2=val2 p3=val3 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/unusual_bare_id_chars_in_quoted_id.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/unusual_bare_id_chars_in_quoted_id.kdl new file mode 100644 index 0000000..8321632 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/unusual_bare_id_chars_in_quoted_id.kdl @@ -0,0 +1 @@ +foo123~!@$%^&*.:'|?+<>, weeee diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/unusual_chars_in_bare_id.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/unusual_chars_in_bare_id.kdl new file mode 100644 index 0000000..8321632 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/unusual_chars_in_bare_id.kdl @@ -0,0 +1 @@ +foo123~!@$%^&*.:'|?+<>, weeee diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/vertical_tab_whitespace.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/vertical_tab_whitespace.kdl new file mode 100644 index 0000000..1b3db2c --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/vertical_tab_whitespace.kdl @@ -0,0 +1 @@ +node arg diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/zero_arg.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/zero_arg.kdl new file mode 100644 index 0000000..74405b6 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/zero_arg.kdl @@ -0,0 +1 @@ +node 0 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/zero_float.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/zero_float.kdl new file mode 100644 index 0000000..fd5b1f1 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/zero_float.kdl @@ -0,0 +1 @@ +node 0.0 diff --git a/tests/test_documents/upstream/2.0.0.draft/expected_kdl/zero_int.kdl b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/zero_int.kdl new file mode 100644 index 0000000..74405b6 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/expected_kdl/zero_int.kdl @@ -0,0 +1 @@ +node 0 diff --git a/tests/test_documents/upstream/2.0.0.draft/input/all_escapes.kdl b/tests/test_documents/upstream/2.0.0.draft/input/all_escapes.kdl new file mode 100644 index 0000000..5c49748 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/all_escapes.kdl @@ -0,0 +1 @@ +node "\"\\\b\f\n\r\t\s" diff --git a/tests/test_documents/upstream/2.0.0.draft/input/all_node_fields.kdl b/tests/test_documents/upstream/2.0.0.draft/input/all_node_fields.kdl new file mode 100644 index 0000000..9f4ceb5 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/all_node_fields.kdl @@ -0,0 +1,3 @@ +node arg prop=val { + inner_node +} diff --git a/tests/test_documents/upstream/2.0.0.draft/input/arg_and_prop_same_name.kdl b/tests/test_documents/upstream/2.0.0.draft/input/arg_and_prop_same_name.kdl new file mode 100644 index 0000000..ee5ace5 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/arg_and_prop_same_name.kdl @@ -0,0 +1 @@ +node arg arg=val diff --git a/tests/test_documents/upstream/2.0.0.draft/input/arg_bare.kdl b/tests/test_documents/upstream/2.0.0.draft/input/arg_bare.kdl new file mode 100644 index 0000000..2fa9785 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/arg_bare.kdl @@ -0,0 +1 @@ +node a diff --git a/tests/test_documents/upstream/2.0.0.draft/input/arg_false_type.kdl b/tests/test_documents/upstream/2.0.0.draft/input/arg_false_type.kdl new file mode 100644 index 0000000..92003d9 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/arg_false_type.kdl @@ -0,0 +1 @@ +node (type)#false diff --git a/tests/test_documents/upstream/2.0.0.draft/input/arg_float_type.kdl b/tests/test_documents/upstream/2.0.0.draft/input/arg_float_type.kdl new file mode 100644 index 0000000..fd6947e --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/arg_float_type.kdl @@ -0,0 +1 @@ +node (type)2.5 \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/arg_hex_type.kdl b/tests/test_documents/upstream/2.0.0.draft/input/arg_hex_type.kdl new file mode 100644 index 0000000..ec44f6c --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/arg_hex_type.kdl @@ -0,0 +1 @@ +node (type)0x10 diff --git a/tests/test_documents/upstream/2.0.0.draft/input/arg_null_type.kdl b/tests/test_documents/upstream/2.0.0.draft/input/arg_null_type.kdl new file mode 100644 index 0000000..cd66101 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/arg_null_type.kdl @@ -0,0 +1 @@ +node (type)#null diff --git a/tests/test_documents/upstream/2.0.0.draft/input/arg_raw_string_type.kdl b/tests/test_documents/upstream/2.0.0.draft/input/arg_raw_string_type.kdl new file mode 100644 index 0000000..c722312 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/arg_raw_string_type.kdl @@ -0,0 +1 @@ +node (type)#"str"# diff --git a/tests/test_documents/upstream/2.0.0.draft/input/arg_string_type.kdl b/tests/test_documents/upstream/2.0.0.draft/input/arg_string_type.kdl new file mode 100644 index 0000000..2808d53 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/arg_string_type.kdl @@ -0,0 +1 @@ +node (type)"str" diff --git a/tests/test_documents/upstream/2.0.0.draft/input/arg_true_type.kdl b/tests/test_documents/upstream/2.0.0.draft/input/arg_true_type.kdl new file mode 100644 index 0000000..20243a3 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/arg_true_type.kdl @@ -0,0 +1 @@ +node (type)#true diff --git a/tests/test_documents/upstream/2.0.0.draft/input/arg_type.kdl b/tests/test_documents/upstream/2.0.0.draft/input/arg_type.kdl new file mode 100644 index 0000000..79a093d --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/arg_type.kdl @@ -0,0 +1 @@ +node (type)arg diff --git a/tests/test_documents/upstream/2.0.0.draft/input/arg_zero_type.kdl b/tests/test_documents/upstream/2.0.0.draft/input/arg_zero_type.kdl new file mode 100644 index 0000000..73b2702 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/arg_zero_type.kdl @@ -0,0 +1 @@ +node (type)0 diff --git a/tests/test_documents/upstream/2.0.0.draft/input/asterisk_in_block_comment.kdl b/tests/test_documents/upstream/2.0.0.draft/input/asterisk_in_block_comment.kdl new file mode 100644 index 0000000..46ec76f --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/asterisk_in_block_comment.kdl @@ -0,0 +1 @@ +node /* * */ \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/bare_emoji.kdl b/tests/test_documents/upstream/2.0.0.draft/input/bare_emoji.kdl new file mode 100644 index 0000000..c67d0b9 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/bare_emoji.kdl @@ -0,0 +1 @@ +😁 happy! diff --git a/tests/test_documents/upstream/2.0.0.draft/input/bare_ident_dot.kdl b/tests/test_documents/upstream/2.0.0.draft/input/bare_ident_dot.kdl new file mode 100644 index 0000000..5c32f67 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/bare_ident_dot.kdl @@ -0,0 +1 @@ +node . \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/bare_ident_numeric.kdl b/tests/test_documents/upstream/2.0.0.draft/input/bare_ident_numeric.kdl new file mode 100644 index 0000000..053af21 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/bare_ident_numeric.kdl @@ -0,0 +1 @@ +node 0n \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/bare_ident_numeric_dot.kdl b/tests/test_documents/upstream/2.0.0.draft/input/bare_ident_numeric_dot.kdl new file mode 100644 index 0000000..b97afcf --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/bare_ident_numeric_dot.kdl @@ -0,0 +1 @@ +node .0n \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/bare_ident_numeric_sign.kdl b/tests/test_documents/upstream/2.0.0.draft/input/bare_ident_numeric_sign.kdl new file mode 100644 index 0000000..6cadc35 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/bare_ident_numeric_sign.kdl @@ -0,0 +1 @@ +node +0n \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/bare_ident_sign.kdl b/tests/test_documents/upstream/2.0.0.draft/input/bare_ident_sign.kdl new file mode 100644 index 0000000..b609706 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/bare_ident_sign.kdl @@ -0,0 +1 @@ +node + \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/bare_ident_sign_dot.kdl b/tests/test_documents/upstream/2.0.0.draft/input/bare_ident_sign_dot.kdl new file mode 100644 index 0000000..d50adcf --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/bare_ident_sign_dot.kdl @@ -0,0 +1 @@ +node +. \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/binary.kdl b/tests/test_documents/upstream/2.0.0.draft/input/binary.kdl new file mode 100644 index 0000000..bf12920 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/binary.kdl @@ -0,0 +1 @@ +node 0b10 \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/binary_trailing_underscore.kdl b/tests/test_documents/upstream/2.0.0.draft/input/binary_trailing_underscore.kdl new file mode 100644 index 0000000..6da7588 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/binary_trailing_underscore.kdl @@ -0,0 +1 @@ +node 0b10_ \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/binary_underscore.kdl b/tests/test_documents/upstream/2.0.0.draft/input/binary_underscore.kdl new file mode 100644 index 0000000..c914517 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/binary_underscore.kdl @@ -0,0 +1 @@ +node 0b1_0 diff --git a/tests/test_documents/upstream/2.0.0.draft/input/blank_arg_type.kdl b/tests/test_documents/upstream/2.0.0.draft/input/blank_arg_type.kdl new file mode 100644 index 0000000..0b298e6 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/blank_arg_type.kdl @@ -0,0 +1 @@ +node ("")10 \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/blank_node_type.kdl b/tests/test_documents/upstream/2.0.0.draft/input/blank_node_type.kdl new file mode 100644 index 0000000..6b064a6 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/blank_node_type.kdl @@ -0,0 +1 @@ +("")node diff --git a/tests/test_documents/upstream/2.0.0.draft/input/blank_prop_type.kdl b/tests/test_documents/upstream/2.0.0.draft/input/blank_prop_type.kdl new file mode 100644 index 0000000..e00c6d2 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/blank_prop_type.kdl @@ -0,0 +1 @@ +node key=("")#true diff --git a/tests/test_documents/upstream/2.0.0.draft/input/block_comment.kdl b/tests/test_documents/upstream/2.0.0.draft/input/block_comment.kdl new file mode 100644 index 0000000..f6c39ac --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/block_comment.kdl @@ -0,0 +1 @@ +node /* comment */ arg diff --git a/tests/test_documents/upstream/2.0.0.draft/input/block_comment_after_node.kdl b/tests/test_documents/upstream/2.0.0.draft/input/block_comment_after_node.kdl new file mode 100644 index 0000000..071ff21 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/block_comment_after_node.kdl @@ -0,0 +1 @@ +node /* hey */ arg diff --git a/tests/test_documents/upstream/2.0.0.draft/input/block_comment_before_node.kdl b/tests/test_documents/upstream/2.0.0.draft/input/block_comment_before_node.kdl new file mode 100644 index 0000000..5ad653e --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/block_comment_before_node.kdl @@ -0,0 +1 @@ +/* hey */ node \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/block_comment_before_node_no_space.kdl b/tests/test_documents/upstream/2.0.0.draft/input/block_comment_before_node_no_space.kdl new file mode 100644 index 0000000..1221234 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/block_comment_before_node_no_space.kdl @@ -0,0 +1 @@ +/* hey*/node diff --git a/tests/test_documents/upstream/2.0.0.draft/input/block_comment_newline.kdl b/tests/test_documents/upstream/2.0.0.draft/input/block_comment_newline.kdl new file mode 100644 index 0000000..14ac75d --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/block_comment_newline.kdl @@ -0,0 +1 @@ +/* hey */ diff --git a/tests/test_documents/upstream/2.0.0.draft/input/bom_initial.kdl b/tests/test_documents/upstream/2.0.0.draft/input/bom_initial.kdl new file mode 100644 index 0000000..e52e8bf --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/bom_initial.kdl @@ -0,0 +1 @@ +node arg diff --git a/tests/test_documents/upstream/2.0.0.draft/input/bom_later.kdl b/tests/test_documents/upstream/2.0.0.draft/input/bom_later.kdl new file mode 100644 index 0000000..6aeff8d --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/bom_later.kdl @@ -0,0 +1 @@ +node arg diff --git a/tests/test_documents/upstream/2.0.0.draft/input/boolean_arg.kdl b/tests/test_documents/upstream/2.0.0.draft/input/boolean_arg.kdl new file mode 100644 index 0000000..e0cdf1a --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/boolean_arg.kdl @@ -0,0 +1 @@ +node #false #true diff --git a/tests/test_documents/upstream/2.0.0.draft/input/boolean_prop.kdl b/tests/test_documents/upstream/2.0.0.draft/input/boolean_prop.kdl new file mode 100644 index 0000000..f89da9b --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/boolean_prop.kdl @@ -0,0 +1 @@ +node prop1=#true prop2=#false diff --git a/tests/test_documents/upstream/2.0.0.draft/input/brackets_in_bare_id.kdl b/tests/test_documents/upstream/2.0.0.draft/input/brackets_in_bare_id.kdl new file mode 100644 index 0000000..ebb78d2 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/brackets_in_bare_id.kdl @@ -0,0 +1 @@ +foo123{bar}foo weeee diff --git a/tests/test_documents/upstream/2.0.0.draft/input/chevrons_in_bare_id.kdl b/tests/test_documents/upstream/2.0.0.draft/input/chevrons_in_bare_id.kdl new file mode 100644 index 0000000..58b2436 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/chevrons_in_bare_id.kdl @@ -0,0 +1 @@ +foo123foo weeee diff --git a/tests/test_documents/upstream/2.0.0.draft/input/comma_in_bare_id.kdl b/tests/test_documents/upstream/2.0.0.draft/input/comma_in_bare_id.kdl new file mode 100644 index 0000000..86c78fd --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/comma_in_bare_id.kdl @@ -0,0 +1 @@ +foo123,bar weeee diff --git a/tests/test_documents/upstream/2.0.0.draft/input/comment_after_arg_type.kdl b/tests/test_documents/upstream/2.0.0.draft/input/comment_after_arg_type.kdl new file mode 100644 index 0000000..d493f6e --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/comment_after_arg_type.kdl @@ -0,0 +1 @@ +node (type)/*hey*/10 diff --git a/tests/test_documents/upstream/2.0.0.draft/input/comment_after_node_type.kdl b/tests/test_documents/upstream/2.0.0.draft/input/comment_after_node_type.kdl new file mode 100644 index 0000000..a5939b4 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/comment_after_node_type.kdl @@ -0,0 +1 @@ +(type)/*hey*/node diff --git a/tests/test_documents/upstream/2.0.0.draft/input/comment_after_prop_type.kdl b/tests/test_documents/upstream/2.0.0.draft/input/comment_after_prop_type.kdl new file mode 100644 index 0000000..6805673 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/comment_after_prop_type.kdl @@ -0,0 +1 @@ +node key=(type)/*hey*/10 diff --git a/tests/test_documents/upstream/2.0.0.draft/input/comment_and_newline.kdl b/tests/test_documents/upstream/2.0.0.draft/input/comment_and_newline.kdl new file mode 100644 index 0000000..d1bb77f --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/comment_and_newline.kdl @@ -0,0 +1,2 @@ +node1 // +node2 diff --git a/tests/test_documents/upstream/2.0.0.draft/input/comment_in_arg_type.kdl b/tests/test_documents/upstream/2.0.0.draft/input/comment_in_arg_type.kdl new file mode 100644 index 0000000..1166a43 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/comment_in_arg_type.kdl @@ -0,0 +1 @@ +node (type/*hey*/)10 diff --git a/tests/test_documents/upstream/2.0.0.draft/input/comment_in_node_type.kdl b/tests/test_documents/upstream/2.0.0.draft/input/comment_in_node_type.kdl new file mode 100644 index 0000000..7cc9b26 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/comment_in_node_type.kdl @@ -0,0 +1 @@ +(type/*hey*/)node diff --git a/tests/test_documents/upstream/2.0.0.draft/input/comment_in_prop_type.kdl b/tests/test_documents/upstream/2.0.0.draft/input/comment_in_prop_type.kdl new file mode 100644 index 0000000..0587da9 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/comment_in_prop_type.kdl @@ -0,0 +1 @@ +node key=(type/*hey*/)10 diff --git a/tests/test_documents/upstream/2.0.0.draft/input/commented_arg.kdl b/tests/test_documents/upstream/2.0.0.draft/input/commented_arg.kdl new file mode 100644 index 0000000..0e6157f --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/commented_arg.kdl @@ -0,0 +1 @@ +node /- arg1 arg2 diff --git a/tests/test_documents/upstream/2.0.0.draft/input/commented_child.kdl b/tests/test_documents/upstream/2.0.0.draft/input/commented_child.kdl new file mode 100644 index 0000000..8e873f7 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/commented_child.kdl @@ -0,0 +1,3 @@ +node arg /- { + inner_node +} diff --git a/tests/test_documents/upstream/2.0.0.draft/input/commented_line.kdl b/tests/test_documents/upstream/2.0.0.draft/input/commented_line.kdl new file mode 100644 index 0000000..bc8582c --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/commented_line.kdl @@ -0,0 +1,2 @@ +// node_1 +node_2 \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/commented_node.kdl b/tests/test_documents/upstream/2.0.0.draft/input/commented_node.kdl new file mode 100644 index 0000000..1460d67 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/commented_node.kdl @@ -0,0 +1,3 @@ +/- node_1 +node_2 +/- node_3 diff --git a/tests/test_documents/upstream/2.0.0.draft/input/commented_prop.kdl b/tests/test_documents/upstream/2.0.0.draft/input/commented_prop.kdl new file mode 100644 index 0000000..046fd9d --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/commented_prop.kdl @@ -0,0 +1 @@ +node /- prop=val arg diff --git a/tests/test_documents/upstream/2.0.0.draft/input/crlf_between_nodes.kdl b/tests/test_documents/upstream/2.0.0.draft/input/crlf_between_nodes.kdl new file mode 100644 index 0000000..148f7bc --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/crlf_between_nodes.kdl @@ -0,0 +1,2 @@ +node1 +node2 diff --git a/tests/test_documents/upstream/2.0.0.draft/input/dash_dash.kdl b/tests/test_documents/upstream/2.0.0.draft/input/dash_dash.kdl new file mode 100644 index 0000000..9f6111a --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/dash_dash.kdl @@ -0,0 +1 @@ +node -- diff --git a/tests/test_documents/upstream/2.0.0.draft/input/dot_but_no_fraction.kdl b/tests/test_documents/upstream/2.0.0.draft/input/dot_but_no_fraction.kdl new file mode 100644 index 0000000..48553fc --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/dot_but_no_fraction.kdl @@ -0,0 +1 @@ +node 1. \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/dot_but_no_fraction_before_exponent.kdl b/tests/test_documents/upstream/2.0.0.draft/input/dot_but_no_fraction_before_exponent.kdl new file mode 100644 index 0000000..8fb8fb8 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/dot_but_no_fraction_before_exponent.kdl @@ -0,0 +1 @@ +node 1.e7 \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/dot_in_exponent.kdl b/tests/test_documents/upstream/2.0.0.draft/input/dot_in_exponent.kdl new file mode 100644 index 0000000..fab0d78 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/dot_in_exponent.kdl @@ -0,0 +1 @@ +node 1.0.0 \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/dot_zero.kdl b/tests/test_documents/upstream/2.0.0.draft/input/dot_zero.kdl new file mode 100644 index 0000000..e8c0592 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/dot_zero.kdl @@ -0,0 +1 @@ +node .0 \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/emoji.kdl b/tests/test_documents/upstream/2.0.0.draft/input/emoji.kdl new file mode 100644 index 0000000..88df78a --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/emoji.kdl @@ -0,0 +1 @@ +node 😀 diff --git a/tests/test_documents/upstream/2.0.0.draft/input/empty.kdl b/tests/test_documents/upstream/2.0.0.draft/input/empty.kdl new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_documents/upstream/2.0.0.draft/input/empty_arg_type.kdl b/tests/test_documents/upstream/2.0.0.draft/input/empty_arg_type.kdl new file mode 100644 index 0000000..bf22b6d --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/empty_arg_type.kdl @@ -0,0 +1 @@ +node ()10 diff --git a/tests/test_documents/upstream/2.0.0.draft/input/empty_child.kdl b/tests/test_documents/upstream/2.0.0.draft/input/empty_child.kdl new file mode 100644 index 0000000..be1cc03 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/empty_child.kdl @@ -0,0 +1,2 @@ +node { +} \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/empty_child_different_lines.kdl b/tests/test_documents/upstream/2.0.0.draft/input/empty_child_different_lines.kdl new file mode 100644 index 0000000..be1cc03 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/empty_child_different_lines.kdl @@ -0,0 +1,2 @@ +node { +} \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/empty_child_same_line.kdl b/tests/test_documents/upstream/2.0.0.draft/input/empty_child_same_line.kdl new file mode 100644 index 0000000..efba1b1 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/empty_child_same_line.kdl @@ -0,0 +1 @@ +node {} \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/empty_child_whitespace.kdl b/tests/test_documents/upstream/2.0.0.draft/input/empty_child_whitespace.kdl new file mode 100644 index 0000000..405df30 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/empty_child_whitespace.kdl @@ -0,0 +1,3 @@ +node { + + } \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/empty_line_comment.kdl b/tests/test_documents/upstream/2.0.0.draft/input/empty_line_comment.kdl new file mode 100644 index 0000000..e62ef84 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/empty_line_comment.kdl @@ -0,0 +1,2 @@ +// +node \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/empty_node_type.kdl b/tests/test_documents/upstream/2.0.0.draft/input/empty_node_type.kdl new file mode 100644 index 0000000..e4163c0 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/empty_node_type.kdl @@ -0,0 +1 @@ +()node diff --git a/tests/test_documents/upstream/2.0.0.draft/input/empty_prop_type.kdl b/tests/test_documents/upstream/2.0.0.draft/input/empty_prop_type.kdl new file mode 100644 index 0000000..233480b --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/empty_prop_type.kdl @@ -0,0 +1 @@ +node key=()#false diff --git a/tests/test_documents/upstream/2.0.0.draft/input/empty_quoted_node_id.kdl b/tests/test_documents/upstream/2.0.0.draft/input/empty_quoted_node_id.kdl new file mode 100644 index 0000000..94694bc --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/empty_quoted_node_id.kdl @@ -0,0 +1 @@ +"" arg diff --git a/tests/test_documents/upstream/2.0.0.draft/input/empty_quoted_prop_key.kdl b/tests/test_documents/upstream/2.0.0.draft/input/empty_quoted_prop_key.kdl new file mode 100644 index 0000000..e541793 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/empty_quoted_prop_key.kdl @@ -0,0 +1 @@ +node ""=empty diff --git a/tests/test_documents/upstream/2.0.0.draft/input/empty_string_arg.kdl b/tests/test_documents/upstream/2.0.0.draft/input/empty_string_arg.kdl new file mode 100644 index 0000000..8ade134 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/empty_string_arg.kdl @@ -0,0 +1 @@ +node "" diff --git a/tests/test_documents/upstream/2.0.0.draft/input/eof_after_escape.kdl b/tests/test_documents/upstream/2.0.0.draft/input/eof_after_escape.kdl new file mode 100644 index 0000000..eed8d72 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/eof_after_escape.kdl @@ -0,0 +1 @@ +node \ diff --git a/tests/test_documents/upstream/2.0.0.draft/input/err_backslash_in_bare_id.kdl b/tests/test_documents/upstream/2.0.0.draft/input/err_backslash_in_bare_id.kdl new file mode 100644 index 0000000..2ea1a4b --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/err_backslash_in_bare_id.kdl @@ -0,0 +1 @@ +foo123\bar weeee diff --git a/tests/test_documents/upstream/2.0.0.draft/input/esc_newline_in_string.kdl b/tests/test_documents/upstream/2.0.0.draft/input/esc_newline_in_string.kdl new file mode 100644 index 0000000..393ee37 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/esc_newline_in_string.kdl @@ -0,0 +1 @@ +node "hello\nworld" \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/esc_unicode_in_string.kdl b/tests/test_documents/upstream/2.0.0.draft/input/esc_unicode_in_string.kdl new file mode 100644 index 0000000..285ed9c --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/esc_unicode_in_string.kdl @@ -0,0 +1 @@ +node "hello\u{0a}world" diff --git a/tests/test_documents/upstream/2.0.0.draft/input/escaped_whitespace.kdl b/tests/test_documents/upstream/2.0.0.draft/input/escaped_whitespace.kdl new file mode 100644 index 0000000..797784a --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/escaped_whitespace.kdl @@ -0,0 +1,15 @@ +// All of these strings are the same +node \ + "Hello\n\tWorld" \ + " + Hello + World + " \ + "Hello\n\ \tWorld" \ + "Hello\n\ + \tWorld" \ + "Hello\n\t\ + World" + +// Note that this file deliberately mixes space and newline indentation for +// test purposes diff --git a/tests/test_documents/upstream/2.0.0.draft/input/escline.kdl b/tests/test_documents/upstream/2.0.0.draft/input/escline.kdl new file mode 100644 index 0000000..bcd1a1a --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/escline.kdl @@ -0,0 +1,2 @@ +node \ + arg diff --git a/tests/test_documents/upstream/2.0.0.draft/input/escline_line_comment.kdl b/tests/test_documents/upstream/2.0.0.draft/input/escline_line_comment.kdl new file mode 100644 index 0000000..dc81b72 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/escline_line_comment.kdl @@ -0,0 +1,3 @@ +node \ // comment + arg \// comment + arg2 diff --git a/tests/test_documents/upstream/2.0.0.draft/input/escline_node.kdl b/tests/test_documents/upstream/2.0.0.draft/input/escline_node.kdl new file mode 100644 index 0000000..1c5b5f3 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/escline_node.kdl @@ -0,0 +1,2 @@ +node1 +node2 diff --git a/tests/test_documents/upstream/2.0.0.draft/input/false_prefix_in_bare_id.kdl b/tests/test_documents/upstream/2.0.0.draft/input/false_prefix_in_bare_id.kdl new file mode 100644 index 0000000..cd962c4 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/false_prefix_in_bare_id.kdl @@ -0,0 +1 @@ +false_id diff --git a/tests/test_documents/upstream/2.0.0.draft/input/false_prefix_in_prop_key.kdl b/tests/test_documents/upstream/2.0.0.draft/input/false_prefix_in_prop_key.kdl new file mode 100644 index 0000000..2d29843 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/false_prefix_in_prop_key.kdl @@ -0,0 +1 @@ +node false_id=1 diff --git a/tests/test_documents/upstream/2.0.0.draft/input/false_prop_key.kdl b/tests/test_documents/upstream/2.0.0.draft/input/false_prop_key.kdl new file mode 100644 index 0000000..a032c0b --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/false_prop_key.kdl @@ -0,0 +1 @@ +node false=1 diff --git a/tests/test_documents/upstream/2.0.0.draft/input/floating_point_keyword_identifier_strings_error.kdl.kdl b/tests/test_documents/upstream/2.0.0.draft/input/floating_point_keyword_identifier_strings_error.kdl.kdl new file mode 100644 index 0000000..e120167 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/floating_point_keyword_identifier_strings_error.kdl.kdl @@ -0,0 +1 @@ +floats inf -inf nan diff --git a/tests/test_documents/upstream/2.0.0.draft/input/floating_point_keywords.kdl b/tests/test_documents/upstream/2.0.0.draft/input/floating_point_keywords.kdl new file mode 100644 index 0000000..973a259 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/floating_point_keywords.kdl @@ -0,0 +1 @@ +floats #inf #-inf #nan diff --git a/tests/test_documents/upstream/2.0.0.draft/input/hash_in_id.kdl b/tests/test_documents/upstream/2.0.0.draft/input/hash_in_id.kdl new file mode 100644 index 0000000..e1119be --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/hash_in_id.kdl @@ -0,0 +1 @@ +foo#bar weee diff --git a/tests/test_documents/upstream/2.0.0.draft/input/hex.kdl b/tests/test_documents/upstream/2.0.0.draft/input/hex.kdl new file mode 100644 index 0000000..ec764dd --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/hex.kdl @@ -0,0 +1 @@ +node 0xabcdef1234567890 \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/hex_int.kdl b/tests/test_documents/upstream/2.0.0.draft/input/hex_int.kdl new file mode 100644 index 0000000..c2f421a --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/hex_int.kdl @@ -0,0 +1 @@ +node 0xABCDEF0123456789abcdef diff --git a/tests/test_documents/upstream/2.0.0.draft/input/hex_int_underscores.kdl b/tests/test_documents/upstream/2.0.0.draft/input/hex_int_underscores.kdl new file mode 100644 index 0000000..8b7bd68 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/hex_int_underscores.kdl @@ -0,0 +1 @@ +node 0xABC_def_0123 \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/hex_leading_zero.kdl b/tests/test_documents/upstream/2.0.0.draft/input/hex_leading_zero.kdl new file mode 100644 index 0000000..b2c98d0 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/hex_leading_zero.kdl @@ -0,0 +1 @@ +node 0x01 \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/illegal_char_in_binary.kdl b/tests/test_documents/upstream/2.0.0.draft/input/illegal_char_in_binary.kdl new file mode 100644 index 0000000..1f4bd50 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/illegal_char_in_binary.kdl @@ -0,0 +1 @@ +node 0bx01 diff --git a/tests/test_documents/upstream/2.0.0.draft/input/illegal_char_in_hex.kdl b/tests/test_documents/upstream/2.0.0.draft/input/illegal_char_in_hex.kdl new file mode 100644 index 0000000..b55e1a6 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/illegal_char_in_hex.kdl @@ -0,0 +1 @@ +node 0x10g10 \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/illegal_char_in_octal.kdl b/tests/test_documents/upstream/2.0.0.draft/input/illegal_char_in_octal.kdl new file mode 100644 index 0000000..4e36196 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/illegal_char_in_octal.kdl @@ -0,0 +1 @@ +node 0o45678 \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/initial_slashdash.kdl b/tests/test_documents/upstream/2.0.0.draft/input/initial_slashdash.kdl new file mode 100644 index 0000000..aadeeb7 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/initial_slashdash.kdl @@ -0,0 +1,2 @@ +/-node here +another-node diff --git a/tests/test_documents/upstream/2.0.0.draft/input/int_multiple_underscore.kdl b/tests/test_documents/upstream/2.0.0.draft/input/int_multiple_underscore.kdl new file mode 100644 index 0000000..04ded62 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/int_multiple_underscore.kdl @@ -0,0 +1 @@ +node 1_2_3_4 \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/just_block_comment.kdl b/tests/test_documents/upstream/2.0.0.draft/input/just_block_comment.kdl new file mode 100644 index 0000000..4015df6 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/just_block_comment.kdl @@ -0,0 +1 @@ +/* hey */ \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/just_child.kdl b/tests/test_documents/upstream/2.0.0.draft/input/just_child.kdl new file mode 100644 index 0000000..444022e --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/just_child.kdl @@ -0,0 +1,3 @@ +node { + inner_node +} \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/just_newline.kdl b/tests/test_documents/upstream/2.0.0.draft/input/just_newline.kdl new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/just_newline.kdl @@ -0,0 +1 @@ + diff --git a/tests/test_documents/upstream/2.0.0.draft/input/just_node_id.kdl b/tests/test_documents/upstream/2.0.0.draft/input/just_node_id.kdl new file mode 100644 index 0000000..32b6e49 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/just_node_id.kdl @@ -0,0 +1 @@ +node \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/just_space.kdl b/tests/test_documents/upstream/2.0.0.draft/input/just_space.kdl new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/just_space.kdl @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/just_space_in_arg_type.kdl b/tests/test_documents/upstream/2.0.0.draft/input/just_space_in_arg_type.kdl new file mode 100644 index 0000000..38c9217 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/just_space_in_arg_type.kdl @@ -0,0 +1 @@ +node ( )false diff --git a/tests/test_documents/upstream/2.0.0.draft/input/just_space_in_node_type.kdl b/tests/test_documents/upstream/2.0.0.draft/input/just_space_in_node_type.kdl new file mode 100644 index 0000000..8fb5d89 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/just_space_in_node_type.kdl @@ -0,0 +1 @@ +( )node diff --git a/tests/test_documents/upstream/2.0.0.draft/input/just_space_in_prop_type.kdl b/tests/test_documents/upstream/2.0.0.draft/input/just_space_in_prop_type.kdl new file mode 100644 index 0000000..e42645f --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/just_space_in_prop_type.kdl @@ -0,0 +1 @@ +node key=( )0x10 diff --git a/tests/test_documents/upstream/2.0.0.draft/input/just_type_no_arg.kdl b/tests/test_documents/upstream/2.0.0.draft/input/just_type_no_arg.kdl new file mode 100644 index 0000000..a36c881 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/just_type_no_arg.kdl @@ -0,0 +1 @@ +node (type) diff --git a/tests/test_documents/upstream/2.0.0.draft/input/just_type_no_node_id.kdl b/tests/test_documents/upstream/2.0.0.draft/input/just_type_no_node_id.kdl new file mode 100644 index 0000000..9b03c44 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/just_type_no_node_id.kdl @@ -0,0 +1 @@ +(type) diff --git a/tests/test_documents/upstream/2.0.0.draft/input/just_type_no_prop.kdl b/tests/test_documents/upstream/2.0.0.draft/input/just_type_no_prop.kdl new file mode 100644 index 0000000..eab7fc6 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/just_type_no_prop.kdl @@ -0,0 +1 @@ +node key=(type) diff --git a/tests/test_documents/upstream/2.0.0.draft/input/leading_newline.kdl b/tests/test_documents/upstream/2.0.0.draft/input/leading_newline.kdl new file mode 100644 index 0000000..fce4a83 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/leading_newline.kdl @@ -0,0 +1,2 @@ + +node \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/leading_zero_binary.kdl b/tests/test_documents/upstream/2.0.0.draft/input/leading_zero_binary.kdl new file mode 100644 index 0000000..fa8209d --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/leading_zero_binary.kdl @@ -0,0 +1 @@ +node 0b01 diff --git a/tests/test_documents/upstream/2.0.0.draft/input/leading_zero_int.kdl b/tests/test_documents/upstream/2.0.0.draft/input/leading_zero_int.kdl new file mode 100644 index 0000000..b4e520a --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/leading_zero_int.kdl @@ -0,0 +1 @@ +node 011 diff --git a/tests/test_documents/upstream/2.0.0.draft/input/leading_zero_oct.kdl b/tests/test_documents/upstream/2.0.0.draft/input/leading_zero_oct.kdl new file mode 100644 index 0000000..d0eb382 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/leading_zero_oct.kdl @@ -0,0 +1 @@ +node 0o01 diff --git a/tests/test_documents/upstream/2.0.0.draft/input/multiline_comment.kdl b/tests/test_documents/upstream/2.0.0.draft/input/multiline_comment.kdl new file mode 100644 index 0000000..5fbb80b --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/multiline_comment.kdl @@ -0,0 +1,4 @@ +node /* +some +comments +*/ arg diff --git a/tests/test_documents/upstream/2.0.0.draft/input/multiline_nodes.kdl b/tests/test_documents/upstream/2.0.0.draft/input/multiline_nodes.kdl new file mode 100644 index 0000000..eae83d1 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/multiline_nodes.kdl @@ -0,0 +1,3 @@ +node \ + arg1 \// comment + arg2 diff --git a/tests/test_documents/upstream/2.0.0.draft/input/multiline_raw_string.kdl b/tests/test_documents/upstream/2.0.0.draft/input/multiline_raw_string.kdl new file mode 100644 index 0000000..eaa212e --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/multiline_raw_string.kdl @@ -0,0 +1,5 @@ +node #" +hey +everyone +how goes? +"# diff --git a/tests/test_documents/upstream/2.0.0.draft/input/multiline_raw_string_indented.kdl b/tests/test_documents/upstream/2.0.0.draft/input/multiline_raw_string_indented.kdl new file mode 100644 index 0000000..67ef76d --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/multiline_raw_string_indented.kdl @@ -0,0 +1,5 @@ +node #" + hey + everyone + how goes? + "# diff --git a/tests/test_documents/upstream/2.0.0.draft/input/multiline_raw_string_non_matching_prefix_character_error.kdl b/tests/test_documents/upstream/2.0.0.draft/input/multiline_raw_string_non_matching_prefix_character_error.kdl new file mode 100644 index 0000000..c5650e9 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/multiline_raw_string_non_matching_prefix_character_error.kdl @@ -0,0 +1,5 @@ +node #" + hey + everyone + how goes? + "# diff --git a/tests/test_documents/upstream/2.0.0.draft/input/multiline_raw_string_non_matching_prefix_count_error.kdl b/tests/test_documents/upstream/2.0.0.draft/input/multiline_raw_string_non_matching_prefix_count_error.kdl new file mode 100644 index 0000000..c0f4f56 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/multiline_raw_string_non_matching_prefix_count_error.kdl @@ -0,0 +1,5 @@ +node #" + hey + everyone + how goes? + "# diff --git a/tests/test_documents/upstream/2.0.0.draft/input/multiline_string.kdl b/tests/test_documents/upstream/2.0.0.draft/input/multiline_string.kdl new file mode 100644 index 0000000..e3a6cc1 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/multiline_string.kdl @@ -0,0 +1,5 @@ +node " +hey +everyone +how goes? +" diff --git a/tests/test_documents/upstream/2.0.0.draft/input/multiline_string_indented.kdl b/tests/test_documents/upstream/2.0.0.draft/input/multiline_string_indented.kdl new file mode 100644 index 0000000..ce9ca16 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/multiline_string_indented.kdl @@ -0,0 +1,5 @@ +node " + hey + everyone + how goes? + " diff --git a/tests/test_documents/upstream/2.0.0.draft/input/multiline_string_non_matching_prefix_character_error.kdl b/tests/test_documents/upstream/2.0.0.draft/input/multiline_string_non_matching_prefix_character_error.kdl new file mode 100644 index 0000000..1c2ca85 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/multiline_string_non_matching_prefix_character_error.kdl @@ -0,0 +1,5 @@ +node " + hey + everyone + how goes? + " diff --git a/tests/test_documents/upstream/2.0.0.draft/input/multiline_string_non_matching_prefix_count_error.kdl b/tests/test_documents/upstream/2.0.0.draft/input/multiline_string_non_matching_prefix_count_error.kdl new file mode 100644 index 0000000..86a2867 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/multiline_string_non_matching_prefix_count_error.kdl @@ -0,0 +1,5 @@ +node " + hey + everyone + how goes? + " diff --git a/tests/test_documents/upstream/2.0.0.draft/input/multiple_dots_in_float.kdl b/tests/test_documents/upstream/2.0.0.draft/input/multiple_dots_in_float.kdl new file mode 100644 index 0000000..fab0d78 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/multiple_dots_in_float.kdl @@ -0,0 +1 @@ +node 1.0.0 \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/multiple_dots_in_float_before_exponent.kdl b/tests/test_documents/upstream/2.0.0.draft/input/multiple_dots_in_float_before_exponent.kdl new file mode 100644 index 0000000..434af05 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/multiple_dots_in_float_before_exponent.kdl @@ -0,0 +1 @@ +node 1.0.0e7 \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/multiple_es_in_float.kdl b/tests/test_documents/upstream/2.0.0.draft/input/multiple_es_in_float.kdl new file mode 100644 index 0000000..6506c5c --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/multiple_es_in_float.kdl @@ -0,0 +1 @@ +node 1.0E10e10 diff --git a/tests/test_documents/upstream/2.0.0.draft/input/multiple_x_in_hex.kdl b/tests/test_documents/upstream/2.0.0.draft/input/multiple_x_in_hex.kdl new file mode 100644 index 0000000..013d805 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/multiple_x_in_hex.kdl @@ -0,0 +1 @@ +node 0xx10 \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/negative_exponent.kdl b/tests/test_documents/upstream/2.0.0.draft/input/negative_exponent.kdl new file mode 100644 index 0000000..6790669 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/negative_exponent.kdl @@ -0,0 +1 @@ +node 1.0e-10 \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/negative_float.kdl b/tests/test_documents/upstream/2.0.0.draft/input/negative_float.kdl new file mode 100644 index 0000000..5536e1f --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/negative_float.kdl @@ -0,0 +1 @@ +node -1.0 key=-10.0 \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/negative_int.kdl b/tests/test_documents/upstream/2.0.0.draft/input/negative_int.kdl new file mode 100644 index 0000000..c71a208 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/negative_int.kdl @@ -0,0 +1 @@ +node -10 prop=-15 \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/nested_block_comment.kdl b/tests/test_documents/upstream/2.0.0.draft/input/nested_block_comment.kdl new file mode 100644 index 0000000..d9966a9 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/nested_block_comment.kdl @@ -0,0 +1 @@ +node /* hi /* there */ everyone */ arg diff --git a/tests/test_documents/upstream/2.0.0.draft/input/nested_children.kdl b/tests/test_documents/upstream/2.0.0.draft/input/nested_children.kdl new file mode 100644 index 0000000..40d2742 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/nested_children.kdl @@ -0,0 +1,5 @@ +node1 { + node2 { + node + } +} \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/nested_comments.kdl b/tests/test_documents/upstream/2.0.0.draft/input/nested_comments.kdl new file mode 100644 index 0000000..7541c39 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/nested_comments.kdl @@ -0,0 +1 @@ +node /*/* nested */*/ arg diff --git a/tests/test_documents/upstream/2.0.0.draft/input/nested_multiline_block_comment.kdl b/tests/test_documents/upstream/2.0.0.draft/input/nested_multiline_block_comment.kdl new file mode 100644 index 0000000..f1087e1 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/nested_multiline_block_comment.kdl @@ -0,0 +1,6 @@ +node /* +hey /* +how's +*/ + it going + */ arg diff --git a/tests/test_documents/upstream/2.0.0.draft/input/newline_between_nodes.kdl b/tests/test_documents/upstream/2.0.0.draft/input/newline_between_nodes.kdl new file mode 100644 index 0000000..1c5b5f3 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/newline_between_nodes.kdl @@ -0,0 +1,2 @@ +node1 +node2 diff --git a/tests/test_documents/upstream/2.0.0.draft/input/newlines_in_block_comment.kdl b/tests/test_documents/upstream/2.0.0.draft/input/newlines_in_block_comment.kdl new file mode 100644 index 0000000..690461b --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/newlines_in_block_comment.kdl @@ -0,0 +1,3 @@ +node /* hey so +I was thinking +about newts */ arg diff --git a/tests/test_documents/upstream/2.0.0.draft/input/no_decimal_exponent.kdl b/tests/test_documents/upstream/2.0.0.draft/input/no_decimal_exponent.kdl new file mode 100644 index 0000000..6dc6c6a --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/no_decimal_exponent.kdl @@ -0,0 +1 @@ +node 1e10 \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/no_digits_in_hex.kdl b/tests/test_documents/upstream/2.0.0.draft/input/no_digits_in_hex.kdl new file mode 100644 index 0000000..700e453 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/no_digits_in_hex.kdl @@ -0,0 +1 @@ +node 0x \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/no_integer_digit.kdl b/tests/test_documents/upstream/2.0.0.draft/input/no_integer_digit.kdl new file mode 100644 index 0000000..bac8026 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/no_integer_digit.kdl @@ -0,0 +1 @@ +node .1 \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/no_solidus_escape.kdl b/tests/test_documents/upstream/2.0.0.draft/input/no_solidus_escape.kdl new file mode 100644 index 0000000..2dbc2d1 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/no_solidus_escape.kdl @@ -0,0 +1 @@ +node "\/" diff --git a/tests/test_documents/upstream/2.0.0.draft/input/node_false.kdl b/tests/test_documents/upstream/2.0.0.draft/input/node_false.kdl new file mode 100644 index 0000000..3bab782 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/node_false.kdl @@ -0,0 +1 @@ +node #false diff --git a/tests/test_documents/upstream/2.0.0.draft/input/node_true.kdl b/tests/test_documents/upstream/2.0.0.draft/input/node_true.kdl new file mode 100644 index 0000000..de00dcd --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/node_true.kdl @@ -0,0 +1 @@ +node #true diff --git a/tests/test_documents/upstream/2.0.0.draft/input/node_type.kdl b/tests/test_documents/upstream/2.0.0.draft/input/node_type.kdl new file mode 100644 index 0000000..72b265d --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/node_type.kdl @@ -0,0 +1 @@ +(type)node \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/null_arg.kdl b/tests/test_documents/upstream/2.0.0.draft/input/null_arg.kdl new file mode 100644 index 0000000..bed8dbf --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/null_arg.kdl @@ -0,0 +1 @@ +node #null diff --git a/tests/test_documents/upstream/2.0.0.draft/input/null_prefix_in_bare_id.kdl b/tests/test_documents/upstream/2.0.0.draft/input/null_prefix_in_bare_id.kdl new file mode 100644 index 0000000..9e0cf15 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/null_prefix_in_bare_id.kdl @@ -0,0 +1 @@ +null_id diff --git a/tests/test_documents/upstream/2.0.0.draft/input/null_prefix_in_prop_key.kdl b/tests/test_documents/upstream/2.0.0.draft/input/null_prefix_in_prop_key.kdl new file mode 100644 index 0000000..1e1472b --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/null_prefix_in_prop_key.kdl @@ -0,0 +1 @@ +node null_id=1 diff --git a/tests/test_documents/upstream/2.0.0.draft/input/null_prop.kdl b/tests/test_documents/upstream/2.0.0.draft/input/null_prop.kdl new file mode 100644 index 0000000..c463e98 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/null_prop.kdl @@ -0,0 +1 @@ +node prop=#null diff --git a/tests/test_documents/upstream/2.0.0.draft/input/null_prop_key.kdl b/tests/test_documents/upstream/2.0.0.draft/input/null_prop_key.kdl new file mode 100644 index 0000000..6896d42 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/null_prop_key.kdl @@ -0,0 +1 @@ +node null=1 diff --git a/tests/test_documents/upstream/2.0.0.draft/input/numeric_arg.kdl b/tests/test_documents/upstream/2.0.0.draft/input/numeric_arg.kdl new file mode 100644 index 0000000..23a6fbe --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/numeric_arg.kdl @@ -0,0 +1 @@ +node 15.7 \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/numeric_prop.kdl b/tests/test_documents/upstream/2.0.0.draft/input/numeric_prop.kdl new file mode 100644 index 0000000..0cf22bf --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/numeric_prop.kdl @@ -0,0 +1 @@ +node prop=10.0 \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/octal.kdl b/tests/test_documents/upstream/2.0.0.draft/input/octal.kdl new file mode 100644 index 0000000..9674d51 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/octal.kdl @@ -0,0 +1 @@ +node 0o76543210 \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/only_cr.kdl b/tests/test_documents/upstream/2.0.0.draft/input/only_cr.kdl new file mode 100644 index 0000000..67c3297 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/only_cr.kdl @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/only_line_comment.kdl b/tests/test_documents/upstream/2.0.0.draft/input/only_line_comment.kdl new file mode 100644 index 0000000..edc7a22 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/only_line_comment.kdl @@ -0,0 +1 @@ +// hi \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/only_line_comment_crlf.kdl b/tests/test_documents/upstream/2.0.0.draft/input/only_line_comment_crlf.kdl new file mode 100644 index 0000000..b1653b8 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/only_line_comment_crlf.kdl @@ -0,0 +1 @@ +// comment diff --git a/tests/test_documents/upstream/2.0.0.draft/input/only_line_comment_newline.kdl b/tests/test_documents/upstream/2.0.0.draft/input/only_line_comment_newline.kdl new file mode 100644 index 0000000..faba1e1 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/only_line_comment_newline.kdl @@ -0,0 +1 @@ +// hiiii diff --git a/tests/test_documents/upstream/2.0.0.draft/input/optional_child_semicolon.kdl b/tests/test_documents/upstream/2.0.0.draft/input/optional_child_semicolon.kdl new file mode 100644 index 0000000..5381491 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/optional_child_semicolon.kdl @@ -0,0 +1 @@ +node {foo;bar;baz} diff --git a/tests/test_documents/upstream/2.0.0.draft/input/parens_in_bare_id.kdl b/tests/test_documents/upstream/2.0.0.draft/input/parens_in_bare_id.kdl new file mode 100644 index 0000000..ff9b439 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/parens_in_bare_id.kdl @@ -0,0 +1 @@ +foo123(bar)foo weeee diff --git a/tests/test_documents/upstream/2.0.0.draft/input/parse_all_arg_types.kdl b/tests/test_documents/upstream/2.0.0.draft/input/parse_all_arg_types.kdl new file mode 100644 index 0000000..92dffb1 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/parse_all_arg_types.kdl @@ -0,0 +1 @@ +node 1 1.0 1.0e10 1.0e-10 0x01 0o07 0b10 arg "arg" #"arg\"# #true #false #null diff --git a/tests/test_documents/upstream/2.0.0.draft/input/positive_exponent.kdl b/tests/test_documents/upstream/2.0.0.draft/input/positive_exponent.kdl new file mode 100644 index 0000000..1eaa4b8 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/positive_exponent.kdl @@ -0,0 +1 @@ +node 1.0e+10 \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/positive_int.kdl b/tests/test_documents/upstream/2.0.0.draft/input/positive_int.kdl new file mode 100644 index 0000000..d57df8a --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/positive_int.kdl @@ -0,0 +1 @@ +node +10 \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/preserve_duplicate_nodes.kdl b/tests/test_documents/upstream/2.0.0.draft/input/preserve_duplicate_nodes.kdl new file mode 100644 index 0000000..3e545b1 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/preserve_duplicate_nodes.kdl @@ -0,0 +1,2 @@ +node +node diff --git a/tests/test_documents/upstream/2.0.0.draft/input/preserve_node_order.kdl b/tests/test_documents/upstream/2.0.0.draft/input/preserve_node_order.kdl new file mode 100644 index 0000000..5c36850 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/preserve_node_order.kdl @@ -0,0 +1,3 @@ +node2 +node5 +node1 \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/prop_false_type.kdl b/tests/test_documents/upstream/2.0.0.draft/input/prop_false_type.kdl new file mode 100644 index 0000000..eb544ef --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/prop_false_type.kdl @@ -0,0 +1 @@ +node key=(type)#false diff --git a/tests/test_documents/upstream/2.0.0.draft/input/prop_float_type.kdl b/tests/test_documents/upstream/2.0.0.draft/input/prop_float_type.kdl new file mode 100644 index 0000000..c1c2095 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/prop_float_type.kdl @@ -0,0 +1 @@ +node key=(type)2.5E10 diff --git a/tests/test_documents/upstream/2.0.0.draft/input/prop_hex_type.kdl b/tests/test_documents/upstream/2.0.0.draft/input/prop_hex_type.kdl new file mode 100644 index 0000000..d819d6a --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/prop_hex_type.kdl @@ -0,0 +1 @@ +node key=(type)0x10 diff --git a/tests/test_documents/upstream/2.0.0.draft/input/prop_identifier_type.kdl b/tests/test_documents/upstream/2.0.0.draft/input/prop_identifier_type.kdl new file mode 100644 index 0000000..7df052b --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/prop_identifier_type.kdl @@ -0,0 +1 @@ +node key=(type)str diff --git a/tests/test_documents/upstream/2.0.0.draft/input/prop_null_type.kdl b/tests/test_documents/upstream/2.0.0.draft/input/prop_null_type.kdl new file mode 100644 index 0000000..1c25b6f --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/prop_null_type.kdl @@ -0,0 +1 @@ +node key=(type)#null diff --git a/tests/test_documents/upstream/2.0.0.draft/input/prop_raw_string_type.kdl b/tests/test_documents/upstream/2.0.0.draft/input/prop_raw_string_type.kdl new file mode 100644 index 0000000..6822ab3 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/prop_raw_string_type.kdl @@ -0,0 +1 @@ +node key=(type)#"str"# diff --git a/tests/test_documents/upstream/2.0.0.draft/input/prop_string_type.kdl b/tests/test_documents/upstream/2.0.0.draft/input/prop_string_type.kdl new file mode 100644 index 0000000..50e2d2c --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/prop_string_type.kdl @@ -0,0 +1 @@ +node key=(type)"str" diff --git a/tests/test_documents/upstream/2.0.0.draft/input/prop_true_type.kdl b/tests/test_documents/upstream/2.0.0.draft/input/prop_true_type.kdl new file mode 100644 index 0000000..01404b8 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/prop_true_type.kdl @@ -0,0 +1 @@ +node key=(type)#true diff --git a/tests/test_documents/upstream/2.0.0.draft/input/prop_type.kdl b/tests/test_documents/upstream/2.0.0.draft/input/prop_type.kdl new file mode 100644 index 0000000..01404b8 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/prop_type.kdl @@ -0,0 +1 @@ +node key=(type)#true diff --git a/tests/test_documents/upstream/2.0.0.draft/input/prop_zero_type.kdl b/tests/test_documents/upstream/2.0.0.draft/input/prop_zero_type.kdl new file mode 100644 index 0000000..ad243ed --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/prop_zero_type.kdl @@ -0,0 +1 @@ +node key=(type)0 diff --git a/tests/test_documents/upstream/2.0.0.draft/input/question_mark_before_number.kdl b/tests/test_documents/upstream/2.0.0.draft/input/question_mark_before_number.kdl new file mode 100644 index 0000000..7745a9e --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/question_mark_before_number.kdl @@ -0,0 +1 @@ +node ?15 diff --git a/tests/test_documents/upstream/2.0.0.draft/input/quote_in_bare_id.kdl b/tests/test_documents/upstream/2.0.0.draft/input/quote_in_bare_id.kdl new file mode 100644 index 0000000..0d8a664 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/quote_in_bare_id.kdl @@ -0,0 +1 @@ +foo123"bar weeee diff --git a/tests/test_documents/upstream/2.0.0.draft/input/quoted_arg_type.kdl b/tests/test_documents/upstream/2.0.0.draft/input/quoted_arg_type.kdl new file mode 100644 index 0000000..95c94c1 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/quoted_arg_type.kdl @@ -0,0 +1 @@ +node ("type/")10 \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/quoted_node_name.kdl b/tests/test_documents/upstream/2.0.0.draft/input/quoted_node_name.kdl new file mode 100644 index 0000000..e76d593 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/quoted_node_name.kdl @@ -0,0 +1 @@ +"0node" \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/quoted_node_type.kdl b/tests/test_documents/upstream/2.0.0.draft/input/quoted_node_type.kdl new file mode 100644 index 0000000..c66d905 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/quoted_node_type.kdl @@ -0,0 +1 @@ +("type/")node diff --git a/tests/test_documents/upstream/2.0.0.draft/input/quoted_numeric.kdl b/tests/test_documents/upstream/2.0.0.draft/input/quoted_numeric.kdl new file mode 100644 index 0000000..5939268 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/quoted_numeric.kdl @@ -0,0 +1 @@ +node prop="10.0" \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/quoted_prop_name.kdl b/tests/test_documents/upstream/2.0.0.draft/input/quoted_prop_name.kdl new file mode 100644 index 0000000..8ee5e08 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/quoted_prop_name.kdl @@ -0,0 +1 @@ +node "0prop"=val diff --git a/tests/test_documents/upstream/2.0.0.draft/input/quoted_prop_type.kdl b/tests/test_documents/upstream/2.0.0.draft/input/quoted_prop_type.kdl new file mode 100644 index 0000000..beca5f2 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/quoted_prop_type.kdl @@ -0,0 +1 @@ +node key=("type/")#true diff --git a/tests/test_documents/upstream/2.0.0.draft/input/r_node.kdl b/tests/test_documents/upstream/2.0.0.draft/input/r_node.kdl new file mode 100644 index 0000000..4a98807 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/r_node.kdl @@ -0,0 +1 @@ +r "arg" diff --git a/tests/test_documents/upstream/2.0.0.draft/input/raw_arg_type.kdl b/tests/test_documents/upstream/2.0.0.draft/input/raw_arg_type.kdl new file mode 100644 index 0000000..20243a3 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/raw_arg_type.kdl @@ -0,0 +1 @@ +node (type)#true diff --git a/tests/test_documents/upstream/2.0.0.draft/input/raw_node_name.kdl b/tests/test_documents/upstream/2.0.0.draft/input/raw_node_name.kdl new file mode 100644 index 0000000..f2705c7 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/raw_node_name.kdl @@ -0,0 +1 @@ +#"\node"# diff --git a/tests/test_documents/upstream/2.0.0.draft/input/raw_node_type.kdl b/tests/test_documents/upstream/2.0.0.draft/input/raw_node_type.kdl new file mode 100644 index 0000000..72b265d --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/raw_node_type.kdl @@ -0,0 +1 @@ +(type)node \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/raw_prop_type.kdl b/tests/test_documents/upstream/2.0.0.draft/input/raw_prop_type.kdl new file mode 100644 index 0000000..01404b8 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/raw_prop_type.kdl @@ -0,0 +1 @@ +node key=(type)#true diff --git a/tests/test_documents/upstream/2.0.0.draft/input/raw_string_arg.kdl b/tests/test_documents/upstream/2.0.0.draft/input/raw_string_arg.kdl new file mode 100644 index 0000000..05cf37e --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/raw_string_arg.kdl @@ -0,0 +1,2 @@ +node_1 #""arg\n"and #stuff"# +node_2 ##"#"arg\n"#and #stuff"## diff --git a/tests/test_documents/upstream/2.0.0.draft/input/raw_string_backslash.kdl b/tests/test_documents/upstream/2.0.0.draft/input/raw_string_backslash.kdl new file mode 100644 index 0000000..0405248 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/raw_string_backslash.kdl @@ -0,0 +1 @@ +node #"\n"# diff --git a/tests/test_documents/upstream/2.0.0.draft/input/raw_string_hash_no_esc.kdl b/tests/test_documents/upstream/2.0.0.draft/input/raw_string_hash_no_esc.kdl new file mode 100644 index 0000000..ce24c79 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/raw_string_hash_no_esc.kdl @@ -0,0 +1 @@ +node #"#"# diff --git a/tests/test_documents/upstream/2.0.0.draft/input/raw_string_just_backslash.kdl b/tests/test_documents/upstream/2.0.0.draft/input/raw_string_just_backslash.kdl new file mode 100644 index 0000000..f4e1cac --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/raw_string_just_backslash.kdl @@ -0,0 +1 @@ +node #"\"# diff --git a/tests/test_documents/upstream/2.0.0.draft/input/raw_string_just_quote.kdl b/tests/test_documents/upstream/2.0.0.draft/input/raw_string_just_quote.kdl new file mode 100644 index 0000000..e81bf12 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/raw_string_just_quote.kdl @@ -0,0 +1 @@ +node #"""# diff --git a/tests/test_documents/upstream/2.0.0.draft/input/raw_string_multiple_hash.kdl b/tests/test_documents/upstream/2.0.0.draft/input/raw_string_multiple_hash.kdl new file mode 100644 index 0000000..6317f36 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/raw_string_multiple_hash.kdl @@ -0,0 +1 @@ +node ###""#"##"### diff --git a/tests/test_documents/upstream/2.0.0.draft/input/raw_string_newline.kdl b/tests/test_documents/upstream/2.0.0.draft/input/raw_string_newline.kdl new file mode 100644 index 0000000..0cc85c0 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/raw_string_newline.kdl @@ -0,0 +1,4 @@ +node #" +hello +world +"# diff --git a/tests/test_documents/upstream/2.0.0.draft/input/raw_string_prop.kdl b/tests/test_documents/upstream/2.0.0.draft/input/raw_string_prop.kdl new file mode 100644 index 0000000..cc59232 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/raw_string_prop.kdl @@ -0,0 +1,2 @@ +node_1 prop=#""arg#"\n"# +node_2 prop=##"#"arg#"#\n"## diff --git a/tests/test_documents/upstream/2.0.0.draft/input/raw_string_quote.kdl b/tests/test_documents/upstream/2.0.0.draft/input/raw_string_quote.kdl new file mode 100644 index 0000000..004b62f --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/raw_string_quote.kdl @@ -0,0 +1 @@ +node #"a"b"# diff --git a/tests/test_documents/upstream/2.0.0.draft/input/repeated_arg.kdl b/tests/test_documents/upstream/2.0.0.draft/input/repeated_arg.kdl new file mode 100644 index 0000000..6525757 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/repeated_arg.kdl @@ -0,0 +1 @@ +node arg arg diff --git a/tests/test_documents/upstream/2.0.0.draft/input/repeated_prop.kdl b/tests/test_documents/upstream/2.0.0.draft/input/repeated_prop.kdl new file mode 100644 index 0000000..ac42834 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/repeated_prop.kdl @@ -0,0 +1 @@ +node prop=10 prop=11 \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/same_name_nodes.kdl b/tests/test_documents/upstream/2.0.0.draft/input/same_name_nodes.kdl new file mode 100644 index 0000000..3e545b1 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/same_name_nodes.kdl @@ -0,0 +1,2 @@ +node +node diff --git a/tests/test_documents/upstream/2.0.0.draft/input/sci_notation_large.kdl b/tests/test_documents/upstream/2.0.0.draft/input/sci_notation_large.kdl new file mode 100644 index 0000000..e8385f6 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/sci_notation_large.kdl @@ -0,0 +1 @@ +node prop=1.23E+1000 \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/sci_notation_small.kdl b/tests/test_documents/upstream/2.0.0.draft/input/sci_notation_small.kdl new file mode 100644 index 0000000..300c7d8 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/sci_notation_small.kdl @@ -0,0 +1 @@ +node prop=1.23E-1000 \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/semicolon_after_child.kdl b/tests/test_documents/upstream/2.0.0.draft/input/semicolon_after_child.kdl new file mode 100644 index 0000000..81f2634 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/semicolon_after_child.kdl @@ -0,0 +1,3 @@ +node { + childnode +}; diff --git a/tests/test_documents/upstream/2.0.0.draft/input/semicolon_in_child.kdl b/tests/test_documents/upstream/2.0.0.draft/input/semicolon_in_child.kdl new file mode 100644 index 0000000..ec6fff1 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/semicolon_in_child.kdl @@ -0,0 +1,3 @@ +node1 { + node2; +} \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/semicolon_separated.kdl b/tests/test_documents/upstream/2.0.0.draft/input/semicolon_separated.kdl new file mode 100644 index 0000000..3324f79 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/semicolon_separated.kdl @@ -0,0 +1 @@ +node1;node2 \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/semicolon_separated_nodes.kdl b/tests/test_documents/upstream/2.0.0.draft/input/semicolon_separated_nodes.kdl new file mode 100644 index 0000000..3450f49 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/semicolon_separated_nodes.kdl @@ -0,0 +1 @@ +node1; node2; \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/semicolon_terminated.kdl b/tests/test_documents/upstream/2.0.0.draft/input/semicolon_terminated.kdl new file mode 100644 index 0000000..c8b9d2d --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/semicolon_terminated.kdl @@ -0,0 +1 @@ +node1; \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/single_arg.kdl b/tests/test_documents/upstream/2.0.0.draft/input/single_arg.kdl new file mode 100644 index 0000000..1b3db2c --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/single_arg.kdl @@ -0,0 +1 @@ +node arg diff --git a/tests/test_documents/upstream/2.0.0.draft/input/single_prop.kdl b/tests/test_documents/upstream/2.0.0.draft/input/single_prop.kdl new file mode 100644 index 0000000..282aa3b --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/single_prop.kdl @@ -0,0 +1 @@ +node prop=val diff --git a/tests/test_documents/upstream/2.0.0.draft/input/slash_in_bare_id.kdl b/tests/test_documents/upstream/2.0.0.draft/input/slash_in_bare_id.kdl new file mode 100644 index 0000000..d26d325 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/slash_in_bare_id.kdl @@ -0,0 +1 @@ +foo123/bar weeee diff --git a/tests/test_documents/upstream/2.0.0.draft/input/slashdash_arg_after_newline_esc.kdl b/tests/test_documents/upstream/2.0.0.draft/input/slashdash_arg_after_newline_esc.kdl new file mode 100644 index 0000000..5a4a9fd --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/slashdash_arg_after_newline_esc.kdl @@ -0,0 +1,2 @@ +node \ + /- arg arg2 diff --git a/tests/test_documents/upstream/2.0.0.draft/input/slashdash_arg_before_newline_esc.kdl b/tests/test_documents/upstream/2.0.0.draft/input/slashdash_arg_before_newline_esc.kdl new file mode 100644 index 0000000..70206aa --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/slashdash_arg_before_newline_esc.kdl @@ -0,0 +1,2 @@ +node /- \ + arg diff --git a/tests/test_documents/upstream/2.0.0.draft/input/slashdash_child.kdl b/tests/test_documents/upstream/2.0.0.draft/input/slashdash_child.kdl new file mode 100644 index 0000000..70fb1e9 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/slashdash_child.kdl @@ -0,0 +1,3 @@ +node /- { + node2 +} diff --git a/tests/test_documents/upstream/2.0.0.draft/input/slashdash_empty_child.kdl b/tests/test_documents/upstream/2.0.0.draft/input/slashdash_empty_child.kdl new file mode 100644 index 0000000..644c21b --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/slashdash_empty_child.kdl @@ -0,0 +1,2 @@ +node /- { +} diff --git a/tests/test_documents/upstream/2.0.0.draft/input/slashdash_full_node.kdl b/tests/test_documents/upstream/2.0.0.draft/input/slashdash_full_node.kdl new file mode 100644 index 0000000..4df7b55 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/slashdash_full_node.kdl @@ -0,0 +1,3 @@ +/- node 1.0 "a" b=" +b +" diff --git a/tests/test_documents/upstream/2.0.0.draft/input/slashdash_in_slashdash.kdl b/tests/test_documents/upstream/2.0.0.draft/input/slashdash_in_slashdash.kdl new file mode 100644 index 0000000..cb43150 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/slashdash_in_slashdash.kdl @@ -0,0 +1,2 @@ +/- node1 /- 1.0 +node2 \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/slashdash_negative_number.kdl b/tests/test_documents/upstream/2.0.0.draft/input/slashdash_negative_number.kdl new file mode 100644 index 0000000..241de28 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/slashdash_negative_number.kdl @@ -0,0 +1 @@ +node /--1.0 2.0 \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/slashdash_node_in_child.kdl b/tests/test_documents/upstream/2.0.0.draft/input/slashdash_node_in_child.kdl new file mode 100644 index 0000000..77fd44a --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/slashdash_node_in_child.kdl @@ -0,0 +1,3 @@ +node1 { + /- node2 +} \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/slashdash_node_with_child.kdl b/tests/test_documents/upstream/2.0.0.draft/input/slashdash_node_with_child.kdl new file mode 100644 index 0000000..d3063dd --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/slashdash_node_with_child.kdl @@ -0,0 +1,3 @@ +/- node { + node2 +} \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/slashdash_only_node.kdl b/tests/test_documents/upstream/2.0.0.draft/input/slashdash_only_node.kdl new file mode 100644 index 0000000..d404630 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/slashdash_only_node.kdl @@ -0,0 +1 @@ +/-node diff --git a/tests/test_documents/upstream/2.0.0.draft/input/slashdash_only_node_with_space.kdl b/tests/test_documents/upstream/2.0.0.draft/input/slashdash_only_node_with_space.kdl new file mode 100644 index 0000000..ab2af84 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/slashdash_only_node_with_space.kdl @@ -0,0 +1 @@ +/- node \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/slashdash_prop.kdl b/tests/test_documents/upstream/2.0.0.draft/input/slashdash_prop.kdl new file mode 100644 index 0000000..2b81f5f --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/slashdash_prop.kdl @@ -0,0 +1 @@ +node /- key=value arg diff --git a/tests/test_documents/upstream/2.0.0.draft/input/slashdash_raw_prop_key.kdl b/tests/test_documents/upstream/2.0.0.draft/input/slashdash_raw_prop_key.kdl new file mode 100644 index 0000000..9b0978b --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/slashdash_raw_prop_key.kdl @@ -0,0 +1 @@ +node /- key=value diff --git a/tests/test_documents/upstream/2.0.0.draft/input/slashdash_repeated_prop.kdl b/tests/test_documents/upstream/2.0.0.draft/input/slashdash_repeated_prop.kdl new file mode 100644 index 0000000..c94411a --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/slashdash_repeated_prop.kdl @@ -0,0 +1 @@ +node arg=correct /- arg=wrong diff --git a/tests/test_documents/upstream/2.0.0.draft/input/space_after_arg_type.kdl b/tests/test_documents/upstream/2.0.0.draft/input/space_after_arg_type.kdl new file mode 100644 index 0000000..2fe3698 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/space_after_arg_type.kdl @@ -0,0 +1 @@ +node (type) 10 diff --git a/tests/test_documents/upstream/2.0.0.draft/input/space_after_node_type.kdl b/tests/test_documents/upstream/2.0.0.draft/input/space_after_node_type.kdl new file mode 100644 index 0000000..f401065 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/space_after_node_type.kdl @@ -0,0 +1 @@ +(type) node diff --git a/tests/test_documents/upstream/2.0.0.draft/input/space_after_prop_type.kdl b/tests/test_documents/upstream/2.0.0.draft/input/space_after_prop_type.kdl new file mode 100644 index 0000000..023a75c --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/space_after_prop_type.kdl @@ -0,0 +1 @@ +node key=(type) #false diff --git a/tests/test_documents/upstream/2.0.0.draft/input/space_around_prop_marker.kdl b/tests/test_documents/upstream/2.0.0.draft/input/space_around_prop_marker.kdl new file mode 100644 index 0000000..52150d8 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/space_around_prop_marker.kdl @@ -0,0 +1 @@ +node foo = bar diff --git a/tests/test_documents/upstream/2.0.0.draft/input/space_in_arg_type.kdl b/tests/test_documents/upstream/2.0.0.draft/input/space_in_arg_type.kdl new file mode 100644 index 0000000..e2fb065 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/space_in_arg_type.kdl @@ -0,0 +1 @@ +node (type )#false diff --git a/tests/test_documents/upstream/2.0.0.draft/input/space_in_node_type.kdl b/tests/test_documents/upstream/2.0.0.draft/input/space_in_node_type.kdl new file mode 100644 index 0000000..929365b --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/space_in_node_type.kdl @@ -0,0 +1 @@ +( type)node diff --git a/tests/test_documents/upstream/2.0.0.draft/input/space_in_prop_type.kdl b/tests/test_documents/upstream/2.0.0.draft/input/space_in_prop_type.kdl new file mode 100644 index 0000000..0a18c97 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/space_in_prop_type.kdl @@ -0,0 +1 @@ +node key=(type )#false diff --git a/tests/test_documents/upstream/2.0.0.draft/input/square_bracket_in_bare_id.kdl b/tests/test_documents/upstream/2.0.0.draft/input/square_bracket_in_bare_id.kdl new file mode 100644 index 0000000..62f34e2 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/square_bracket_in_bare_id.kdl @@ -0,0 +1 @@ +foo123[bar]foo weeee diff --git a/tests/test_documents/upstream/2.0.0.draft/input/string_arg.kdl b/tests/test_documents/upstream/2.0.0.draft/input/string_arg.kdl new file mode 100644 index 0000000..e5161d1 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/string_arg.kdl @@ -0,0 +1 @@ +node "arg" \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/string_escaped_literal_whitespace.kdl b/tests/test_documents/upstream/2.0.0.draft/input/string_escaped_literal_whitespace.kdl new file mode 100644 index 0000000..1f12126 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/string_escaped_literal_whitespace.kdl @@ -0,0 +1,2 @@ +node "Hello \ +World \ Stuff" diff --git a/tests/test_documents/upstream/2.0.0.draft/input/string_prop.kdl b/tests/test_documents/upstream/2.0.0.draft/input/string_prop.kdl new file mode 100644 index 0000000..4c29c14 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/string_prop.kdl @@ -0,0 +1 @@ +node prop="val" \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/tab_space.kdl b/tests/test_documents/upstream/2.0.0.draft/input/tab_space.kdl new file mode 100644 index 0000000..64f5a0a --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/tab_space.kdl @@ -0,0 +1 @@ +node diff --git a/tests/test_documents/upstream/2.0.0.draft/input/trailing_crlf.kdl b/tests/test_documents/upstream/2.0.0.draft/input/trailing_crlf.kdl new file mode 100644 index 0000000..aff78f7 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/trailing_crlf.kdl @@ -0,0 +1 @@ +node diff --git a/tests/test_documents/upstream/2.0.0.draft/input/trailing_underscore_hex.kdl b/tests/test_documents/upstream/2.0.0.draft/input/trailing_underscore_hex.kdl new file mode 100644 index 0000000..bdf65bc --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/trailing_underscore_hex.kdl @@ -0,0 +1 @@ +node 0x123abc_ \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/trailing_underscore_octal.kdl b/tests/test_documents/upstream/2.0.0.draft/input/trailing_underscore_octal.kdl new file mode 100644 index 0000000..1d27c18 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/trailing_underscore_octal.kdl @@ -0,0 +1 @@ +node 0o123_ diff --git a/tests/test_documents/upstream/2.0.0.draft/input/true_prefix_in_bare_id.kdl b/tests/test_documents/upstream/2.0.0.draft/input/true_prefix_in_bare_id.kdl new file mode 100644 index 0000000..49c9d0d --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/true_prefix_in_bare_id.kdl @@ -0,0 +1 @@ +true_id diff --git a/tests/test_documents/upstream/2.0.0.draft/input/true_prefix_in_prop_key.kdl b/tests/test_documents/upstream/2.0.0.draft/input/true_prefix_in_prop_key.kdl new file mode 100644 index 0000000..2af7a1c --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/true_prefix_in_prop_key.kdl @@ -0,0 +1 @@ +node true_id=1 diff --git a/tests/test_documents/upstream/2.0.0.draft/input/true_prop_key.kdl b/tests/test_documents/upstream/2.0.0.draft/input/true_prop_key.kdl new file mode 100644 index 0000000..e88c36f --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/true_prop_key.kdl @@ -0,0 +1 @@ +node true=1 diff --git a/tests/test_documents/upstream/2.0.0.draft/input/two_nodes.kdl b/tests/test_documents/upstream/2.0.0.draft/input/two_nodes.kdl new file mode 100644 index 0000000..1c5b5f3 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/two_nodes.kdl @@ -0,0 +1,2 @@ +node1 +node2 diff --git a/tests/test_documents/upstream/2.0.0.draft/input/type_before_prop_key.kdl b/tests/test_documents/upstream/2.0.0.draft/input/type_before_prop_key.kdl new file mode 100644 index 0000000..1b19b0d --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/type_before_prop_key.kdl @@ -0,0 +1 @@ +node (type)key=10 diff --git a/tests/test_documents/upstream/2.0.0.draft/input/unbalanced_raw_hashes.kdl b/tests/test_documents/upstream/2.0.0.draft/input/unbalanced_raw_hashes.kdl new file mode 100644 index 0000000..d0213f2 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/unbalanced_raw_hashes.kdl @@ -0,0 +1 @@ +node ##"foo"# diff --git a/tests/test_documents/upstream/2.0.0.draft/input/underscore_at_start_of_fraction.kdl b/tests/test_documents/upstream/2.0.0.draft/input/underscore_at_start_of_fraction.kdl new file mode 100644 index 0000000..30fb7cc --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/underscore_at_start_of_fraction.kdl @@ -0,0 +1 @@ +node 1._7 \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/underscore_at_start_of_hex.kdl b/tests/test_documents/upstream/2.0.0.draft/input/underscore_at_start_of_hex.kdl new file mode 100644 index 0000000..2de0c48 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/underscore_at_start_of_hex.kdl @@ -0,0 +1 @@ +node 0x_10 \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/underscore_before_number.kdl b/tests/test_documents/upstream/2.0.0.draft/input/underscore_before_number.kdl new file mode 100644 index 0000000..788656b --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/underscore_before_number.kdl @@ -0,0 +1 @@ +node _15 diff --git a/tests/test_documents/upstream/2.0.0.draft/input/underscore_in_exponent.kdl b/tests/test_documents/upstream/2.0.0.draft/input/underscore_in_exponent.kdl new file mode 100644 index 0000000..329c736 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/underscore_in_exponent.kdl @@ -0,0 +1 @@ +node 1.0e-10_0 diff --git a/tests/test_documents/upstream/2.0.0.draft/input/underscore_in_float.kdl b/tests/test_documents/upstream/2.0.0.draft/input/underscore_in_float.kdl new file mode 100644 index 0000000..f039b6a --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/underscore_in_float.kdl @@ -0,0 +1 @@ +node 1_1.0 diff --git a/tests/test_documents/upstream/2.0.0.draft/input/underscore_in_fraction.kdl b/tests/test_documents/upstream/2.0.0.draft/input/underscore_in_fraction.kdl new file mode 100644 index 0000000..b1a091a --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/underscore_in_fraction.kdl @@ -0,0 +1 @@ +node 1.0_2 \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/underscore_in_int.kdl b/tests/test_documents/upstream/2.0.0.draft/input/underscore_in_int.kdl new file mode 100644 index 0000000..19250d3 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/underscore_in_int.kdl @@ -0,0 +1 @@ +node 1_0 diff --git a/tests/test_documents/upstream/2.0.0.draft/input/underscore_in_octal.kdl b/tests/test_documents/upstream/2.0.0.draft/input/underscore_in_octal.kdl new file mode 100644 index 0000000..8a57ec1 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/underscore_in_octal.kdl @@ -0,0 +1 @@ +node 0o012_3456_7 \ No newline at end of file diff --git a/tests/test_documents/upstream/2.0.0.draft/input/unicode_delete.kdl b/tests/test_documents/upstream/2.0.0.draft/input/unicode_delete.kdl new file mode 100644 index 0000000..3fb52ed --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/unicode_delete.kdl @@ -0,0 +1,2 @@ +// 0x007F (Delete) +node1 arg diff --git a/tests/test_documents/upstream/2.0.0.draft/input/unicode_equals_signs.kdl b/tests/test_documents/upstream/2.0.0.draft/input/unicode_equals_signs.kdl new file mode 100644 index 0000000..37d8e02 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/unicode_equals_signs.kdl @@ -0,0 +1,4 @@ +node \ + p1﹦val1 \ // U+FE66 + p2=val2 \ // U+FF1D + p3🟰val3 // U+1F7F0 diff --git a/tests/test_documents/upstream/2.0.0.draft/input/unicode_fsi.kdl b/tests/test_documents/upstream/2.0.0.draft/input/unicode_fsi.kdl new file mode 100644 index 0000000..7aece14 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/unicode_fsi.kdl @@ -0,0 +1,2 @@ +// 0x2068 +node1 ⁨arg diff --git a/tests/test_documents/upstream/2.0.0.draft/input/unicode_lre.kdl b/tests/test_documents/upstream/2.0.0.draft/input/unicode_lre.kdl new file mode 100644 index 0000000..33342ae --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/unicode_lre.kdl @@ -0,0 +1,2 @@ +// 0x202A +node1 ‪arg diff --git a/tests/test_documents/upstream/2.0.0.draft/input/unicode_lri.kdl b/tests/test_documents/upstream/2.0.0.draft/input/unicode_lri.kdl new file mode 100644 index 0000000..adec826 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/unicode_lri.kdl @@ -0,0 +1,2 @@ +// 0x2066 +node1⁦arg diff --git a/tests/test_documents/upstream/2.0.0.draft/input/unicode_lrm.kdl b/tests/test_documents/upstream/2.0.0.draft/input/unicode_lrm.kdl new file mode 100644 index 0000000..ff37cad --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/unicode_lrm.kdl @@ -0,0 +1,2 @@ +// 0x200E +node ‎arg diff --git a/tests/test_documents/upstream/2.0.0.draft/input/unicode_lro.kdl b/tests/test_documents/upstream/2.0.0.draft/input/unicode_lro.kdl new file mode 100644 index 0000000..b084ded --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/unicode_lro.kdl @@ -0,0 +1,2 @@ +// 0x202D +node ‭arg diff --git a/tests/test_documents/upstream/2.0.0.draft/input/unicode_pdf.kdl b/tests/test_documents/upstream/2.0.0.draft/input/unicode_pdf.kdl new file mode 100644 index 0000000..9b94fad --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/unicode_pdf.kdl @@ -0,0 +1,2 @@ +// 0x202C +node ‬arg diff --git a/tests/test_documents/upstream/2.0.0.draft/input/unicode_pdi.kdl b/tests/test_documents/upstream/2.0.0.draft/input/unicode_pdi.kdl new file mode 100644 index 0000000..d92d2d7 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/unicode_pdi.kdl @@ -0,0 +1,2 @@ +// 0x2069 +node ⁩arg diff --git a/tests/test_documents/upstream/2.0.0.draft/input/unicode_rle.kdl b/tests/test_documents/upstream/2.0.0.draft/input/unicode_rle.kdl new file mode 100644 index 0000000..3b46610 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/unicode_rle.kdl @@ -0,0 +1,2 @@ +// 0x202B +node1 ‫arg diff --git a/tests/test_documents/upstream/2.0.0.draft/input/unicode_rli.kdl b/tests/test_documents/upstream/2.0.0.draft/input/unicode_rli.kdl new file mode 100644 index 0000000..92902ed --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/unicode_rli.kdl @@ -0,0 +1,2 @@ +// 0x2067 +node1 ⁧arg diff --git a/tests/test_documents/upstream/2.0.0.draft/input/unicode_rlm.kdl b/tests/test_documents/upstream/2.0.0.draft/input/unicode_rlm.kdl new file mode 100644 index 0000000..bfa63c8 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/unicode_rlm.kdl @@ -0,0 +1,2 @@ +// 0x200F +node ‏arg diff --git a/tests/test_documents/upstream/2.0.0.draft/input/unicode_rlo.kdl b/tests/test_documents/upstream/2.0.0.draft/input/unicode_rlo.kdl new file mode 100644 index 0000000..98c848b --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/unicode_rlo.kdl @@ -0,0 +1,2 @@ +// 0x202E +node ‮arg diff --git a/tests/test_documents/upstream/2.0.0.draft/input/unicode_under_0x20.kdl b/tests/test_documents/upstream/2.0.0.draft/input/unicode_under_0x20.kdl new file mode 100644 index 0000000..967a87a --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/unicode_under_0x20.kdl @@ -0,0 +1,2 @@ +// 0x0019 +node1 arg diff --git a/tests/test_documents/upstream/2.0.0.draft/input/unusual_bare_id_chars_in_quoted_id.kdl b/tests/test_documents/upstream/2.0.0.draft/input/unusual_bare_id_chars_in_quoted_id.kdl new file mode 100644 index 0000000..d3262b8 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/unusual_bare_id_chars_in_quoted_id.kdl @@ -0,0 +1 @@ +"foo123~!@$%^&*.:'|?+<>," weeee diff --git a/tests/test_documents/upstream/2.0.0.draft/input/unusual_chars_in_bare_id.kdl b/tests/test_documents/upstream/2.0.0.draft/input/unusual_chars_in_bare_id.kdl new file mode 100644 index 0000000..8321632 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/unusual_chars_in_bare_id.kdl @@ -0,0 +1 @@ +foo123~!@$%^&*.:'|?+<>, weeee diff --git a/tests/test_documents/upstream/2.0.0.draft/input/vertical_tab_whitespace.kdl b/tests/test_documents/upstream/2.0.0.draft/input/vertical_tab_whitespace.kdl new file mode 100644 index 0000000..507d3a0 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/vertical_tab_whitespace.kdl @@ -0,0 +1 @@ +node arg diff --git a/tests/test_documents/upstream/2.0.0.draft/input/zero_arg.kdl b/tests/test_documents/upstream/2.0.0.draft/input/zero_arg.kdl new file mode 100644 index 0000000..74405b6 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/zero_arg.kdl @@ -0,0 +1 @@ +node 0 diff --git a/tests/test_documents/upstream/2.0.0.draft/input/zero_float.kdl b/tests/test_documents/upstream/2.0.0.draft/input/zero_float.kdl new file mode 100644 index 0000000..fd5b1f1 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/zero_float.kdl @@ -0,0 +1 @@ +node 0.0 diff --git a/tests/test_documents/upstream/2.0.0.draft/input/zero_int.kdl b/tests/test_documents/upstream/2.0.0.draft/input/zero_int.kdl new file mode 100644 index 0000000..74405b6 --- /dev/null +++ b/tests/test_documents/upstream/2.0.0.draft/input/zero_int.kdl @@ -0,0 +1 @@ +node 0 From f3313888338ba100147bec50a8b28bef3d9ed139 Mon Sep 17 00:00:00 2001 From: Thomas Jollans Date: Sun, 26 May 2024 13:13:05 +0200 Subject: [PATCH 27/45] fix hashes and equals signs --- src/parser.c | 8 ++++---- src/tokenizer.c | 6 +++--- tests/CMakeLists.txt | 1 + 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/parser.c b/src/parser.c index bce7de8..7aee264 100644 --- a/src/parser.c +++ b/src/parser.c @@ -1174,14 +1174,14 @@ static bool _parse_binary_number(kdl_str number, kdl_value* val, kdl_owned_strin static bool _identifier_is_valid_v1(kdl_str value) { uint32_t c = 0; - if (_kdl_pop_codepoint(&value, &c) != KDL_UTF8_OK || !_kdl_is_word_start(KDL_CHARACTER_SET_V1, c)) { + if (_kdl_pop_codepoint(&value, &c) != KDL_UTF8_OK || !_kdl_is_id_start(KDL_CHARACTER_SET_V1, c)) { return false; } while (true) { switch (_kdl_pop_codepoint(&value, &c)) { case KDL_UTF8_OK: - if (!_kdl_is_word_char(KDL_CHARACTER_SET_V1, c)) return false; + if (!_kdl_is_id(KDL_CHARACTER_SET_V1, c)) return false; break; case KDL_UTF8_EOF: return true; @@ -1200,14 +1200,14 @@ static bool _identifier_is_valid_v2(kdl_str value) } uint32_t c = 0; - if (_kdl_pop_codepoint(&value, &c) != KDL_UTF8_OK || !_kdl_is_word_start(KDL_CHARACTER_SET_V2, c)) { + if (_kdl_pop_codepoint(&value, &c) != KDL_UTF8_OK || !_kdl_is_id_start(KDL_CHARACTER_SET_V2, c)) { return false; } while (true) { switch (_kdl_pop_codepoint(&value, &c)) { case KDL_UTF8_OK: - if (!_kdl_is_word_char(KDL_CHARACTER_SET_V2, c)) return false; + if (!_kdl_is_id(KDL_CHARACTER_SET_V2, c)) return false; break; case KDL_UTF8_EOF: return true; diff --git a/src/tokenizer.c b/src/tokenizer.c index 3787ef6..81fbca9 100644 --- a/src/tokenizer.c +++ b/src/tokenizer.c @@ -167,9 +167,9 @@ bool _kdl_is_id_start(kdl_character_set charset, uint32_t c) bool _kdl_is_word_char(kdl_character_set charset, uint32_t c) { return c > 0x20 && c <= 0x10FFFF && c != '\\' && c != '/' && c != '(' && c != ')' && c != '{' && c != '}' - && c != ';' && c != '[' && c != ']' && c != '=' && c != '"' + && c != ';' && c != '[' && c != ']' && c != '"' && !(charset == KDL_CHARACTER_SET_V1 && (c == '<' || c == '>' || c == ',')) - && !_kdl_is_whitespace(charset, c) && !_kdl_is_newline(c); + && !_kdl_is_equals_sign(charset, c) && !_kdl_is_whitespace(charset, c) && !_kdl_is_newline(c); } bool _kdl_is_word_start(kdl_character_set charset, uint32_t c) @@ -181,7 +181,7 @@ bool _kdl_is_end_of_word(kdl_character_set charset, uint32_t c) { // is this character something that could terminate an identifier (or number) in some situation? return _kdl_is_whitespace(charset, c) || _kdl_is_newline(c) // - || c == ';' || c == ')' || c == '}' || c == '/' || c == '\\' || c == '='; + || c == ';' || c == ')' || c == '}' || c == '/' || c == '\\' || _kdl_is_equals_sign(charset, c); } bool _kdl_is_illegal_char(kdl_character_set charset, uint32_t c) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 1d22693..e14be64 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -133,6 +133,7 @@ add_test(NAME example_doc_test_v1 COMMAND "$" " set(KDL_TEST_CASES_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/test_documents/upstream/2.0.0.draft) # Ignore some tests which require unsupported number representations set(FUZZY_KDL_TESTS_LIST_V2 + no_decimal_exponent.kdl # float representation not consistent with other test cases ) string(REPLACE ";" ":" FUZZY_KDL_TESTS_V2 "${FUZZY_KDL_TESTS_LIST_V2}") From 02a4bae7db1a5531192a2676f8734685fdd13fc3 Mon Sep 17 00:00:00 2001 From: Thomas Jollans Date: Sun, 26 May 2024 13:19:44 +0200 Subject: [PATCH 28/45] identifiers can't contain illegal characters --- src/tokenizer.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tokenizer.c b/src/tokenizer.c index 81fbca9..0cc09f3 100644 --- a/src/tokenizer.c +++ b/src/tokenizer.c @@ -169,7 +169,8 @@ bool _kdl_is_word_char(kdl_character_set charset, uint32_t c) return c > 0x20 && c <= 0x10FFFF && c != '\\' && c != '/' && c != '(' && c != ')' && c != '{' && c != '}' && c != ';' && c != '[' && c != ']' && c != '"' && !(charset == KDL_CHARACTER_SET_V1 && (c == '<' || c == '>' || c == ',')) - && !_kdl_is_equals_sign(charset, c) && !_kdl_is_whitespace(charset, c) && !_kdl_is_newline(c); + && !_kdl_is_equals_sign(charset, c) && !_kdl_is_whitespace(charset, c) && !_kdl_is_newline(c) + && !_kdl_is_illegal_char(charset, c); } bool _kdl_is_word_start(kdl_character_set charset, uint32_t c) @@ -181,7 +182,8 @@ bool _kdl_is_end_of_word(kdl_character_set charset, uint32_t c) { // is this character something that could terminate an identifier (or number) in some situation? return _kdl_is_whitespace(charset, c) || _kdl_is_newline(c) // - || c == ';' || c == ')' || c == '}' || c == '/' || c == '\\' || _kdl_is_equals_sign(charset, c); + || c == ';' || c == ')' || c == '}' || c == '/' || c == '\\' || _kdl_is_equals_sign(charset, c) + || _kdl_is_illegal_char(charset, c); } bool _kdl_is_illegal_char(kdl_character_set charset, uint32_t c) From 2b942b49dba77cc915b18eed9de3df5a0d10d35d Mon Sep 17 00:00:00 2001 From: Thomas Jollans Date: Sun, 26 May 2024 13:40:12 +0200 Subject: [PATCH 29/45] Skip certain test cases --- tests/CMakeLists.txt | 6 +++++ tests/example_doc_test.c | 51 ++++++++++++++++++++++++++++++++++------ 2 files changed, 50 insertions(+), 7 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index e14be64..7c67732 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -136,12 +136,18 @@ set(FUZZY_KDL_TESTS_LIST_V2 no_decimal_exponent.kdl # float representation not consistent with other test cases ) string(REPLACE ";" ":" FUZZY_KDL_TESTS_V2 "${FUZZY_KDL_TESTS_LIST_V2}") +set(SKIP_KDL_TESTS_LIST_V2 + escaped_whitespace.kdl # invalid multi-line string + string_escaped_literal_whitespace.kdl # invalid multi-line string +) +string(REPLACE ";" ":" SKIP_KDL_TESTS_V2 "${SKIP_KDL_TESTS_LIST_V2}") add_executable(example_doc_test_v2 example_doc_test.c) target_link_libraries(example_doc_test_v2 kdl test_util ckdl-cat) target_compile_definitions(example_doc_test_v2 PRIVATE "KDL_TEST_CASES_ROOT=\"${KDL_TEST_CASES_ROOT}\"" "FUZZY_KDL_TESTS=\"${FUZZY_KDL_TESTS_V2}\"" + "SKIP_KDL_TESTS=\"${SKIP_KDL_TESTS_V2}\"" "KDL_VERSION=KDL_VERSION_2") # add_test(NAME example_doc_test_v2 COMMAND "$" "${KDL_TEST_CASES_ROOT}") ################################################# diff --git a/tests/example_doc_test.c b/tests/example_doc_test.c index ddb68c9..0ebc6b8 100644 --- a/tests/example_doc_test.c +++ b/tests/example_doc_test.c @@ -2,6 +2,14 @@ # define KDL_VERSION KDL_VERSION_1 #endif +#ifndef FUZZY_KDL_TESTS +# define FUZZY_KDL_TESTS "" +#endif + +#ifndef SKIP_KDL_TESTS +# define SKIP_KDL_TESTS "" +#endif + #include "fs_util.h" #include "test_util.h" @@ -92,14 +100,29 @@ void TEST_MAIN(void) } // prepare the list of fuzzy test cases (don't compare output) - char* excl_buf = strdup(FUZZY_KDL_TESTS); + char* fuzzy_buf = strdup(FUZZY_KDL_TESTS); size_t n_fuzzy = 0; - if (*excl_buf) ++n_fuzzy; - for (char* p = excl_buf; *p; ++p) + if (*fuzzy_buf) ++n_fuzzy; + for (char* p = fuzzy_buf; *p; ++p) if (*p == ':') ++n_fuzzy; char** fuzzy_test_cases = malloc(n_fuzzy * sizeof(char*)); - fuzzy_test_cases[0] = excl_buf; - for (char *p = excl_buf, **e = &fuzzy_test_cases[1]; *p; ++p) { + fuzzy_test_cases[0] = fuzzy_buf; + for (char *p = fuzzy_buf, **e = &fuzzy_test_cases[1]; *p; ++p) { + if (*p == ':') { + *p = '\0'; + *(e++) = p + 1; + } + } + + // prepare the list of test cases to skip + char* skip_buf = strdup(SKIP_KDL_TESTS); + size_t n_skip = 0; + if (*skip_buf) ++n_skip; + for (char* p = skip_buf; *p; ++p) + if (*p == ':') ++n_skip; + char** skipped_test_cases = malloc(n_skip * sizeof(char*)); + skipped_test_cases[0] = skip_buf; + for (char *p = skip_buf, **e = &skipped_test_cases[1]; *p; ++p) { if (*p == ':') { *p = '\0'; *(e++) = p + 1; @@ -140,6 +163,7 @@ void TEST_MAIN(void) char const* filename = filenames[i]; tc.input_path = filename; tc.ignore_output = false; + bool skip = false; strncpy(expected_basename_ptr, filename, expected_basename_avail); if (stat(expected_kdl_fn, &st) == 0) { // file exists - expected to pass @@ -148,6 +172,13 @@ void TEST_MAIN(void) for (size_t j = 0; j < n_fuzzy; ++j) { if (strcmp(fuzzy_test_cases[j], filename) == 0) { tc.ignore_output = true; + break; + } + } + for (size_t j = 0; j < n_skip; ++j) { + if (strcmp(skipped_test_cases[j], filename) == 0) { + skip = true; + break; } } } else { @@ -161,11 +192,17 @@ void TEST_MAIN(void) } } // let's go - run_test_d(filename, &do_test_case, &tc); + if (skip) { + fprintf(stderr, "SKIP %s\n", filename); + } else { + run_test_d(filename, &do_test_case, &tc); + } } - free(excl_buf); + free(fuzzy_buf); free(fuzzy_test_cases); + free(skip_buf); + free(skipped_test_cases); free(filenames); free(input_dir); free(expected_kdl_fn); From 58bfd6d96fcbba4e615d8a68008c891ff6dec1ca Mon Sep 17 00:00:00 2001 From: Thomas Jollans Date: Sun, 26 May 2024 13:40:47 +0200 Subject: [PATCH 30/45] Run upstream kdlv2 tests by default --- tests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 7c67732..1f67e87 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -149,7 +149,7 @@ target_compile_definitions(example_doc_test_v2 PRIVATE "FUZZY_KDL_TESTS=\"${FUZZY_KDL_TESTS_V2}\"" "SKIP_KDL_TESTS=\"${SKIP_KDL_TESTS_V2}\"" "KDL_VERSION=KDL_VERSION_2") -# add_test(NAME example_doc_test_v2 COMMAND "$" "${KDL_TEST_CASES_ROOT}") +add_test(NAME example_doc_test_v2 COMMAND "$" "${KDL_TEST_CASES_ROOT}") ################################################# if (WIN32 AND BUILD_SHARED_LIBS) From a12ffd2e16db6ead54f5af7590ffdb1d71bfdaa9 Mon Sep 17 00:00:00 2001 From: Thomas Jollans Date: Sun, 26 May 2024 13:44:34 +0200 Subject: [PATCH 31/45] Illegal characters don't have to end words; they're illegal. Either behavious is correct; this restores the implementation-specific behaviour tested in kdlv2_test --- src/tokenizer.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/tokenizer.c b/src/tokenizer.c index 0cc09f3..75eaf37 100644 --- a/src/tokenizer.c +++ b/src/tokenizer.c @@ -182,8 +182,7 @@ bool _kdl_is_end_of_word(kdl_character_set charset, uint32_t c) { // is this character something that could terminate an identifier (or number) in some situation? return _kdl_is_whitespace(charset, c) || _kdl_is_newline(c) // - || c == ';' || c == ')' || c == '}' || c == '/' || c == '\\' || _kdl_is_equals_sign(charset, c) - || _kdl_is_illegal_char(charset, c); + || c == ';' || c == ')' || c == '}' || c == '/' || c == '\\' || _kdl_is_equals_sign(charset, c); } bool _kdl_is_illegal_char(kdl_character_set charset, uint32_t c) From 483b91ceaf878f982d2741633364edac20d55c6e Mon Sep 17 00:00:00 2001 From: Thomas Jollans Date: Sun, 26 May 2024 13:56:30 +0200 Subject: [PATCH 32/45] fix windows DLL test build --- tests/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 1f67e87..0a3ba88 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -154,6 +154,6 @@ add_test(NAME example_doc_test_v2 COMMAND "$" " if (WIN32 AND BUILD_SHARED_LIBS) # Copy kdl.dll to the test folder so that the tests work - add_custom_command(TARGET example_doc_test POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy $ $) + add_custom_command(TARGET parser_test POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy $ $) endif() From 43b49df72dceaa81be783e0abd0877eae09b227e Mon Sep 17 00:00:00 2001 From: Thomas Jollans Date: Sun, 26 May 2024 14:40:35 +0200 Subject: [PATCH 33/45] fix memory safety bug in example_doc_test --- tests/example_doc_test.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/tests/example_doc_test.c b/tests/example_doc_test.c index 0ebc6b8..d4ad7fd 100644 --- a/tests/example_doc_test.c +++ b/tests/example_doc_test.c @@ -106,11 +106,13 @@ void TEST_MAIN(void) for (char* p = fuzzy_buf; *p; ++p) if (*p == ':') ++n_fuzzy; char** fuzzy_test_cases = malloc(n_fuzzy * sizeof(char*)); - fuzzy_test_cases[0] = fuzzy_buf; - for (char *p = fuzzy_buf, **e = &fuzzy_test_cases[1]; *p; ++p) { - if (*p == ':') { - *p = '\0'; - *(e++) = p + 1; + if (n_fuzzy > 0) { + fuzzy_test_cases[0] = fuzzy_buf; + for (char *p = fuzzy_buf, **e = &fuzzy_test_cases[1]; *p; ++p) { + if (*p == ':') { + *p = '\0'; + *(e++) = p + 1; + } } } @@ -121,11 +123,13 @@ void TEST_MAIN(void) for (char* p = skip_buf; *p; ++p) if (*p == ':') ++n_skip; char** skipped_test_cases = malloc(n_skip * sizeof(char*)); - skipped_test_cases[0] = skip_buf; - for (char *p = skip_buf, **e = &skipped_test_cases[1]; *p; ++p) { - if (*p == ':') { - *p = '\0'; - *(e++) = p + 1; + if (n_skip > 0) { + skipped_test_cases[0] = skip_buf; + for (char *p = skip_buf, **e = &skipped_test_cases[1]; *p; ++p) { + if (*p == ':') { + *p = '\0'; + *(e++) = p + 1; + } } } From f26273f8200924eb51ca89325c90b6c83d656cc0 Mon Sep 17 00:00:00 2001 From: Thomas Jollans Date: Sun, 26 May 2024 14:53:35 +0200 Subject: [PATCH 34/45] remove kdl_escape_v1 etc from public API --- include/kdl/common.h | 10 ---------- src/str.h | 16 +++++++++++++--- tests/kdlv2_test.c | 10 +++++----- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/include/kdl/common.h b/include/kdl/common.h index e363d06..67f6813 100644 --- a/include/kdl/common.h +++ b/include/kdl/common.h @@ -62,16 +62,6 @@ KDL_NODISCARD KDL_EXPORT kdl_owned_string kdl_clone_str(kdl_str const* s); // Free the memory associated with an owned string, and set the pointer to NULL KDL_EXPORT void kdl_free_string(kdl_owned_string* s); -// Escape special characters in a string according to KDLv1 string rules -KDL_NODISCARD KDL_EXPORT kdl_owned_string kdl_escape_v1(kdl_str const* s, kdl_escape_mode mode); -// Resolve backslash escape sequences according to KDLv1 rules -KDL_NODISCARD KDL_EXPORT kdl_owned_string kdl_unescape_v1(kdl_str const* s); - -// Escape special characters in a string according to KDLv2 string rules -KDL_NODISCARD KDL_EXPORT kdl_owned_string kdl_escape_v2(kdl_str const* s, kdl_escape_mode mode); -// Resolve backslash escape sequences according to KDLv2 rules -KDL_NODISCARD KDL_EXPORT kdl_owned_string kdl_unescape_v2(kdl_str const* s); - // Escape special characters in a string KDL_NODISCARD KDL_EXPORT kdl_owned_string kdl_escape_v(kdl_version version, kdl_str const* s, kdl_escape_mode mode); // Resolve backslash escape sequences diff --git a/src/str.h b/src/str.h index b3e19fd..eea22c0 100644 --- a/src/str.h +++ b/src/str.h @@ -15,13 +15,23 @@ struct _kdl_write_buffer { typedef struct _kdl_write_buffer _kdl_write_buffer; -_kdl_write_buffer _kdl_new_write_buffer(size_t initial_size); +KDL_NODISCARD _kdl_write_buffer _kdl_new_write_buffer(size_t initial_size); bool _kdl_buf_push_chars(_kdl_write_buffer* buf, char const* s, size_t count); bool _kdl_buf_push_char(_kdl_write_buffer* buf, char c); bool _kdl_buf_push_codepoint(_kdl_write_buffer* buf, uint32_t c); -kdl_owned_string _kdl_buf_to_string(_kdl_write_buffer* buf); +KDL_NODISCARD kdl_owned_string _kdl_buf_to_string(_kdl_write_buffer* buf); void _kdl_free_write_buffer(_kdl_write_buffer* buf); -kdl_owned_string _kdl_dedent_multiline_string(kdl_str const* s); +// Escape special characters in a string according to KDLv1 string rules +KDL_NODISCARD kdl_owned_string kdl_escape_v1(kdl_str const* s, kdl_escape_mode mode); +// Resolve backslash escape sequences according to KDLv1 rules +KDL_NODISCARD kdl_owned_string kdl_unescape_v1(kdl_str const* s); + +// Escape special characters in a string according to KDLv2 string rules +KDL_NODISCARD kdl_owned_string kdl_escape_v2(kdl_str const* s, kdl_escape_mode mode); +// Resolve backslash escape sequences according to KDLv2 rules +KDL_NODISCARD kdl_owned_string kdl_unescape_v2(kdl_str const* s); + +KDL_NODISCARD kdl_owned_string _kdl_dedent_multiline_string(kdl_str const* s); #endif // KDL_INTERNAL_STR_H_ diff --git a/tests/kdlv2_test.c b/tests/kdlv2_test.c index d83bdfe..fd6cb7d 100644 --- a/tests/kdlv2_test.c +++ b/tests/kdlv2_test.c @@ -170,13 +170,13 @@ static void test_tokenizer_equals(void) static void test_string_escapes(void) { kdl_str s = kdl_str_from_cstr("\\s\\ \t \\u{1b}\\\x0b "); - kdl_owned_string unesc = kdl_unescape_v2(&s); + kdl_owned_string unesc = kdl_unescape_v(KDL_VERSION_2, &s); ASSERT(unesc.len == 2); ASSERT(memcmp(unesc.data, " \x1b", 2) == 0); kdl_str unesc_ = kdl_borrow_str(&unesc); - kdl_owned_string reesc = kdl_escape_v2(&unesc_, KDL_ESCAPE_DEFAULT); + kdl_owned_string reesc = kdl_escape_v(KDL_VERSION_2, &unesc_, KDL_ESCAPE_DEFAULT); ASSERT(reesc.len == 7); ASSERT(memcmp(reesc.data, " \\u{1b}", 7) == 0); @@ -198,7 +198,7 @@ static void test_multiline_strings(void) int n_escaped_variants = sizeof(escaped_variants) / sizeof(escaped_variants[0]); for (int i = 0; i < n_escaped_variants; ++i) { - kdl_owned_string result = kdl_unescape_v2(&escaped_variants[i]); + kdl_owned_string result = kdl_unescape_v(KDL_VERSION_2, &escaped_variants[i]); ASSERT(result.len == expected.len); ASSERT(memcmp(result.data, expected.data, expected.len) == 0); kdl_free_string(&result); @@ -211,7 +211,7 @@ static void test_multiline_strings(void) int n_invalid_strings = sizeof(invalid_strings) / sizeof(invalid_strings[0]); for (int i = 0; i < n_invalid_strings; ++i) { - kdl_owned_string result = kdl_unescape_v2(&invalid_strings[i]); + kdl_owned_string result = kdl_unescape_v(KDL_VERSION_2, &invalid_strings[i]); ASSERT(result.data == NULL); } @@ -226,7 +226,7 @@ static void test_multiline_strings(void) for (int i = 0; i < n_edge_cases; ++i) { kdl_str const* input = &edge_cases[i][0]; kdl_str const* output = &edge_cases[i][1]; - kdl_owned_string result = kdl_unescape_v2(input); + kdl_owned_string result = kdl_unescape_v(KDL_VERSION_2, input); ASSERT(result.len == output->len); ASSERT(memcmp(result.data, output->data, output->len) == 0); kdl_free_string(&result); From 8af372b437bde5acb60b9010bcf243db42c12847 Mon Sep 17 00:00:00 2001 From: Thomas Jollans Date: Sun, 26 May 2024 14:58:43 +0200 Subject: [PATCH 35/45] v1 test files should keep their line endings as well needed for MSYS v1 tests to pass --- tests/test_documents/upstream/{2.0.0.draft => }/.gitattributes | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tests/test_documents/upstream/{2.0.0.draft => }/.gitattributes (100%) diff --git a/tests/test_documents/upstream/2.0.0.draft/.gitattributes b/tests/test_documents/upstream/.gitattributes similarity index 100% rename from tests/test_documents/upstream/2.0.0.draft/.gitattributes rename to tests/test_documents/upstream/.gitattributes From 0b68bcb8eaea72b06b718cfe3e13e7f37143aa66 Mon Sep 17 00:00:00 2001 From: Thomas Jollans Date: Sun, 26 May 2024 15:48:29 +0200 Subject: [PATCH 36/45] Update docs --- doc/ckdl-api.rst | 50 ++++++++++++++++++++++++++++++++----- doc/index.rst | 16 +++++++++--- include/kdl/common-macros.h | 5 ++++ include/kdl/common.h | 2 ++ src/utils/ckdl-cat.c | 2 +- 5 files changed, 64 insertions(+), 11 deletions(-) diff --git a/doc/ckdl-api.rst b/doc/ckdl-api.rst index f95c708..4714ef0 100644 --- a/doc/ckdl-api.rst +++ b/doc/ckdl-api.rst @@ -131,18 +131,32 @@ by the KDL spec. For generating the escapes, there are a few options: "Sensible" default: escape tabs, newlines, and other control characters, but leave most non-ASCII Unicode intact. -.. c:function:: kdl_owned_string kdl_escape(kdl_str const* s, kdl_escape_mode mode) +String behaviour varies by KDL version: + +.. c:type:: enum kdl_version kdl_version + + .. c:enumerator:: KDL_VERSION_1 + + KDL 1.0.0 rules (e.g. ``\/`` is a valid escape sequence) + + .. c:enumerator:: KDL_VERSION_2 + + KDL 2.0.0 rules (e.g. ``\s`` escapes the space character) + +.. c:function:: kdl_owned_string kdl_escape_v(kdl_version version, kdl_str const* s, kdl_escape_mode mode) Escape special characters in a string. + :param version: The KDL version to use :param s: The original string :param mode: How to escape :return: A string that could be surrounded by ``""`` in a KDL file -.. c:function:: kdl_owned_string kdl_unescape(kdl_str const* s) +.. c:function:: kdl_owned_string kdl_unescape_v(kdl_version version, kdl_str const* s) Resolve backslash escape sequences + :param version: The KDL version to use :param s: A string that might have been surrounded by ``""`` in a KDL file :return: The string with all backslash escapes replaced @@ -280,7 +294,6 @@ The events produced by the ckdl parser are: been commented out using a slashdash (``/-``) are rendered as their original type ORed with :c:enumerator:`KDL_EVENT_COMMENT` (e.g., ``KDL_EVENT_COMMENT | KDL_EVENT_START_NODE``) - Each event is associated with certain event data: .. c:type:: struct kdl_event_data kdl_event_data @@ -349,12 +362,33 @@ If you wish, you may configure the parser to emit comments in addition to "regul .. c:enumerator:: KDL_DEFAULTS - By default, ignore all comments + By default, support KDL 1.0.0 only and ignore all comments .. c:enumerator:: KDL_EMIT_COMMENTS Produce events for comments and events deleted using ``/-`` + + .. c:enumerator:: KDL_READ_VERSION_1 + + Use KDL version 1.0.0 (this is the default) + + .. c:enumerator:: KDL_READ_VERSION_2 + + Use KDL version 2.0.0 (draft) + + .. c:enumerator:: KDL_DETECT_VERSION + + Allow both KDL v2 and KDL v1. This will be the default in future. + + This mode aims to produce entirely correct output for all KDLv2 documents as well as + for *almost* all KDLv1 documents. If you need complete KDLv1 compliance, use + ``KDL_READ_VERSION_1`` instead. + + If you're not reading from a stream (and can afford to parse the document twice), + consider running the parser in both ``KDL_READ_VERSION_2`` mode and ``KDL_READ_VERSION_1`` + mode for maximum standard compliance. + The parser object provides one method: .. c:function:: kdl_event_data* kdl_parser_next_event(kdl_parser* parser) @@ -362,7 +396,7 @@ The parser object provides one method: Get the next event in the document from a KDL parser :param parser: The parser - :return: A pointer to a parse event structure. This pointer is valid until the next call to + :return: A pointer to a parse event structure. This pointer is valid until the next call to :c:func:`kdl_parser_next_event` for this parser. The next call also invalidates all :c:type:`kdl_str` pointers which may be contained in the event data. @@ -433,10 +467,14 @@ text. How should identifiers (i.e., node names, type annotations and property keys) be rendered? (default: :c:enumerator:`KDL_PREFER_BARE_IDENTIFIERS`) - .. c:member::kdl_float_printing_options float_mode + .. c:member:: kdl_float_printing_options float_mode How exactly should doubles be formatted? + .. c:member:: kdl_version version + + KDL version to use. + .. c:type:: enum kdl_identifier_emission_mode kdl_identifier_emission_mode .. c:enumerator:: KDL_PREFER_BARE_IDENTIFIERS diff --git a/doc/index.rst b/doc/index.rst index 8a4c672..74bebe8 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -22,6 +22,10 @@ The ckdl project also features simple "demo" bindings for the following language * :doc:`Python 3 ` * :doc:`C++ 20 ` +ckdl supports KDL version 1.0.0 and has preliminary support for KDL 2.0.0 (draft spec). +KDL 2 support has to be explicitly enabled. When the KDL 2 spec is finalized, future +versions of ckdl will default to parsing both KDL 2 and KDL 1 documents. + Building ckdl ------------- @@ -35,12 +39,17 @@ ckdl is written in portable modern C, and it should ideally run anywhere you hav modern C compiler with at least a minimal standard library. The only really platform-dependent code is in the test suite, which you don't have to build if you can't. -ckdl has been tested with: +ckdl is routinely tested on recent versions of: + +* Linux (x86_64, x86) with glibc +* Windows (x64), with Microsoft Visual C++ +* MacOS (arm64, x86_64) + +ckdl has in the past additionally been tested with: * Linux (x86_64, x86, arm64, arm32v7l), with glibc and musl libc - going back as far as CentOS 6 -* MacOS (arm64, x86_64) -* Windows 10 (x86_64, x86), using Microsoft Visual C++ and Mingw-w64 +* Windows wih Mingw-w64 * FreeBSD 12 on x86_64 * NetBSD 5 on x86_64 * Illumos (OmniOS) on x86_64 @@ -76,7 +85,6 @@ The CMake scripts support a few options, including: library * ``-DBUILD_KDLPP=OFF``: Disable building the C++20 bindings * ``-DBUILD_TESTS=OFF``: Disable building the test suite -* ``-DDOWNLOAD_TEST_DATA=OFF``: Don't download test data from GitHub during configure To run the test suite, run ``make test`` or ``ctest`` in the build directory. diff --git a/include/kdl/common-macros.h b/include/kdl/common-macros.h index c3c1c32..c404244 100644 --- a/include/kdl/common-macros.h +++ b/include/kdl/common-macros.h @@ -4,8 +4,13 @@ // define attributes for functions #if defined(__cplusplus) # define KDL_NODISCARD [[nodiscard]] +# define KDL_DEPRECATED(reason) [[deprecated(reason)]] #elif defined(__GNUC__) # define KDL_NODISCARD __attribute__((warn_unused_result)) +# define KDL_DEPRECATED(reason) __attribute__((deprecated)) +#elif defined(_MSC_VER) +# define KDL_NODISCARD +# define KDL_DEPRECATED(reason) __declspec(deprecated(reason)) #else # define KDL_NODISCARD #endif diff --git a/include/kdl/common.h b/include/kdl/common.h index 67f6813..4b104e5 100644 --- a/include/kdl/common.h +++ b/include/kdl/common.h @@ -68,8 +68,10 @@ KDL_NODISCARD KDL_EXPORT kdl_owned_string kdl_escape_v(kdl_version version, kdl_ KDL_NODISCARD KDL_EXPORT kdl_owned_string kdl_unescape_v(kdl_version version, kdl_str const* s); // Escape special characters in a string according to KDLv1 string rules (subject to change) +KDL_DEPRECATED("Use kdl_escape_v instead") KDL_NODISCARD KDL_EXPORT kdl_owned_string kdl_escape(kdl_str const* s, kdl_escape_mode mode); // Resolve backslash escape sequences according to KDLv1 rules (subject to change) +KDL_DEPRECATED("Use kdl_unescape_v instead") KDL_NODISCARD KDL_EXPORT kdl_owned_string kdl_unescape(kdl_str const* s); #ifdef __cplusplus diff --git a/src/utils/ckdl-cat.c b/src/utils/ckdl-cat.c index 79fbc2f..9c9284e 100644 --- a/src/utils/ckdl-cat.c +++ b/src/utils/ckdl-cat.c @@ -32,7 +32,7 @@ bool kdl_cat_file_to_file(FILE* in, FILE* out) bool kdl_cat_file_to_file_opt(FILE* in, FILE* out, kdl_emitter_options const* opt) { - kdl_cat_file_to_file_ex(in, out, KDL_DEFAULTS, opt); + return kdl_cat_file_to_file_ex(in, out, KDL_DEFAULTS, opt); } bool kdl_cat_file_to_file_ex(FILE* in, FILE* out, kdl_parse_option parse_opt, kdl_emitter_options const* emit_opt) From 466358e784bb0a1e42f815ccfb0aefd7eaa75ee1 Mon Sep 17 00:00:00 2001 From: Thomas Jollans Date: Sun, 26 May 2024 16:50:30 +0200 Subject: [PATCH 37/45] KDLv2 support in Python API --- bindings/python/src/ckdl/_ckdl.pyx | 41 +++++++++++++++++++++++++--- bindings/python/src/ckdl/_libkdl.pxd | 11 ++++++++ doc/ckdl-py.rst | 25 +++++++++++++++-- setup.py | 2 +- 4 files changed, 72 insertions(+), 7 deletions(-) diff --git a/bindings/python/src/ckdl/_ckdl.pyx b/bindings/python/src/ckdl/_ckdl.pyx index bed8b13..b3eaad6 100644 --- a/bindings/python/src/ckdl/_ckdl.pyx +++ b/bindings/python/src/ckdl/_ckdl.pyx @@ -416,18 +416,24 @@ cpdef enum IdentifierMode: quote_all_identifiers = KDL_QUOTE_ALL_IDENTIFIERS ascii_identifiers = KDL_ASCII_IDENTIFIERS +cpdef enum KdlVersion: + kdl_1 = KDL_VERSION_1 + kdl_2 = KDL_VERSION_2 + cdef class EmitterOptions: cdef public int indent cdef public EscapeMode escape_mode cdef public IdentifierMode identifier_mode cdef public FloatMode float_mode + cdef public KdlVersion version def __init__( self, *, indent=None, escape_mode=None, identifier_mode=None, - float_mode=None): + float_mode=None, + version=None): if indent is not None: self.indent = indent else: @@ -444,20 +450,38 @@ cdef class EmitterOptions: self.float_mode = float_mode else: self.float_mode = FloatMode() + if isinstance(version, int): + if version == 1: + self.version = KdlVersion.kdl_1 + elif version == 2: + self.version = KdlVersion.kdl_2 + else: + raise ValueError(f"Unknown version: {version}") + elif isinstance(version, KdlVersion): + self.version = version + elif version is not None: + raise TypeError(f"Expected int or KdlVersion for version, not {type(version)}") cdef kdl_emitter_options _to_c_struct(self): - cdef kdl_emitter_options res + cdef kdl_emitter_options res = KDL_DEFAULT_EMITTER_OPTIONS res.indent = self.indent res.escape_mode = self.escape_mode res.identifier_mode = self.identifier_mode res.float_mode = self.float_mode._to_c_struct() + res.version = self.version return res -def parse(str kdl_text): +def parse(str kdl_text, *, version=1): """ parse(kdl_text) Parse a KDL document (must be a str) and return a Document. + + Pass a ``version`` argument to specify the KDL version (default: 1) + + parse(kdl_text, version=1) + parse(kdl_text, version=2) + parse(kdl_text, version="any") """ cdef kdl_event_data* ev @@ -468,10 +492,19 @@ def parse(str kdl_text): cdef list nodes = root_node_list cdef Node current_node = None + cdef kdl_parse_option parse_opt + + if version in (1, '1', '1.0.0'): + parse_opt = KDL_READ_VERSION_1 + elif version in (2, '2', '2.0.0'): + parse_opt = KDL_READ_VERSION_2 + elif version in (None, 'either', 'any', 'detect'): + parse_opt = KDL_DETECT_VERSION + byte_str = kdl_text.encode("utf-8") kdl_doc.data = byte_str kdl_doc.len = len(byte_str) - parser = kdl_create_string_parser(kdl_doc, KDL_DEFAULTS) + parser = kdl_create_string_parser(kdl_doc, parse_opt) while True: ev = kdl_parser_next_event(parser) diff --git a/bindings/python/src/ckdl/_libkdl.pxd b/bindings/python/src/ckdl/_libkdl.pxd index 3ba0aee..d3ffcaf 100644 --- a/bindings/python/src/ckdl/_libkdl.pxd +++ b/bindings/python/src/ckdl/_libkdl.pxd @@ -7,6 +7,10 @@ cdef extern from "kdl/common.h": KDL_ESCAPE_ASCII_MODE =0x170, KDL_ESCAPE_DEFAULT = KDL_ESCAPE_CONTROL | KDL_ESCAPE_NEWLINE | KDL_ESCAPE_TAB + ctypedef enum kdl_version: + KDL_VERSION_1, + KDL_VERSION_2 + ctypedef size_t (*kdl_read_func)(void *user_data, char *buf, size_t bufsize); ctypedef size_t (*kdl_write_func)(void *user_data, const char *data, size_t nbytes); @@ -27,6 +31,9 @@ cdef extern from "kdl/common.h": cdef kdl_owned_string kdl_escape(const kdl_str *s, kdl_escape_mode mode) cdef kdl_owned_string kdl_unescape(const kdl_str *s) + cdef kdl_owned_string kdl_escape_v(kdl_version version, const kdl_str *s, kdl_escape_mode mode) + cdef kdl_owned_string kdl_unescape_v(kdl_version version, const kdl_str *s) + cdef extern from "kdl/value.h": ctypedef enum kdl_type: KDL_TYPE_NULL, @@ -65,6 +72,9 @@ cdef extern from "kdl/parser.h": ctypedef enum kdl_parse_option: KDL_DEFAULTS = 0, KDL_EMIT_COMMENTS = 1, + KDL_READ_VERSION_1 = 0x20000, + KDL_READ_VERSION_2 = 0x40000, + KDL_DETECT_VERSION = 0x70000 ctypedef struct kdl_event_data: kdl_event event @@ -99,6 +109,7 @@ cdef extern from "kdl/emitter.h": kdl_escape_mode escape_mode kdl_identifier_emission_mode identifier_mode kdl_float_printing_options float_mode + kdl_version version cdef kdl_emitter_options KDL_DEFAULT_EMITTER_OPTIONS diff --git a/doc/ckdl-py.rst b/doc/ckdl-py.rst index 2a5ad0b..3ae91a2 100644 --- a/doc/ckdl-py.rst +++ b/doc/ckdl-py.rst @@ -37,7 +37,7 @@ Reading >>> kdl_txt = """ ... node1 1 2 "three" (f64)4.0 { ... (some-type)"first child" - ... child-#2 prop="val" + ... child-2 prop="val" ... } ... """ >>> doc = ckdl.parse(kdl_txt) @@ -59,11 +59,20 @@ Reading >>> doc[0].args[3].type_annotation 'f64' >>> doc[0].children - [, ] + [, ] >>> doc[0].children[0].type_annotation 'some-type' >>> doc[0].children[1].properties {'prop': 'val'} + >>> + >>> # KDL v2 can be enabled like this + >>> + >>> doc2 = ckdl.parse("one 2 three #inf", version="detect") + >>> doc2.nodes + [] + >>> doc2.nodes[0].args + [2, 'three', inf] + >>> Writing """"""" @@ -87,6 +96,18 @@ Writing node2 "arg1" "arg2" some_property="foo" { child3 } + >>> + >>> # KDL v2 output + >>> + >>> print(mydoc.dump(ckdl.EmitterOptions(version=2))) + node1 "argument 1" 2 #null node1-prop=65535 { + child1 + (child2-type)child2 child2_prop=#true + } + node2 arg1 arg2 some_property=foo { + child3 + } + API diff --git a/setup.py b/setup.py index 0a8ece8..98a69bd 100644 --- a/setup.py +++ b/setup.py @@ -55,7 +55,7 @@ setup( name="ckdl", - version="0.1.2", + version="0.2.0a1", description="KDL parser and writer with a C back-end", long_description=__doc__, long_description_content_type="text/markdown", From 546ab6f447484e9469cc8c3ed0ce9e2e6bac94a1 Mon Sep 17 00:00:00 2001 From: Thomas Jollans Date: Sun, 26 May 2024 16:58:47 +0200 Subject: [PATCH 38/45] correct v1 support from Python --- bindings/python/src/ckdl/_ckdl.pyx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bindings/python/src/ckdl/_ckdl.pyx b/bindings/python/src/ckdl/_ckdl.pyx index b3eaad6..a3dc070 100644 --- a/bindings/python/src/ckdl/_ckdl.pyx +++ b/bindings/python/src/ckdl/_ckdl.pyx @@ -499,7 +499,12 @@ def parse(str kdl_text, *, version=1): elif version in (2, '2', '2.0.0'): parse_opt = KDL_READ_VERSION_2 elif version in (None, 'either', 'any', 'detect'): - parse_opt = KDL_DETECT_VERSION + try: + return parse(kdl_text, version=2) + except ParseError: + return parse(kdl_text, version=1) + else: + raise ValueError(f"Unexpected value for version: {version}") byte_str = kdl_text.encode("utf-8") kdl_doc.data = byte_str From 66d517e57e92e531e974a47873aaaa2271627bca Mon Sep 17 00:00:00 2001 From: Thomas Jollans Date: Sun, 26 May 2024 17:09:22 +0200 Subject: [PATCH 39/45] fix memory error for empty multiline strings --- src/str.c | 38 ++++++++++++++++++++------------------ tests/kdlv2_test.c | 1 + 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/src/str.c b/src/str.c index 1e25ed8..c0113c3 100644 --- a/src/str.c +++ b/src/str.c @@ -520,28 +520,30 @@ kdl_owned_string _kdl_dedent_multiline_string(kdl_str const* s) char const* end = norm_lf.data + norm_lf.len; bool at_start = true; // copy the rest of the string - while (in < end) { - *out = *in; - if (*in == '\n') { - if (in + 1 < end && *(in + 1) == '\n') { - // double newline - ok - } else { - // check indent - if (memcmp(in + 1, indent.data, indent.len) == 0) { - // skip indent - in += indent.len; + if (norm_lf.len > 1) { + while (in < end) { + *out = *in; + if (*in == '\n') { + if (in + 1 < end && *(in + 1) == '\n') { + // double newline - ok } else { - goto dedent_err; + // check indent + if (memcmp(in + 1, indent.data, indent.len) == 0) { + // skip indent + in += indent.len; + } else { + goto dedent_err; + } } } + if (!at_start) { + // Skip the initial newline => only advance the output pointer + // if we're somewhere other than the initial newline + ++out; + } + ++in; + at_start = false; } - if (!at_start) { - // Skip the initial newline => only advance the output pointer - // if we're somewhere other than the initial newline - ++out; - } - ++in; - at_start = false; } size_t len = out - buf_dedented; diff --git a/tests/kdlv2_test.c b/tests/kdlv2_test.c index fd6cb7d..7c01129 100644 --- a/tests/kdlv2_test.c +++ b/tests/kdlv2_test.c @@ -217,6 +217,7 @@ static void test_multiline_strings(void) kdl_str edge_cases[][2] = { {kdl_str_from_cstr("\n\t"), kdl_str_from_cstr("") }, // empty + {kdl_str_from_cstr("\n"), kdl_str_from_cstr("") }, // empty {kdl_str_from_cstr("\n\n hello\n "), kdl_str_from_cstr("\nhello")}, // double newline at start {kdl_str_from_cstr("\n \\\n \n "), kdl_str_from_cstr("") }, // escaped newline within {kdl_str_from_cstr("\n \n \n "), kdl_str_from_cstr("\n ") }, // whitespace only From 1b478ee2b1bf01b2ae31950cd1a0bffed6d58196 Mon Sep 17 00:00:00 2001 From: Thomas Jollans Date: Sun, 26 May 2024 17:22:46 +0200 Subject: [PATCH 40/45] v2 support in kdlpp --- bindings/cpp/include/kdlpp.h | 8 ++++++++ bindings/cpp/src/kdlpp.cpp | 28 ++++++++++++++++++++++++---- bindings/cpp/tests/kdlpp_test.cpp | 14 ++++++++++++++ 3 files changed, 46 insertions(+), 4 deletions(-) diff --git a/bindings/cpp/include/kdlpp.h b/bindings/cpp/include/kdlpp.h index 479ebd8..b18b9e5 100644 --- a/bindings/cpp/include/kdlpp.h +++ b/bindings/cpp/include/kdlpp.h @@ -33,6 +33,12 @@ typedef struct _kdl_parser kdl_parser; namespace kdl { +enum class KdlVersion { + Kdl_1, + Kdl_2, + Any +}; + template concept _arithmetic = std::is_arithmetic_v; class TypeError : public std::exception { @@ -346,10 +352,12 @@ class KDLPP_EXPORT Document { auto end() { return m_nodes.end(); } std::u8string to_string() const; + std::u8string to_string(KdlVersion version) const; }; // Load a KDL document from string KDLPP_EXPORT Document parse(std::u8string_view kdl_text); +KDLPP_EXPORT Document parse(std::u8string_view kdl_text, KdlVersion version); } // namespace kdl diff --git a/bindings/cpp/src/kdlpp.cpp b/bindings/cpp/src/kdlpp.cpp index d8c4bf7..ced22fb 100644 --- a/bindings/cpp/src/kdlpp.cpp +++ b/bindings/cpp/src/kdlpp.cpp @@ -201,9 +201,16 @@ Document Document::read_from(kdl_parser* parser) } } -std::u8string Document::to_string() const +std::u8string Document::to_string() const { return to_string(KdlVersion::Kdl_1); } + +std::u8string Document::to_string(KdlVersion version) const { - kdl_emitter* emitter = kdl_create_buffering_emitter(&KDL_DEFAULT_EMITTER_OPTIONS); + kdl_emitter_options opts = KDL_DEFAULT_EMITTER_OPTIONS; + + if (version == KdlVersion::Kdl_1) opts.version = KDL_VERSION_1; + if (version == KdlVersion::Kdl_2) opts.version = KDL_VERSION_2; + + kdl_emitter* emitter = kdl_create_buffering_emitter(&opts); if (emitter == nullptr) throw EmitterError{"Error initializing the KDL emitter"}; emit_nodes(emitter, m_nodes); auto result = std::u8string{to_u8string_view(kdl_get_emitter_buffer(emitter))}; @@ -211,10 +218,23 @@ std::u8string Document::to_string() const return result; } -Document parse(std::u8string_view kdl_text) +Document parse(std::u8string_view kdl_text) { return parse(kdl_text, KdlVersion::Kdl_1); } + +Document parse(std::u8string_view kdl_text, KdlVersion version) { + kdl_parse_option opts = KDL_DEFAULTS; + if (version == KdlVersion::Kdl_1) opts = KDL_READ_VERSION_1; + else if (version == KdlVersion::Kdl_2) opts = KDL_READ_VERSION_2; + else if (version == KdlVersion::Any) { + try { + return parse(kdl_text, KdlVersion::Kdl_2); + } catch (ParseError const&) { + return parse(kdl_text, KdlVersion::Kdl_1); + } + } + kdl_str text = {reinterpret_cast(kdl_text.data()), kdl_text.size()}; - kdl_parser* parser = kdl_create_string_parser(text, KDL_DEFAULTS); + kdl_parser* parser = kdl_create_string_parser(text, opts); if (parser == nullptr) throw std::runtime_error("Error initializing the KDL parser"); auto doc = Document::read_from(parser); kdl_destroy_parser(parser); diff --git a/bindings/cpp/tests/kdlpp_test.cpp b/bindings/cpp/tests/kdlpp_test.cpp index 9937d6c..53d3ccc 100644 --- a/bindings/cpp/tests/kdlpp_test.cpp +++ b/bindings/cpp/tests/kdlpp_test.cpp @@ -103,6 +103,19 @@ static void test_writing_demo() // clang-format off } +static void test_cycle_kdl2() +{ + auto txt1 = u8"node1 #true"; + + auto doc1 = kdl::parse(txt1, kdl::KdlVersion::Kdl_2); + auto txt2 = doc1.to_string(kdl::KdlVersion::Kdl_2); + ASSERT(txt2 == txt1); + + auto doc2 = kdl::parse(txt1, kdl::KdlVersion::Any); + auto txt3 = doc2.to_string(kdl::KdlVersion::Kdl_2); + ASSERT(txt3 == txt1); +} + void TEST_MAIN() { run_test("kdlpp: cycle", &test_cycle); @@ -110,5 +123,6 @@ void TEST_MAIN() run_test("kdlpp: Value::from_string", &test_value_from_string); run_test("kdlpp: reading demo code", &test_reading_demo); run_test("kdlpp: writing demo code", &test_writing_demo); + run_test("kdlpp: KDLv2 support", &test_cycle_kdl2); } From 1675e0d8e9fb17a01f607a2059445b1105c6406e Mon Sep 17 00:00:00 2001 From: Thomas Jollans Date: Sun, 26 May 2024 17:35:32 +0200 Subject: [PATCH 41/45] Readme update --- README.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3c07024..ec4009c 100644 --- a/README.md +++ b/README.md @@ -26,8 +26,11 @@ under `doc/` in this repository. ### Status -ckdl passes all test cases in the KDL test suite except for one where a number is -formatted a little differently. +ckdl has full support for **KDL 1.0.0** and passes the upstream test suite. -It's reasonable to suspect that ckdl is *close* to being standard-compliant, but -of course it's always possible there are bugs affecting some finer details. +ckdl has experimental (opt-in) support for a [draft version of KDL 2.0.0][kdl2]. +For the time being, KDLv2 support has to be explicitly requested via parser/emitter +options; this behaviour is subject to change once KDLv2 is finalized. + +The parser also supports a hybrid mode that accepts both KDLv2 and KDLv1 +documents. From e07a5d589034d0fdfcb7f899c64168cf9f8ab0e0 Mon Sep 17 00:00:00 2001 From: Thomas Jollans Date: Sun, 26 May 2024 20:25:29 +0200 Subject: [PATCH 42/45] Document KDLv2 support in python package API docs --- bindings/python/src/ckdl/_ckdl.pyx | 2 +- doc/ckdl-py.rst | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/bindings/python/src/ckdl/_ckdl.pyx b/bindings/python/src/ckdl/_ckdl.pyx index a3dc070..04395e8 100644 --- a/bindings/python/src/ckdl/_ckdl.pyx +++ b/bindings/python/src/ckdl/_ckdl.pyx @@ -498,7 +498,7 @@ def parse(str kdl_text, *, version=1): parse_opt = KDL_READ_VERSION_1 elif version in (2, '2', '2.0.0'): parse_opt = KDL_READ_VERSION_2 - elif version in (None, 'either', 'any', 'detect'): + elif version in (None, 'detect'): try: return parse(kdl_text, version=2) except ParseError: diff --git a/doc/ckdl-py.rst b/doc/ckdl-py.rst index 3ae91a2..e76192d 100644 --- a/doc/ckdl-py.rst +++ b/doc/ckdl-py.rst @@ -126,12 +126,14 @@ emitter. Parsing """"""" -.. py:function:: parse(kdl_doc) +.. py:function:: parse(kdl_doc, *, version=1) Parse a KDL document :param kdl_doc: The KDL document to parse :type kdl_doc: str + :param version: Which version(s) to accept: ``1`` for KDLv1 only, ``2`` for KDLv2 only, + or either ``None`` or ``"detect"`` to support both. :rtype: Document :raises: :py:exc:`ParseError` @@ -226,7 +228,7 @@ Data types Emitter configuration """"""""""""""""""""" -.. py:class:: EmitterOptions(*, indent=None, escape_mode=None, identifier_mode=None, float_mode=None) +.. py:class:: EmitterOptions(*, indent=None, escape_mode=None, identifier_mode=None, float_mode=None, version=None) .. py:attribute:: indent @@ -252,6 +254,12 @@ Emitter configuration :type: FloatMode + .. py:attribute:: version + + Which KDL version to emit? The constructor accepts :py:class:`KdlVersion` and :py:class:`int`. + + :type: KdlVersion + .. py:class:: EscapeMode Enum @@ -298,3 +306,9 @@ Emitter configuration :type: int +.. py:class:: KdlVersion + + Enum + + .. py:attribute:: kdl_1 + .. py:attribute:: kdl_2 From fe6ed6e2a26865de1fe557ecfab4a7d06b97c820 Mon Sep 17 00:00:00 2001 From: Thomas Jollans Date: Sun, 26 May 2024 20:33:05 +0200 Subject: [PATCH 43/45] Clarify meaning of KDL_ESCAPE_MINIMAL for KDLv2 --- doc/ckdl-api.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/ckdl-api.rst b/doc/ckdl-api.rst index 4714ef0..f9f939a 100644 --- a/doc/ckdl-api.rst +++ b/doc/ckdl-api.rst @@ -108,7 +108,8 @@ by the KDL spec. For generating the escapes, there are a few options: .. c:enumerator:: KDL_ESCAPE_MINIMAL = 0 - Only escape what *must* be escaped: ``"`` and ``\`` + Only escape what *must* be escaped: ``"``, ``\``, and (in KDLv2) any characters which aren't + allowed to appear in KDL files. .. c:enumerator:: KDL_ESCAPE_CONTROL = 0x10 From 33a79941414c3fd2700c15167fbda056670f3ecb Mon Sep 17 00:00:00 2001 From: Thomas Jollans Date: Thu, 13 Jun 2024 21:57:24 +0200 Subject: [PATCH 44/45] fix string whitespace behaviour --- src/str.c | 82 +++++++++++++++++++++++++++++++++++--------- src/str.h | 1 + tests/CMakeLists.txt | 6 ---- 3 files changed, 67 insertions(+), 22 deletions(-) diff --git a/src/str.c b/src/str.c index c0113c3..dd7f094 100644 --- a/src/str.c +++ b/src/str.c @@ -349,7 +349,9 @@ kdl_owned_string kdl_escape_v2(kdl_str const* s, kdl_escape_mode mode) kdl_owned_string kdl_unescape_v2(kdl_str const* s) { kdl_owned_string result; - kdl_owned_string dedented = _kdl_dedent_multiline_string(s); + kdl_owned_string no_ws_escapes = _kdl_remove_escaped_whitespace(s); + kdl_str pre_dedent = kdl_borrow_str(&no_ws_escapes); + kdl_owned_string dedented = _kdl_dedent_multiline_string(&pre_dedent); kdl_str escaped = kdl_borrow_str(&dedented); size_t orig_len = escaped.len; @@ -411,21 +413,8 @@ kdl_owned_string kdl_unescape_v2(kdl_str const* s) break; } default: - // See if this is a whitespace escape - if (_kdl_is_whitespace(KDL_CHARACTER_SET_V2, c) || _kdl_is_newline(c)) { - kdl_str tail = escaped; // make a copy - we will advance too far - while ((status = _kdl_pop_codepoint(&tail, &c)) == KDL_UTF8_OK - && (_kdl_is_whitespace(KDL_CHARACTER_SET_V2, c) || _kdl_is_newline(c))) { - // skip this char - escaped = tail; - } - // if there is a UTF-8 error, this will be discovered on the - // next iteration of the outer loop - break; - } else { - // Not whitespace - backslash is illegal here - goto unesc_error; - } + // invalid escape + goto unesc_error; } } else { // Nothing special, copy the character @@ -435,6 +424,7 @@ kdl_owned_string kdl_unescape_v2(kdl_str const* s) if (status == KDL_UTF8_EOF) { // ok + kdl_free_string(&no_ws_escapes); kdl_free_string(&dedented); result = _kdl_buf_to_string(&buf); return result; @@ -443,6 +433,7 @@ kdl_owned_string kdl_unescape_v2(kdl_str const* s) } unesc_error: + kdl_free_string(&no_ws_escapes); kdl_free_string(&dedented); _kdl_free_write_buffer(&buf); result = (kdl_owned_string){NULL, 0}; @@ -558,3 +549,62 @@ kdl_owned_string _kdl_dedent_multiline_string(kdl_str const* s) result = (kdl_owned_string){NULL, 0}; return result; } + +kdl_owned_string _kdl_remove_escaped_whitespace(kdl_str const* s) +{ + kdl_owned_string result; + kdl_str escaped = *s; + + size_t orig_len = escaped.len; + _kdl_write_buffer buf = _kdl_new_write_buffer(orig_len); + if (buf.buf == NULL) goto unesc_error; + if (escaped.data == NULL) goto unesc_error; + + uint32_t c = 0; + kdl_utf8_status status; + + while ((status = _kdl_pop_codepoint(&escaped, &c)) == KDL_UTF8_OK) { + if (_kdl_is_illegal_char(KDL_CHARACTER_SET_V2, c)) { + goto unesc_error; + } else if (c == '\\') { + kdl_str tail = escaped; // make a copy - we will advance too far + bool removed_whitespace = false; + + while ((status = _kdl_pop_codepoint(&tail, &c)) == KDL_UTF8_OK + && (_kdl_is_whitespace(KDL_CHARACTER_SET_V2, c) || _kdl_is_newline(c))) { + // skip this char + escaped = tail; + removed_whitespace = true; + } + + switch (status) { // why did the loop end? + case KDL_UTF8_OK: + case KDL_UTF8_EOF: + break; + default: + goto unesc_error; + } + + if (!removed_whitespace) { + // no whitespace -> keep backslash for kdl_unescape_v2() + _kdl_buf_push_char(&buf, '\\'); + } + } else { + // Nothing special, copy the character + _kdl_buf_push_codepoint(&buf, c); + } + } + + if (status == KDL_UTF8_EOF) { + // ok + result = _kdl_buf_to_string(&buf); + return result; + } else { + goto unesc_error; + } + +unesc_error: + _kdl_free_write_buffer(&buf); + result = (kdl_owned_string){NULL, 0}; + return result; +} diff --git a/src/str.h b/src/str.h index eea22c0..02a29f8 100644 --- a/src/str.h +++ b/src/str.h @@ -33,5 +33,6 @@ KDL_NODISCARD kdl_owned_string kdl_escape_v2(kdl_str const* s, kdl_escape_mode m KDL_NODISCARD kdl_owned_string kdl_unescape_v2(kdl_str const* s); KDL_NODISCARD kdl_owned_string _kdl_dedent_multiline_string(kdl_str const* s); +KDL_NODISCARD kdl_owned_string _kdl_remove_escaped_whitespace(kdl_str const* s); #endif // KDL_INTERNAL_STR_H_ diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 0a3ba88..47f36f5 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -136,18 +136,12 @@ set(FUZZY_KDL_TESTS_LIST_V2 no_decimal_exponent.kdl # float representation not consistent with other test cases ) string(REPLACE ";" ":" FUZZY_KDL_TESTS_V2 "${FUZZY_KDL_TESTS_LIST_V2}") -set(SKIP_KDL_TESTS_LIST_V2 - escaped_whitespace.kdl # invalid multi-line string - string_escaped_literal_whitespace.kdl # invalid multi-line string -) -string(REPLACE ";" ":" SKIP_KDL_TESTS_V2 "${SKIP_KDL_TESTS_LIST_V2}") add_executable(example_doc_test_v2 example_doc_test.c) target_link_libraries(example_doc_test_v2 kdl test_util ckdl-cat) target_compile_definitions(example_doc_test_v2 PRIVATE "KDL_TEST_CASES_ROOT=\"${KDL_TEST_CASES_ROOT}\"" "FUZZY_KDL_TESTS=\"${FUZZY_KDL_TESTS_V2}\"" - "SKIP_KDL_TESTS=\"${SKIP_KDL_TESTS_V2}\"" "KDL_VERSION=KDL_VERSION_2") add_test(NAME example_doc_test_v2 COMMAND "$" "${KDL_TEST_CASES_ROOT}") ################################################# From eaae77f5d45c6c1d9ce79976583ba99004335199 Mon Sep 17 00:00:00 2001 From: Thomas Jollans Date: Sat, 12 Oct 2024 17:16:15 +0200 Subject: [PATCH 45/45] Add v2 test to Python API test --- bindings/python/tests/ckdl_test.py | 45 +++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 4 deletions(-) diff --git a/bindings/python/tests/ckdl_test.py b/bindings/python/tests/ckdl_test.py index 8d1750e..06891dc 100644 --- a/bindings/python/tests/ckdl_test.py +++ b/bindings/python/tests/ckdl_test.py @@ -24,9 +24,9 @@ def _dedent_str(self, s): dedented = [l[indent:] if l.startswith(indent_str) else l for l in lines] return "\n".join(dedented) - def test_simple_parsing(self): + def test_simple_parsing_v1(self): kdl = '(tp)node "arg1" 2 3; node2' - doc = ckdl.parse(kdl) + doc = ckdl.parse(kdl, version=1) self.assertEqual(len(doc), 2) self.assertEqual(doc[0].type_annotation, "tp") self.assertEqual(doc[0].name, "node") @@ -39,7 +39,22 @@ def test_simple_parsing(self): self.assertEqual(doc[1].children, []) self.assertEqual(doc[1].properties, {}) - def test_simple_emission(self): + def test_simple_parsing_v2(self): + kdl = '(tp)node arg1 2 3; node2' + doc = ckdl.parse(kdl, version=2) + self.assertEqual(len(doc), 2) + self.assertEqual(doc[0].type_annotation, "tp") + self.assertEqual(doc[0].name, "node") + self.assertEqual(doc[0].args, ["arg1", 2, 3]) + self.assertEqual(doc[0].children, []) + self.assertEqual(doc[0].properties, {}) + self.assertIsNone(doc[1].type_annotation) + self.assertEqual(doc[1].name, "node2") + self.assertEqual(doc[1].args, []) + self.assertEqual(doc[1].children, []) + self.assertEqual(doc[1].properties, {}) + + def test_simple_emission_v1(self): doc = ckdl.Document( ckdl.Node( None, @@ -60,7 +75,29 @@ def test_simple_emission(self): """ ) self.assertEqual(str(doc), expected) - self.assertEqual(doc.dump(), expected) + self.assertEqual(doc.dump(opts=ckdl.EmitterOptions(version=1)), expected) + + def test_simple_emission_v2(self): + doc = ckdl.Document( + ckdl.Node( + None, + "-", + "foo", + 100, + None, + ckdl.Node("child1", a=ckdl.Value("i8", -1)), + ckdl.Node("child2", True), + ) + ) + expected = self._dedent_str( + """ + - foo 100 #null { + child1 a=(i8)-1 + child2 #true + } + """ + ) + self.assertEqual(doc.dump(ckdl.EmitterOptions(version=2)), expected) def test_node_constructors(self): doc = ckdl.Document(