├── testdata ├── json_suite │ ├── n_number_+1.json │ ├── n_number_-01.json │ ├── n_number_-2..json │ ├── n_number_.-1.json │ ├── n_number_0e+.json │ ├── n_number_0e.json │ ├── n_number_Inf.json │ ├── n_number_NaN.json │ ├── n_single_space.json │ ├── y_array_empty.json │ ├── y_array_null.json │ ├── y_number.json │ ├── y_number_0e1.json │ ├── y_object_empty.json │ ├── y_string_pi.json │ ├── y_string_space.json │ ├── n_array_incomplete.json │ ├── n_array_just_comma.json │ ├── n_array_just_minus.json │ ├── n_array_star_inside.json │ ├── n_array_unclosed.json │ ├── n_incomplete_null.json │ ├── n_incomplete_true.json │ ├── n_number_++.json │ ├── n_number_+Inf.json │ ├── n_number_-1.0..json │ ├── n_number_-NaN.json │ ├── n_number_.2e-3.json │ ├── n_number_0.1.2.json │ ├── n_number_0.3e+.json │ ├── n_number_0.3e.json │ ├── n_number_0.e1.json │ ├── n_number_1.0e+.json │ ├── n_number_1.0e-.json │ ├── n_number_1.0e.json │ ├── n_number_1_000.json │ ├── n_number_1eE2.json │ ├── n_number_2.e+3.json │ ├── n_number_2.e-3.json │ ├── n_number_2.e3.json │ ├── n_number_9.e+.json │ ├── n_object_emoji.json │ ├── n_object_no-colon.json │ ├── n_structure_end_array.json │ ├── n_structure_no_data.json │ ├── y_array_false.json │ ├── y_number_0e+1.json │ ├── y_number_minus_zero.json │ ├── y_object_simple.json │ ├── y_string_utf8.json │ ├── n_array_comma_and_number.json │ ├── n_array_double_comma.json │ ├── n_array_extra_close.json │ ├── n_array_extra_comma.json │ ├── n_array_number_and_comma.json │ ├── n_incomplete_false.json │ ├── n_number_0_capital_E+.json │ ├── n_number_0_capital_E.json │ ├── n_number_expression.json │ ├── n_number_hex_1_digit.json │ ├── n_number_hex_2_digits.json │ ├── n_number_infinity.json │ ├── n_number_invalid+-.json │ ├── n_number_minus_space_1.json │ ├── n_number_with_alpha.json │ ├── n_object_missing_key.json │ ├── n_object_missing_value.json │ ├── n_object_non_string_key.json │ ├── n_object_single_quote.json │ ├── n_string_backslash_00.json │ ├── n_string_escape_x.json │ ├── n_string_single_doublequote.json │ ├── n_string_unescaped_tab.json │ ├── n_structure_UTF8_BOM_no_data.json │ ├── n_structure_double_array.json │ ├── n_structure_open_object.json │ ├── n_structure_single_star.json │ ├── n_structure_unclosed_array.json │ ├── y_array_empty-string.json │ ├── y_number_after_space.json │ ├── y_number_int_with_exp.json │ ├── y_number_negative_int.json │ ├── y_number_negative_one.json │ ├── y_number_negative_zero.json │ ├── y_number_real_neg_exp.json │ ├── y_number_simple_int.json │ ├── y_object_basic.json │ ├── y_object_empty_key.json │ ├── y_string_in_array.json │ ├── y_string_u+2029_par_sep.json │ ├── y_string_unicode.json │ ├── y_string_unicode_2.json │ ├── y_structure_lonely_int.json │ ├── y_structure_lonely_null.json │ ├── y_structure_lonely_true.json │ ├── y_structure_string_empty.json │ ├── n_array_comma_after_close.json │ ├── n_array_double_extra_comma.json │ ├── n_array_missing_value.json │ ├── n_multidigit_number_then_00.json │ ├── n_number_starting_with_dot.json │ ├── n_number_with_leading_zero.json │ ├── n_object_bad_value.json │ ├── n_object_bracket_key.json │ ├── n_object_double_colon.json │ ├── n_object_missing_colon.json │ ├── n_object_trailing_comma.json │ ├── n_object_unquoted_key.json │ ├── n_string_escaped_emoji.json │ ├── n_string_incomplete_escape.json │ ├── n_string_start_escape_unclosed.json │ ├── n_string_unicode_CapitalU.json │ ├── n_string_with_trailing_garbage.json │ ├── n_structure_U+2060_word_joined.json │ ├── n_structure_angle_bracket_..json │ ├── n_structure_lone-open-bracket.json │ ├── n_structure_open_array_comma.json │ ├── n_structure_open_array_string.json │ ├── n_structure_open_object_comma.json │ ├── n_structure_unicode-identifier.json │ ├── y_array_arraysWithSpaces.json │ ├── y_array_ending_with_newline.json │ ├── y_array_with_leading_space.json │ ├── y_array_with_trailing_space.json │ ├── y_number_real_capital_e.json │ ├── y_number_real_exponent.json │ ├── y_number_real_pos_exponent.json │ ├── y_number_simple_real.json │ ├── y_string_double_escape_a.json │ ├── y_string_double_escape_n.json │ ├── y_string_null_escape.json │ ├── y_string_one-byte-utf-8.json │ ├── y_string_simple_ascii.json │ ├── y_string_two-byte-utf-8.json │ ├── y_string_u+2028_line_sep.json │ ├── y_structure_lonely_false.json │ ├── y_structure_lonely_string.json │ ├── y_structure_true_in_array.json │ ├── y_structure_whitespace_array.json │ ├── i_number_neg_int_huge_exp.json │ ├── i_number_real_underflow.json │ ├── i_structure_UTF-8_BOM_empty_object.json │ ├── n_array_1_true_without_comma.json │ ├── n_array_colon_instead_of_comma.json │ ├── n_array_incomplete_invalid_value.json │ ├── n_array_inner_array_no_comma.json │ ├── n_array_number_and_several_commas.json │ ├── n_array_unclosed_trailing_comma.json │ ├── n_array_unclosed_with_object_inside.json │ ├── n_number_U+FF11_fullwidth_digit_one.json │ ├── n_number_minus_infinity.json │ ├── n_number_neg_with_garbage_at_end.json │ ├── n_number_real_garbage_after_e.json │ ├── n_object_garbage_at_end.json │ ├── n_object_missing_semicolon.json │ ├── n_object_trailing_comment.json │ ├── n_object_unterminated-value.json │ ├── n_string_accentuated_char_no_quotes.json │ ├── n_string_escaped_backslash_bad.json │ ├── n_string_escaped_ctrl_char_tab.json │ ├── n_string_invalid_backslash_esc.json │ ├── n_string_no_quotes_with_bad_escape.json │ ├── n_string_single_quote.json │ ├── n_string_unescaped_ctrl_char.json │ ├── n_structure_angle_bracket_null.json │ ├── n_structure_array_trailing_garbage.json │ ├── n_structure_ascii-unicode-identifier.json │ ├── n_structure_capitalized_True.json │ ├── n_structure_close_unopened_array.json │ ├── n_structure_open_array_apostrophe.json │ ├── n_structure_open_array_open_object.json │ ├── n_structure_open_array_open_string.json │ ├── n_structure_open_object_close_array.json │ ├── n_structure_open_object_open_array.json │ ├── n_structure_open_object_open_string.json │ ├── n_structure_open_open.json │ ├── n_structure_trailing_#.json │ ├── n_structure_whitespace_formfeed.json │ ├── y_array_with_1_and_newline.json │ ├── y_number_real_capital_e_neg_exp.json │ ├── y_number_real_capital_e_pos_exp.json │ ├── y_object.json │ ├── y_string_backslash_doublequotes.json │ ├── y_string_comments.json │ ├── y_string_three-byte-utf-8.json │ ├── y_string_unescaped_char_delete.json │ ├── y_string_with_del_character.json │ ├── y_structure_lonely_negative_real.json │ ├── y_structure_trailing_newline.json │ ├── i_number_double_huge_neg_exp.json │ ├── i_number_pos_double_huge_exp.json │ ├── i_number_real_neg_overflow.json │ ├── i_number_real_pos_overflow.json │ ├── i_object_key_lone_2nd_surrogate.json │ ├── i_string_invalid_lonely_surrogate.json │ ├── i_string_invalid_surrogate.json │ ├── i_string_lone_second_surrogate.json │ ├── n_array_items_separated_by_semicolon.json │ ├── n_number_invalid-negative-real.json │ ├── n_number_neg_int_starting_with_zero.json │ ├── n_number_neg_real_without_int_part.json │ ├── n_number_real_without_fractional_part.json │ ├── n_object_comma_instead_of_colon.json │ ├── n_object_with_trailing_garbage.json │ ├── n_string_1_surrogate_then_escape.json │ ├── n_string_incomplete_surrogate.json │ ├── n_string_invalid_unicode_escape.json │ ├── n_string_single_string_no_double_quotes.json │ ├── n_string_unescaped_newline.json │ ├── n_structure_null-byte-outside-string.json │ ├── n_structure_number_with_trailing_garbage.json │ ├── n_structure_object_unclosed_no_value.json │ ├── n_structure_unclosed_object.json │ ├── y_array_heterogeneous.json │ ├── y_number_real_fraction_exponent.json │ ├── y_object_duplicated_key.json │ ├── y_object_with_newlines.json │ ├── y_string_escaped_noncharacter.json │ ├── y_string_nbsp_uescaped.json │ ├── y_string_nonCharacterInUTF-8_U+10FFFF.json │ ├── y_string_nonCharacterInUTF-8_U+FFFF.json │ ├── y_string_uescaped_newline.json │ ├── y_string_unicodeEscapedBackslash.json │ ├── y_string_unicode_U+FDD0_nonchar.json │ ├── y_string_unicode_U+FFFE_nonchar.json │ ├── i_number_too_big_pos_int.json │ ├── i_string_1st_surrogate_but_2nd_missing.json │ ├── i_string_incomplete_surrogate_pair.json │ ├── n_array_newlines_unclosed.json │ ├── n_array_spaces_vertical_tab_formfeed.json │ ├── n_array_unclosed_with_new_lines.json │ ├── n_number_minus_sign_with_trailing_garbage.json │ ├── n_object_key_with_single_quotes.json │ ├── n_object_repeated_null_null.json │ ├── n_object_several_trailing_commas.json │ ├── n_object_trailing_comment_open.json │ ├── n_object_trailing_comment_slash_open.json │ ├── n_object_two_commas_in_a_row.json │ ├── n_string_1_surrogate_then_escape_u.json │ ├── n_string_1_surrogate_then_escape_u1.json │ ├── n_string_incomplete_escaped_character.json │ ├── n_string_leading_uescaped_thinspace.json │ ├── n_structure_array_with_extra_array_close.json │ ├── n_structure_array_with_unclosed_string.json │ ├── n_structure_object_followed_by_closing_object.json │ ├── n_structure_uescaped_LF_before_string.json │ ├── n_structure_whitespace_U+2060_word_joiner.json │ ├── y_array_with_several_null.json │ ├── y_object_escaped_null_in_key.json │ ├── y_string_accepted_surrogate_pair.json │ ├── y_string_allowed_escapes.json │ ├── y_string_backslash_and_u_escaped_zero.json │ ├── y_string_escaped_control_character.json │ ├── y_string_in_array_with_leading_space.json │ ├── y_string_last_surrogates_1_and_2.json │ ├── y_string_reservedCharacterInUTF-8_U+1BFFF.json │ ├── y_string_uEscape.json │ ├── y_string_unicode_U+1FFFE_nonchar.json │ ├── y_string_unicode_U+2064_invisible_plus.json │ ├── y_string_unicode_escaped_double_quote.json │ ├── i_string_inverted_surrogates_U+1D11E.json │ ├── n_number_with_alpha_char.json │ ├── n_object_with_single_string.json │ ├── n_string_1_surrogate_then_escape_u1x.json │ ├── n_structure_comma_instead_of_closing_brace.json │ ├── n_structure_object_with_comment.json │ ├── n_structure_open_object_string_with_apostrophes.json │ ├── n_structure_unclosed_array_partial_null.json │ ├── y_object_duplicated_key_and_value.json │ ├── y_string_unicode_U+10FFFE_nonchar.json │ ├── y_string_unicode_U+200B_ZERO_WIDTH_SPACE.json │ ├── i_number_too_big_neg_int.json │ ├── i_string_1st_valid_surrogate_2nd_invalid.json │ ├── i_string_incomplete_surrogate_and_escape_valid.json │ ├── n_object_trailing_comment_slash_open_incomplete.json │ ├── n_structure_object_with_trailing_garbage.json │ ├── n_structure_unclosed_array_unfinished_false.json │ ├── n_structure_unclosed_array_unfinished_true.json │ ├── y_string_1_2_3_bytes_UTF-8_sequences.json │ ├── i_string_incomplete_surrogates_escape_valid.json │ ├── n_object_non_string_key_but_huge_number_instead.json │ ├── n_string_incomplete_surrogate_escape_invalid.json │ ├── y_object_extreme_numbers.json │ ├── y_string_accepted_surrogate_pairs.json │ ├── y_string_surrogates_U+1D11E_MUSICAL_SYMBOL_G_CLEF.json │ ├── i_number_very_big_negative_int.json │ ├── i_string_iso_latin_1.json │ ├── n_array_invalid_utf8.json │ ├── y_number_double_close_to_zero.json │ ├── i_string_invalid_utf-8.json │ ├── i_string_truncated-utf-8.json │ ├── i_string_utf16BE_no_BOM.json │ ├── i_string_utf16LE_no_BOM.json │ ├── n_array_a_invalid_utf8.json │ ├── i_string_UTF-16LE_with_BOM.json │ ├── n_structure_single_eacute.json │ ├── i_string_not_in_unicode_range.json │ ├── n_number_invalid-utf-8-in-int.json │ ├── y_object_long_strings.json │ ├── y_object_string_unicode.json │ ├── i_string_UTF-8_invalid_sequence.json │ ├── i_string_UTF8_surrogate_U+D800.json │ ├── n_structure_incomplete_UTF8_BOM.json │ ├── n_structure_lone-invalid-utf-8.json │ ├── i_string_overlong_sequence_2_bytes.json │ ├── i_string_overlong_sequence_6_bytes.json │ ├── n_number_invalid-utf-8-in-exponent.json │ ├── n_string_invalid-utf-8-in-escape.json │ ├── n_string_invalid_utf8_after_escape.json │ ├── i_string_lone_utf8_continuation_byte.json │ ├── n_number_invalid-utf-8-in-bigger-int.json │ ├── i_string_overlong_sequence_6_bytes_null.json │ ├── n_number_real_with_invalid_utf8_after_e.json │ ├── i_number_huge_exp.json │ └── n_object_lone_continuation_byte_in_key_and_trailing_comma.json ├── fuzz │ └── FuzzDecodeEncodeDecode │ │ ├── f79f09ab701cbe11 │ │ ├── f21f52dada1442fc │ │ ├── f62dc59e4c32e1d6 │ │ ├── f91ab6905aa88579 │ │ ├── 3fd9827db9432432 │ │ ├── 64588d00b12b492f │ │ ├── 999e9f6055aa8567 │ │ ├── 20a8e7b63360c437 │ │ ├── c18522695dec4f600bb0200536e2084f9f7e5ca10ec94d99bbf541b15f0de9e0 │ │ └── 90513016cb18725627689d6b25adb2c440d71f64d72e23ef201ed3ac51443001 └── yaml_suite │ ├── HWV9.yaml │ ├── 9MMA.yaml │ ├── H7TQ.yaml │ ├── B63P.yaml │ ├── LHL4.yaml │ ├── U99R.yaml │ ├── YJV2.yaml │ ├── SF5V.yaml │ ├── 55WF.yaml │ ├── AVM7.yaml │ ├── SY6V.yaml │ ├── QT73.yaml │ ├── 2CMS.yaml │ ├── CXX2.yaml │ ├── 8MK2.yaml │ ├── C2SP.yaml │ ├── EW3V.yaml │ ├── G5U8.yaml │ ├── JKF3.yaml │ ├── 5TRB.yaml │ ├── RXY3.yaml │ ├── 98YD.yaml │ ├── 9MAG.yaml │ ├── ZL4Z.yaml │ ├── 5U3A.yaml │ ├── GT5M.yaml │ ├── G7JE.yaml │ ├── N782.yaml │ ├── 236B.yaml │ ├── CQ3W.yaml │ ├── DK4H.yaml │ ├── 7LBH.yaml │ ├── QB6E.yaml │ ├── T833.yaml │ ├── ZXT5.yaml │ ├── D49Q.yaml │ ├── S4GJ.yaml │ ├── SR86.yaml │ ├── 4UYU.yaml │ ├── GDY7.yaml │ ├── TD5N.yaml │ ├── BD7L.yaml │ ├── G9HC.yaml │ ├── Q5MG.yaml │ ├── X4QW.yaml │ ├── 6CA3.yaml │ ├── 8G76.yaml │ ├── 9KBC.yaml │ ├── CTN5.yaml │ ├── 52DL.yaml │ ├── K54U.yaml │ ├── SU5Z.yaml │ ├── CVW2.yaml │ ├── HRE5.yaml │ ├── RHX7.yaml │ ├── SU74.yaml │ ├── ZCZ6.yaml │ ├── ZVH3.yaml │ ├── 9C9N.yaml │ ├── NHX8.yaml │ ├── 7MNF.yaml │ ├── BS4K.yaml │ ├── EB22.yaml │ ├── 4EJS.yaml │ ├── 5LLU.yaml │ ├── 9HCY.yaml │ ├── 3HFZ.yaml │ ├── DMG6.yaml │ ├── KS4U.yaml │ ├── 2JQS.yaml │ ├── 4H7K.yaml │ ├── 82AN.yaml │ ├── 9JBA.yaml │ ├── BF9H.yaml │ ├── 6JTT.yaml │ ├── HU3P.yaml │ ├── P2EQ.yaml │ ├── S7BG.yaml │ ├── 4GC6.yaml │ ├── 6S55.yaml │ ├── 6XDY.yaml │ ├── H7J7.yaml │ ├── 27NA.yaml │ ├── 58MP.yaml │ ├── 62EZ.yaml │ ├── 65WH.yaml │ ├── MYW6.yaml │ ├── S98Z.yaml │ ├── 8XDJ.yaml │ ├── 4HVU.yaml │ ├── U44R.yaml │ ├── W9L4.yaml │ ├── 9CWY.yaml │ ├── 3R3P.yaml │ ├── 9YRD.yaml │ ├── CML9.yaml │ ├── N4JP.yaml │ ├── 753E.yaml │ ├── FP8R.yaml │ ├── Q4CL.yaml │ ├── XLQ9.yaml │ ├── 4V8U.yaml │ ├── D9TU.yaml │ ├── JY7Z.yaml │ ├── 6H3V.yaml │ ├── LX3P.yaml │ ├── S4T7.yaml │ ├── ZH7C.yaml │ ├── 3UYS.yaml │ ├── SSW6.yaml │ ├── 6M2F.yaml │ ├── BEC7.yaml │ ├── L383.yaml │ ├── 4JVG.yaml │ ├── EXG3.yaml │ ├── G992.yaml │ ├── RTP8.yaml │ ├── U3C3.yaml │ ├── FTA2.yaml │ ├── Y2GN.yaml │ ├── 3MYT.yaml │ ├── 5MUD.yaml │ ├── CPZ3.yaml │ ├── MXS3.yaml │ ├── TS54.yaml │ ├── 6LVF.yaml │ ├── 8XYN.yaml │ ├── FRK4.yaml │ ├── 6FWR.yaml │ ├── 5NYZ.yaml │ ├── TL85.yaml │ ├── 4RWC.yaml │ ├── 96NN.yaml │ ├── DK3J.yaml │ ├── M9B4.yaml │ ├── H3Z8.yaml │ ├── MJS9.yaml │ ├── V55R.yaml │ ├── B3HG.yaml │ ├── CC74.yaml │ ├── K4SU.yaml │ ├── UV7Q.yaml │ ├── X8DW.yaml │ ├── 36F6.yaml │ ├── E76Z.yaml │ ├── EX5H.yaml │ ├── K3WX.yaml │ ├── W5VH.yaml │ ├── 2LFX.yaml │ ├── 4Q9F.yaml │ ├── A984.yaml │ ├── PUW8.yaml │ ├── RR7F.yaml │ ├── 7TMG.yaml │ ├── J7VC.yaml │ ├── QLJ7.yaml │ ├── 3ALJ.yaml │ ├── 6WPF.yaml │ ├── AB8U.yaml │ ├── DHP8.yaml │ ├── P94K.yaml │ ├── 93WF.yaml │ ├── 9SHH.yaml │ ├── D88J.yaml │ ├── P76L.yaml │ ├── T5N4.yaml │ ├── 9J7A.yaml │ ├── GH63.yaml │ ├── K527.yaml │ ├── NB6Z.yaml │ ├── 6JQW.yaml │ ├── 7FWL.yaml │ ├── 8CWC.yaml │ ├── FUP4.yaml │ ├── 54T7.yaml │ ├── QF4Y.yaml │ ├── UDM2.yaml │ ├── HS5T.yaml │ ├── M29M.yaml │ ├── 2SXE.yaml │ ├── 6KGN.yaml │ ├── 7A4E.yaml │ ├── 7W2P.yaml │ ├── 9MQT.yaml │ ├── SM9W.yaml │ ├── 7Z25.yaml │ ├── Z9M4.yaml │ ├── KSS4.yaml │ ├── 8QBE.yaml │ ├── 652Z.yaml │ ├── S4JQ.yaml │ ├── CT4Q.yaml │ ├── JTV5.yaml │ ├── KMK3.yaml │ ├── AZ63.yaml │ ├── SBG9.yaml │ ├── J5UC.yaml │ ├── JS2J.yaml │ ├── 5TYM.yaml │ ├── 6PBE.yaml │ ├── AZW3.yaml │ ├── TE2A.yaml │ ├── 2AUY.yaml │ ├── 6BFJ.yaml │ ├── DFF7.yaml │ ├── L94M.yaml │ ├── HM87.yaml │ ├── SKE5.yaml │ ├── 2G84.yaml │ ├── 33X3.yaml │ ├── 96L6.yaml │ ├── NP9H.yaml │ ├── WZ62.yaml │ ├── 6CK3.yaml │ ├── DWX9.yaml │ ├── T26H.yaml │ ├── 4ABK.yaml │ ├── 9TFX.yaml │ ├── ZWK4.yaml │ ├── LE5A.yaml │ ├── X38W.yaml │ ├── W4TN.yaml │ ├── CUP7.yaml │ ├── HMQ5.yaml │ ├── CFD4.yaml │ ├── F2C7.yaml │ ├── BU8L.yaml │ ├── D83L.yaml │ ├── DC7X.yaml │ ├── MZX3.yaml │ ├── PRH3.yaml │ ├── T4YY.yaml │ ├── EHF6.yaml │ ├── V9D5.yaml │ ├── 6SLA.yaml │ ├── Z67P.yaml │ ├── S3PD.yaml │ ├── UT92.yaml │ ├── 9WXW.yaml │ ├── M6YH.yaml │ ├── ZK9H.yaml │ ├── ZYU8.yaml │ ├── K858.yaml │ ├── M7A3.yaml │ ├── RLU9.yaml │ ├── UKK6.yaml │ ├── SYW4.yaml │ ├── Q8AD.yaml │ ├── M5C3.yaml │ └── 5BVJ.yaml ├── AUTHORS ├── .github ├── release.yml ├── dependency-review-config.yml ├── dependabot.yml └── workflows │ ├── x.yml │ └── pr.yml ├── .gitattributes ├── .codecov.yml ├── go.coverage.sh ├── .gitignore ├── Makefile ├── go.test.sh ├── yamlx_test.go ├── .editorconfig └── go.mod /testdata/json_suite/n_number_+1.json: -------------------------------------------------------------------------------- 1 | [+1] -------------------------------------------------------------------------------- /testdata/json_suite/n_number_-01.json: -------------------------------------------------------------------------------- 1 | [-01] -------------------------------------------------------------------------------- /testdata/json_suite/n_number_-2..json: -------------------------------------------------------------------------------- 1 | [-2.] -------------------------------------------------------------------------------- /testdata/json_suite/n_number_.-1.json: -------------------------------------------------------------------------------- 1 | [.-1] -------------------------------------------------------------------------------- /testdata/json_suite/n_number_0e+.json: -------------------------------------------------------------------------------- 1 | [0e+] -------------------------------------------------------------------------------- /testdata/json_suite/n_number_0e.json: -------------------------------------------------------------------------------- 1 | [0e] -------------------------------------------------------------------------------- /testdata/json_suite/n_number_Inf.json: -------------------------------------------------------------------------------- 1 | [Inf] -------------------------------------------------------------------------------- /testdata/json_suite/n_number_NaN.json: -------------------------------------------------------------------------------- 1 | [NaN] -------------------------------------------------------------------------------- /testdata/json_suite/n_single_space.json: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /testdata/json_suite/y_array_empty.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /testdata/json_suite/y_array_null.json: -------------------------------------------------------------------------------- 1 | [null] -------------------------------------------------------------------------------- /testdata/json_suite/y_number.json: -------------------------------------------------------------------------------- 1 | [123e65] -------------------------------------------------------------------------------- /testdata/json_suite/y_number_0e1.json: -------------------------------------------------------------------------------- 1 | [0e1] -------------------------------------------------------------------------------- /testdata/json_suite/y_object_empty.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /testdata/json_suite/y_string_pi.json: -------------------------------------------------------------------------------- 1 | ["π"] -------------------------------------------------------------------------------- /testdata/json_suite/y_string_space.json: -------------------------------------------------------------------------------- 1 | " " -------------------------------------------------------------------------------- /testdata/json_suite/n_array_incomplete.json: -------------------------------------------------------------------------------- 1 | ["x" -------------------------------------------------------------------------------- /testdata/json_suite/n_array_just_comma.json: -------------------------------------------------------------------------------- 1 | [,] -------------------------------------------------------------------------------- /testdata/json_suite/n_array_just_minus.json: -------------------------------------------------------------------------------- 1 | [-] -------------------------------------------------------------------------------- /testdata/json_suite/n_array_star_inside.json: -------------------------------------------------------------------------------- 1 | [*] -------------------------------------------------------------------------------- /testdata/json_suite/n_array_unclosed.json: -------------------------------------------------------------------------------- 1 | ["" -------------------------------------------------------------------------------- /testdata/json_suite/n_incomplete_null.json: -------------------------------------------------------------------------------- 1 | [nul] -------------------------------------------------------------------------------- /testdata/json_suite/n_incomplete_true.json: -------------------------------------------------------------------------------- 1 | [tru] -------------------------------------------------------------------------------- /testdata/json_suite/n_number_++.json: -------------------------------------------------------------------------------- 1 | [++1234] -------------------------------------------------------------------------------- /testdata/json_suite/n_number_+Inf.json: -------------------------------------------------------------------------------- 1 | [+Inf] -------------------------------------------------------------------------------- /testdata/json_suite/n_number_-1.0..json: -------------------------------------------------------------------------------- 1 | [-1.0.] -------------------------------------------------------------------------------- /testdata/json_suite/n_number_-NaN.json: -------------------------------------------------------------------------------- 1 | [-NaN] -------------------------------------------------------------------------------- /testdata/json_suite/n_number_.2e-3.json: -------------------------------------------------------------------------------- 1 | [.2e-3] -------------------------------------------------------------------------------- /testdata/json_suite/n_number_0.1.2.json: -------------------------------------------------------------------------------- 1 | [0.1.2] -------------------------------------------------------------------------------- /testdata/json_suite/n_number_0.3e+.json: -------------------------------------------------------------------------------- 1 | [0.3e+] -------------------------------------------------------------------------------- /testdata/json_suite/n_number_0.3e.json: -------------------------------------------------------------------------------- 1 | [0.3e] -------------------------------------------------------------------------------- /testdata/json_suite/n_number_0.e1.json: -------------------------------------------------------------------------------- 1 | [0.e1] -------------------------------------------------------------------------------- /testdata/json_suite/n_number_1.0e+.json: -------------------------------------------------------------------------------- 1 | [1.0e+] -------------------------------------------------------------------------------- /testdata/json_suite/n_number_1.0e-.json: -------------------------------------------------------------------------------- 1 | [1.0e-] -------------------------------------------------------------------------------- /testdata/json_suite/n_number_1.0e.json: -------------------------------------------------------------------------------- 1 | [1.0e] -------------------------------------------------------------------------------- /testdata/json_suite/n_number_1_000.json: -------------------------------------------------------------------------------- 1 | [1 000.0] -------------------------------------------------------------------------------- /testdata/json_suite/n_number_1eE2.json: -------------------------------------------------------------------------------- 1 | [1eE2] -------------------------------------------------------------------------------- /testdata/json_suite/n_number_2.e+3.json: -------------------------------------------------------------------------------- 1 | [2.e+3] -------------------------------------------------------------------------------- /testdata/json_suite/n_number_2.e-3.json: -------------------------------------------------------------------------------- 1 | [2.e-3] -------------------------------------------------------------------------------- /testdata/json_suite/n_number_2.e3.json: -------------------------------------------------------------------------------- 1 | [2.e3] -------------------------------------------------------------------------------- /testdata/json_suite/n_number_9.e+.json: -------------------------------------------------------------------------------- 1 | [9.e+] -------------------------------------------------------------------------------- /testdata/json_suite/n_object_emoji.json: -------------------------------------------------------------------------------- 1 | {🇨🇭} -------------------------------------------------------------------------------- /testdata/json_suite/n_object_no-colon.json: -------------------------------------------------------------------------------- 1 | {"a" -------------------------------------------------------------------------------- /testdata/json_suite/n_structure_end_array.json: -------------------------------------------------------------------------------- 1 | ] -------------------------------------------------------------------------------- /testdata/json_suite/n_structure_no_data.json: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /testdata/json_suite/y_array_false.json: -------------------------------------------------------------------------------- 1 | [false] -------------------------------------------------------------------------------- /testdata/json_suite/y_number_0e+1.json: -------------------------------------------------------------------------------- 1 | [0e+1] -------------------------------------------------------------------------------- /testdata/json_suite/y_number_minus_zero.json: -------------------------------------------------------------------------------- 1 | [-0] -------------------------------------------------------------------------------- /testdata/json_suite/y_object_simple.json: -------------------------------------------------------------------------------- 1 | {"a":[]} -------------------------------------------------------------------------------- /testdata/json_suite/y_string_utf8.json: -------------------------------------------------------------------------------- 1 | ["€𝄞"] -------------------------------------------------------------------------------- /testdata/json_suite/n_array_comma_and_number.json: -------------------------------------------------------------------------------- 1 | [,1] -------------------------------------------------------------------------------- /testdata/json_suite/n_array_double_comma.json: -------------------------------------------------------------------------------- 1 | [1,,2] -------------------------------------------------------------------------------- /testdata/json_suite/n_array_extra_close.json: -------------------------------------------------------------------------------- 1 | ["x"]] -------------------------------------------------------------------------------- /testdata/json_suite/n_array_extra_comma.json: -------------------------------------------------------------------------------- 1 | ["",] -------------------------------------------------------------------------------- /testdata/json_suite/n_array_number_and_comma.json: -------------------------------------------------------------------------------- 1 | [1,] -------------------------------------------------------------------------------- /testdata/json_suite/n_incomplete_false.json: -------------------------------------------------------------------------------- 1 | [fals] -------------------------------------------------------------------------------- /testdata/json_suite/n_number_0_capital_E+.json: -------------------------------------------------------------------------------- 1 | [0E+] -------------------------------------------------------------------------------- /testdata/json_suite/n_number_0_capital_E.json: -------------------------------------------------------------------------------- 1 | [0E] -------------------------------------------------------------------------------- /testdata/json_suite/n_number_expression.json: -------------------------------------------------------------------------------- 1 | [1+2] -------------------------------------------------------------------------------- /testdata/json_suite/n_number_hex_1_digit.json: -------------------------------------------------------------------------------- 1 | [0x1] -------------------------------------------------------------------------------- /testdata/json_suite/n_number_hex_2_digits.json: -------------------------------------------------------------------------------- 1 | [0x42] -------------------------------------------------------------------------------- /testdata/json_suite/n_number_infinity.json: -------------------------------------------------------------------------------- 1 | [Infinity] -------------------------------------------------------------------------------- /testdata/json_suite/n_number_invalid+-.json: -------------------------------------------------------------------------------- 1 | [0e+-1] -------------------------------------------------------------------------------- /testdata/json_suite/n_number_minus_space_1.json: -------------------------------------------------------------------------------- 1 | [- 1] -------------------------------------------------------------------------------- /testdata/json_suite/n_number_with_alpha.json: -------------------------------------------------------------------------------- 1 | [1.2a-3] -------------------------------------------------------------------------------- /testdata/json_suite/n_object_missing_key.json: -------------------------------------------------------------------------------- 1 | {:"b"} -------------------------------------------------------------------------------- /testdata/json_suite/n_object_missing_value.json: -------------------------------------------------------------------------------- 1 | {"a": -------------------------------------------------------------------------------- /testdata/json_suite/n_object_non_string_key.json: -------------------------------------------------------------------------------- 1 | {1:1} -------------------------------------------------------------------------------- /testdata/json_suite/n_object_single_quote.json: -------------------------------------------------------------------------------- 1 | {'a':0} -------------------------------------------------------------------------------- /testdata/json_suite/n_string_backslash_00.json: -------------------------------------------------------------------------------- 1 | ["\"] -------------------------------------------------------------------------------- /testdata/json_suite/n_string_escape_x.json: -------------------------------------------------------------------------------- 1 | ["\x00"] -------------------------------------------------------------------------------- /testdata/json_suite/n_string_single_doublequote.json: -------------------------------------------------------------------------------- 1 | " -------------------------------------------------------------------------------- /testdata/json_suite/n_string_unescaped_tab.json: -------------------------------------------------------------------------------- 1 | [" "] -------------------------------------------------------------------------------- /testdata/json_suite/n_structure_UTF8_BOM_no_data.json: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /testdata/json_suite/n_structure_double_array.json: -------------------------------------------------------------------------------- 1 | [][] -------------------------------------------------------------------------------- /testdata/json_suite/n_structure_open_object.json: -------------------------------------------------------------------------------- 1 | { -------------------------------------------------------------------------------- /testdata/json_suite/n_structure_single_star.json: -------------------------------------------------------------------------------- 1 | * -------------------------------------------------------------------------------- /testdata/json_suite/n_structure_unclosed_array.json: -------------------------------------------------------------------------------- 1 | [1 -------------------------------------------------------------------------------- /testdata/json_suite/y_array_empty-string.json: -------------------------------------------------------------------------------- 1 | [""] -------------------------------------------------------------------------------- /testdata/json_suite/y_number_after_space.json: -------------------------------------------------------------------------------- 1 | [ 4] -------------------------------------------------------------------------------- /testdata/json_suite/y_number_int_with_exp.json: -------------------------------------------------------------------------------- 1 | [20e1] -------------------------------------------------------------------------------- /testdata/json_suite/y_number_negative_int.json: -------------------------------------------------------------------------------- 1 | [-123] -------------------------------------------------------------------------------- /testdata/json_suite/y_number_negative_one.json: -------------------------------------------------------------------------------- 1 | [-1] -------------------------------------------------------------------------------- /testdata/json_suite/y_number_negative_zero.json: -------------------------------------------------------------------------------- 1 | [-0] -------------------------------------------------------------------------------- /testdata/json_suite/y_number_real_neg_exp.json: -------------------------------------------------------------------------------- 1 | [1e-2] -------------------------------------------------------------------------------- /testdata/json_suite/y_number_simple_int.json: -------------------------------------------------------------------------------- 1 | [123] -------------------------------------------------------------------------------- /testdata/json_suite/y_object_basic.json: -------------------------------------------------------------------------------- 1 | {"asd":"sdf"} -------------------------------------------------------------------------------- /testdata/json_suite/y_object_empty_key.json: -------------------------------------------------------------------------------- 1 | {"":0} -------------------------------------------------------------------------------- /testdata/json_suite/y_string_in_array.json: -------------------------------------------------------------------------------- 1 | ["asd"] -------------------------------------------------------------------------------- /testdata/json_suite/y_string_u+2029_par_sep.json: -------------------------------------------------------------------------------- 1 | ["
"] -------------------------------------------------------------------------------- /testdata/json_suite/y_string_unicode.json: -------------------------------------------------------------------------------- 1 | ["\uA66D"] -------------------------------------------------------------------------------- /testdata/json_suite/y_string_unicode_2.json: -------------------------------------------------------------------------------- 1 | ["⍂㈴⍂"] -------------------------------------------------------------------------------- /testdata/json_suite/y_structure_lonely_int.json: -------------------------------------------------------------------------------- 1 | 42 -------------------------------------------------------------------------------- /testdata/json_suite/y_structure_lonely_null.json: -------------------------------------------------------------------------------- 1 | null -------------------------------------------------------------------------------- /testdata/json_suite/y_structure_lonely_true.json: -------------------------------------------------------------------------------- 1 | true -------------------------------------------------------------------------------- /testdata/json_suite/y_structure_string_empty.json: -------------------------------------------------------------------------------- 1 | "" -------------------------------------------------------------------------------- /testdata/json_suite/n_array_comma_after_close.json: -------------------------------------------------------------------------------- 1 | [""], -------------------------------------------------------------------------------- /testdata/json_suite/n_array_double_extra_comma.json: -------------------------------------------------------------------------------- 1 | ["x",,] -------------------------------------------------------------------------------- /testdata/json_suite/n_array_missing_value.json: -------------------------------------------------------------------------------- 1 | [ , ""] -------------------------------------------------------------------------------- /testdata/json_suite/n_multidigit_number_then_00.json: -------------------------------------------------------------------------------- 1 | 123 -------------------------------------------------------------------------------- /testdata/json_suite/n_number_starting_with_dot.json: -------------------------------------------------------------------------------- 1 | [.123] -------------------------------------------------------------------------------- /testdata/json_suite/n_number_with_leading_zero.json: -------------------------------------------------------------------------------- 1 | [012] -------------------------------------------------------------------------------- /testdata/json_suite/n_object_bad_value.json: -------------------------------------------------------------------------------- 1 | ["x", truth] -------------------------------------------------------------------------------- /testdata/json_suite/n_object_bracket_key.json: -------------------------------------------------------------------------------- 1 | {[: "x"} 2 | -------------------------------------------------------------------------------- /testdata/json_suite/n_object_double_colon.json: -------------------------------------------------------------------------------- 1 | {"x"::"b"} -------------------------------------------------------------------------------- /testdata/json_suite/n_object_missing_colon.json: -------------------------------------------------------------------------------- 1 | {"a" b} -------------------------------------------------------------------------------- /testdata/json_suite/n_object_trailing_comma.json: -------------------------------------------------------------------------------- 1 | {"id":0,} -------------------------------------------------------------------------------- /testdata/json_suite/n_object_unquoted_key.json: -------------------------------------------------------------------------------- 1 | {a: "b"} -------------------------------------------------------------------------------- /testdata/json_suite/n_string_escaped_emoji.json: -------------------------------------------------------------------------------- 1 | ["\🌀"] -------------------------------------------------------------------------------- /testdata/json_suite/n_string_incomplete_escape.json: -------------------------------------------------------------------------------- 1 | ["\"] -------------------------------------------------------------------------------- /testdata/json_suite/n_string_start_escape_unclosed.json: -------------------------------------------------------------------------------- 1 | ["\ -------------------------------------------------------------------------------- /testdata/json_suite/n_string_unicode_CapitalU.json: -------------------------------------------------------------------------------- 1 | "\UA66D" -------------------------------------------------------------------------------- /testdata/json_suite/n_string_with_trailing_garbage.json: -------------------------------------------------------------------------------- 1 | ""x -------------------------------------------------------------------------------- /testdata/json_suite/n_structure_U+2060_word_joined.json: -------------------------------------------------------------------------------- 1 | [⁠] -------------------------------------------------------------------------------- /testdata/json_suite/n_structure_angle_bracket_..json: -------------------------------------------------------------------------------- 1 | <.> -------------------------------------------------------------------------------- /testdata/json_suite/n_structure_lone-open-bracket.json: -------------------------------------------------------------------------------- 1 | [ -------------------------------------------------------------------------------- /testdata/json_suite/n_structure_open_array_comma.json: -------------------------------------------------------------------------------- 1 | [, -------------------------------------------------------------------------------- /testdata/json_suite/n_structure_open_array_string.json: -------------------------------------------------------------------------------- 1 | ["a" -------------------------------------------------------------------------------- /testdata/json_suite/n_structure_open_object_comma.json: -------------------------------------------------------------------------------- 1 | {, -------------------------------------------------------------------------------- /testdata/json_suite/n_structure_unicode-identifier.json: -------------------------------------------------------------------------------- 1 | å -------------------------------------------------------------------------------- /testdata/json_suite/y_array_arraysWithSpaces.json: -------------------------------------------------------------------------------- 1 | [[] ] -------------------------------------------------------------------------------- /testdata/json_suite/y_array_ending_with_newline.json: -------------------------------------------------------------------------------- 1 | ["a"] -------------------------------------------------------------------------------- /testdata/json_suite/y_array_with_leading_space.json: -------------------------------------------------------------------------------- 1 | [1] -------------------------------------------------------------------------------- /testdata/json_suite/y_array_with_trailing_space.json: -------------------------------------------------------------------------------- 1 | [2] -------------------------------------------------------------------------------- /testdata/json_suite/y_number_real_capital_e.json: -------------------------------------------------------------------------------- 1 | [1E22] -------------------------------------------------------------------------------- /testdata/json_suite/y_number_real_exponent.json: -------------------------------------------------------------------------------- 1 | [123e45] -------------------------------------------------------------------------------- /testdata/json_suite/y_number_real_pos_exponent.json: -------------------------------------------------------------------------------- 1 | [1e+2] -------------------------------------------------------------------------------- /testdata/json_suite/y_number_simple_real.json: -------------------------------------------------------------------------------- 1 | [123.456789] -------------------------------------------------------------------------------- /testdata/json_suite/y_string_double_escape_a.json: -------------------------------------------------------------------------------- 1 | ["\\a"] -------------------------------------------------------------------------------- /testdata/json_suite/y_string_double_escape_n.json: -------------------------------------------------------------------------------- 1 | ["\\n"] -------------------------------------------------------------------------------- /testdata/json_suite/y_string_null_escape.json: -------------------------------------------------------------------------------- 1 | ["\u0000"] -------------------------------------------------------------------------------- /testdata/json_suite/y_string_one-byte-utf-8.json: -------------------------------------------------------------------------------- 1 | ["\u002c"] -------------------------------------------------------------------------------- /testdata/json_suite/y_string_simple_ascii.json: -------------------------------------------------------------------------------- 1 | ["asd "] -------------------------------------------------------------------------------- /testdata/json_suite/y_string_two-byte-utf-8.json: -------------------------------------------------------------------------------- 1 | ["\u0123"] -------------------------------------------------------------------------------- /testdata/json_suite/y_string_u+2028_line_sep.json: -------------------------------------------------------------------------------- 1 | ["
"] -------------------------------------------------------------------------------- /testdata/json_suite/y_structure_lonely_false.json: -------------------------------------------------------------------------------- 1 | false -------------------------------------------------------------------------------- /testdata/json_suite/y_structure_lonely_string.json: -------------------------------------------------------------------------------- 1 | "asd" -------------------------------------------------------------------------------- /testdata/json_suite/y_structure_true_in_array.json: -------------------------------------------------------------------------------- 1 | [true] -------------------------------------------------------------------------------- /testdata/json_suite/y_structure_whitespace_array.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /testdata/json_suite/i_number_neg_int_huge_exp.json: -------------------------------------------------------------------------------- 1 | [-1e+9999] -------------------------------------------------------------------------------- /testdata/json_suite/i_number_real_underflow.json: -------------------------------------------------------------------------------- 1 | [123e-10000000] -------------------------------------------------------------------------------- /testdata/json_suite/i_structure_UTF-8_BOM_empty_object.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /testdata/json_suite/n_array_1_true_without_comma.json: -------------------------------------------------------------------------------- 1 | [1 true] -------------------------------------------------------------------------------- /testdata/json_suite/n_array_colon_instead_of_comma.json: -------------------------------------------------------------------------------- 1 | ["": 1] -------------------------------------------------------------------------------- /testdata/json_suite/n_array_incomplete_invalid_value.json: -------------------------------------------------------------------------------- 1 | [x -------------------------------------------------------------------------------- /testdata/json_suite/n_array_inner_array_no_comma.json: -------------------------------------------------------------------------------- 1 | [3[4]] -------------------------------------------------------------------------------- /testdata/json_suite/n_array_number_and_several_commas.json: -------------------------------------------------------------------------------- 1 | [1,,] -------------------------------------------------------------------------------- /testdata/json_suite/n_array_unclosed_trailing_comma.json: -------------------------------------------------------------------------------- 1 | [1, -------------------------------------------------------------------------------- /testdata/json_suite/n_array_unclosed_with_object_inside.json: -------------------------------------------------------------------------------- 1 | [{} -------------------------------------------------------------------------------- /testdata/json_suite/n_number_U+FF11_fullwidth_digit_one.json: -------------------------------------------------------------------------------- 1 | [1] -------------------------------------------------------------------------------- /testdata/json_suite/n_number_minus_infinity.json: -------------------------------------------------------------------------------- 1 | [-Infinity] -------------------------------------------------------------------------------- /testdata/json_suite/n_number_neg_with_garbage_at_end.json: -------------------------------------------------------------------------------- 1 | [-1x] -------------------------------------------------------------------------------- /testdata/json_suite/n_number_real_garbage_after_e.json: -------------------------------------------------------------------------------- 1 | [1ea] -------------------------------------------------------------------------------- /testdata/json_suite/n_object_garbage_at_end.json: -------------------------------------------------------------------------------- 1 | {"a":"a" 123} -------------------------------------------------------------------------------- /testdata/json_suite/n_object_missing_semicolon.json: -------------------------------------------------------------------------------- 1 | {"a" "b"} -------------------------------------------------------------------------------- /testdata/json_suite/n_object_trailing_comment.json: -------------------------------------------------------------------------------- 1 | {"a":"b"}/**/ -------------------------------------------------------------------------------- /testdata/json_suite/n_object_unterminated-value.json: -------------------------------------------------------------------------------- 1 | {"a":"a -------------------------------------------------------------------------------- /testdata/json_suite/n_string_accentuated_char_no_quotes.json: -------------------------------------------------------------------------------- 1 | [é] -------------------------------------------------------------------------------- /testdata/json_suite/n_string_escaped_backslash_bad.json: -------------------------------------------------------------------------------- 1 | ["\\\"] -------------------------------------------------------------------------------- /testdata/json_suite/n_string_escaped_ctrl_char_tab.json: -------------------------------------------------------------------------------- 1 | ["\ "] -------------------------------------------------------------------------------- /testdata/json_suite/n_string_invalid_backslash_esc.json: -------------------------------------------------------------------------------- 1 | ["\a"] -------------------------------------------------------------------------------- /testdata/json_suite/n_string_no_quotes_with_bad_escape.json: -------------------------------------------------------------------------------- 1 | [\n] -------------------------------------------------------------------------------- /testdata/json_suite/n_string_single_quote.json: -------------------------------------------------------------------------------- 1 | ['single quote'] -------------------------------------------------------------------------------- /testdata/json_suite/n_string_unescaped_ctrl_char.json: -------------------------------------------------------------------------------- 1 | ["aa"] -------------------------------------------------------------------------------- /testdata/json_suite/n_structure_angle_bracket_null.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /testdata/json_suite/n_structure_array_trailing_garbage.json: -------------------------------------------------------------------------------- 1 | [1]x -------------------------------------------------------------------------------- /testdata/json_suite/n_structure_ascii-unicode-identifier.json: -------------------------------------------------------------------------------- 1 | aå -------------------------------------------------------------------------------- /testdata/json_suite/n_structure_capitalized_True.json: -------------------------------------------------------------------------------- 1 | [True] -------------------------------------------------------------------------------- /testdata/json_suite/n_structure_close_unopened_array.json: -------------------------------------------------------------------------------- 1 | 1] -------------------------------------------------------------------------------- /testdata/json_suite/n_structure_open_array_apostrophe.json: -------------------------------------------------------------------------------- 1 | [' -------------------------------------------------------------------------------- /testdata/json_suite/n_structure_open_array_open_object.json: -------------------------------------------------------------------------------- 1 | [{ -------------------------------------------------------------------------------- /testdata/json_suite/n_structure_open_array_open_string.json: -------------------------------------------------------------------------------- 1 | ["a -------------------------------------------------------------------------------- /testdata/json_suite/n_structure_open_object_close_array.json: -------------------------------------------------------------------------------- 1 | {] -------------------------------------------------------------------------------- /testdata/json_suite/n_structure_open_object_open_array.json: -------------------------------------------------------------------------------- 1 | {[ -------------------------------------------------------------------------------- /testdata/json_suite/n_structure_open_object_open_string.json: -------------------------------------------------------------------------------- 1 | {"a -------------------------------------------------------------------------------- /testdata/json_suite/n_structure_open_open.json: -------------------------------------------------------------------------------- 1 | ["\{["\{["\{["\{ -------------------------------------------------------------------------------- /testdata/json_suite/n_structure_trailing_#.json: -------------------------------------------------------------------------------- 1 | {"a":"b"}#{} -------------------------------------------------------------------------------- /testdata/json_suite/n_structure_whitespace_formfeed.json: -------------------------------------------------------------------------------- 1 | [ ] -------------------------------------------------------------------------------- /testdata/json_suite/y_array_with_1_and_newline.json: -------------------------------------------------------------------------------- 1 | [1 2 | ] -------------------------------------------------------------------------------- /testdata/json_suite/y_number_real_capital_e_neg_exp.json: -------------------------------------------------------------------------------- 1 | [1E-2] -------------------------------------------------------------------------------- /testdata/json_suite/y_number_real_capital_e_pos_exp.json: -------------------------------------------------------------------------------- 1 | [1E+2] -------------------------------------------------------------------------------- /testdata/json_suite/y_object.json: -------------------------------------------------------------------------------- 1 | {"asd":"sdf", "dfg":"fgh"} -------------------------------------------------------------------------------- /testdata/json_suite/y_string_backslash_doublequotes.json: -------------------------------------------------------------------------------- 1 | ["\""] -------------------------------------------------------------------------------- /testdata/json_suite/y_string_comments.json: -------------------------------------------------------------------------------- 1 | ["a/*b*/c/*d//e"] -------------------------------------------------------------------------------- /testdata/json_suite/y_string_three-byte-utf-8.json: -------------------------------------------------------------------------------- 1 | ["\u0821"] -------------------------------------------------------------------------------- /testdata/json_suite/y_string_unescaped_char_delete.json: -------------------------------------------------------------------------------- 1 | [""] -------------------------------------------------------------------------------- /testdata/json_suite/y_string_with_del_character.json: -------------------------------------------------------------------------------- 1 | ["aa"] -------------------------------------------------------------------------------- /testdata/json_suite/y_structure_lonely_negative_real.json: -------------------------------------------------------------------------------- 1 | -0.1 -------------------------------------------------------------------------------- /testdata/json_suite/y_structure_trailing_newline.json: -------------------------------------------------------------------------------- 1 | ["a"] 2 | -------------------------------------------------------------------------------- /testdata/json_suite/i_number_double_huge_neg_exp.json: -------------------------------------------------------------------------------- 1 | [123.456e-789] -------------------------------------------------------------------------------- /testdata/json_suite/i_number_pos_double_huge_exp.json: -------------------------------------------------------------------------------- 1 | [1.5e+9999] -------------------------------------------------------------------------------- /testdata/json_suite/i_number_real_neg_overflow.json: -------------------------------------------------------------------------------- 1 | [-123123e100000] -------------------------------------------------------------------------------- /testdata/json_suite/i_number_real_pos_overflow.json: -------------------------------------------------------------------------------- 1 | [123123e100000] -------------------------------------------------------------------------------- /testdata/json_suite/i_object_key_lone_2nd_surrogate.json: -------------------------------------------------------------------------------- 1 | {"\uDFAA":0} -------------------------------------------------------------------------------- /testdata/json_suite/i_string_invalid_lonely_surrogate.json: -------------------------------------------------------------------------------- 1 | ["\ud800"] -------------------------------------------------------------------------------- /testdata/json_suite/i_string_invalid_surrogate.json: -------------------------------------------------------------------------------- 1 | ["\ud800abc"] -------------------------------------------------------------------------------- /testdata/json_suite/i_string_lone_second_surrogate.json: -------------------------------------------------------------------------------- 1 | ["\uDFAA"] -------------------------------------------------------------------------------- /testdata/json_suite/n_array_items_separated_by_semicolon.json: -------------------------------------------------------------------------------- 1 | [1:2] -------------------------------------------------------------------------------- /testdata/json_suite/n_number_invalid-negative-real.json: -------------------------------------------------------------------------------- 1 | [-123.123foo] -------------------------------------------------------------------------------- /testdata/json_suite/n_number_neg_int_starting_with_zero.json: -------------------------------------------------------------------------------- 1 | [-012] -------------------------------------------------------------------------------- /testdata/json_suite/n_number_neg_real_without_int_part.json: -------------------------------------------------------------------------------- 1 | [-.123] -------------------------------------------------------------------------------- /testdata/json_suite/n_number_real_without_fractional_part.json: -------------------------------------------------------------------------------- 1 | [1.] -------------------------------------------------------------------------------- /testdata/json_suite/n_object_comma_instead_of_colon.json: -------------------------------------------------------------------------------- 1 | {"x", null} -------------------------------------------------------------------------------- /testdata/json_suite/n_object_with_trailing_garbage.json: -------------------------------------------------------------------------------- 1 | {"a":"b"}# -------------------------------------------------------------------------------- /testdata/json_suite/n_string_1_surrogate_then_escape.json: -------------------------------------------------------------------------------- 1 | ["\uD800\"] -------------------------------------------------------------------------------- /testdata/json_suite/n_string_incomplete_surrogate.json: -------------------------------------------------------------------------------- 1 | ["\uD834\uDd"] -------------------------------------------------------------------------------- /testdata/json_suite/n_string_invalid_unicode_escape.json: -------------------------------------------------------------------------------- 1 | ["\uqqqq"] -------------------------------------------------------------------------------- /testdata/json_suite/n_string_single_string_no_double_quotes.json: -------------------------------------------------------------------------------- 1 | abc -------------------------------------------------------------------------------- /testdata/json_suite/n_string_unescaped_newline.json: -------------------------------------------------------------------------------- 1 | ["new 2 | line"] -------------------------------------------------------------------------------- /testdata/json_suite/n_structure_null-byte-outside-string.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /testdata/json_suite/n_structure_number_with_trailing_garbage.json: -------------------------------------------------------------------------------- 1 | 2@ -------------------------------------------------------------------------------- /testdata/json_suite/n_structure_object_unclosed_no_value.json: -------------------------------------------------------------------------------- 1 | {"": -------------------------------------------------------------------------------- /testdata/json_suite/n_structure_unclosed_object.json: -------------------------------------------------------------------------------- 1 | {"asd":"asd" -------------------------------------------------------------------------------- /testdata/json_suite/y_array_heterogeneous.json: -------------------------------------------------------------------------------- 1 | [null, 1, "1", {}] -------------------------------------------------------------------------------- /testdata/json_suite/y_number_real_fraction_exponent.json: -------------------------------------------------------------------------------- 1 | [123.456e78] -------------------------------------------------------------------------------- /testdata/json_suite/y_object_duplicated_key.json: -------------------------------------------------------------------------------- 1 | {"a":"b","a":"c"} -------------------------------------------------------------------------------- /testdata/json_suite/y_object_with_newlines.json: -------------------------------------------------------------------------------- 1 | { 2 | "a": "b" 3 | } -------------------------------------------------------------------------------- /testdata/json_suite/y_string_escaped_noncharacter.json: -------------------------------------------------------------------------------- 1 | ["\uFFFF"] -------------------------------------------------------------------------------- /testdata/json_suite/y_string_nbsp_uescaped.json: -------------------------------------------------------------------------------- 1 | ["new\u00A0line"] -------------------------------------------------------------------------------- /testdata/json_suite/y_string_nonCharacterInUTF-8_U+10FFFF.json: -------------------------------------------------------------------------------- 1 | ["􏿿"] -------------------------------------------------------------------------------- /testdata/json_suite/y_string_nonCharacterInUTF-8_U+FFFF.json: -------------------------------------------------------------------------------- 1 | ["￿"] -------------------------------------------------------------------------------- /testdata/json_suite/y_string_uescaped_newline.json: -------------------------------------------------------------------------------- 1 | ["new\u000Aline"] -------------------------------------------------------------------------------- /testdata/json_suite/y_string_unicodeEscapedBackslash.json: -------------------------------------------------------------------------------- 1 | ["\u005C"] -------------------------------------------------------------------------------- /testdata/json_suite/y_string_unicode_U+FDD0_nonchar.json: -------------------------------------------------------------------------------- 1 | ["\uFDD0"] -------------------------------------------------------------------------------- /testdata/json_suite/y_string_unicode_U+FFFE_nonchar.json: -------------------------------------------------------------------------------- 1 | ["\uFFFE"] -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Kirill Simonov 2 | Canonical Ltd 3 | The Go Faster Authors 4 | -------------------------------------------------------------------------------- /testdata/json_suite/i_number_too_big_pos_int.json: -------------------------------------------------------------------------------- 1 | [100000000000000000000] -------------------------------------------------------------------------------- /testdata/json_suite/i_string_1st_surrogate_but_2nd_missing.json: -------------------------------------------------------------------------------- 1 | ["\uDADA"] -------------------------------------------------------------------------------- /testdata/json_suite/i_string_incomplete_surrogate_pair.json: -------------------------------------------------------------------------------- 1 | ["\uDd1ea"] -------------------------------------------------------------------------------- /testdata/json_suite/n_array_newlines_unclosed.json: -------------------------------------------------------------------------------- 1 | ["a", 2 | 4 3 | ,1, -------------------------------------------------------------------------------- /testdata/json_suite/n_array_spaces_vertical_tab_formfeed.json: -------------------------------------------------------------------------------- 1 | [" a"\f] -------------------------------------------------------------------------------- /testdata/json_suite/n_array_unclosed_with_new_lines.json: -------------------------------------------------------------------------------- 1 | [1, 2 | 1 3 | ,1 -------------------------------------------------------------------------------- /testdata/json_suite/n_number_minus_sign_with_trailing_garbage.json: -------------------------------------------------------------------------------- 1 | [-foo] -------------------------------------------------------------------------------- /testdata/json_suite/n_object_key_with_single_quotes.json: -------------------------------------------------------------------------------- 1 | {key: 'value'} -------------------------------------------------------------------------------- /testdata/json_suite/n_object_repeated_null_null.json: -------------------------------------------------------------------------------- 1 | {null:null,null:null} -------------------------------------------------------------------------------- /testdata/json_suite/n_object_several_trailing_commas.json: -------------------------------------------------------------------------------- 1 | {"id":0,,,,,} -------------------------------------------------------------------------------- /testdata/json_suite/n_object_trailing_comment_open.json: -------------------------------------------------------------------------------- 1 | {"a":"b"}/**// -------------------------------------------------------------------------------- /testdata/json_suite/n_object_trailing_comment_slash_open.json: -------------------------------------------------------------------------------- 1 | {"a":"b"}// -------------------------------------------------------------------------------- /testdata/json_suite/n_object_two_commas_in_a_row.json: -------------------------------------------------------------------------------- 1 | {"a":"b",,"c":"d"} -------------------------------------------------------------------------------- /testdata/json_suite/n_string_1_surrogate_then_escape_u.json: -------------------------------------------------------------------------------- 1 | ["\uD800\u"] -------------------------------------------------------------------------------- /testdata/json_suite/n_string_1_surrogate_then_escape_u1.json: -------------------------------------------------------------------------------- 1 | ["\uD800\u1"] -------------------------------------------------------------------------------- /testdata/json_suite/n_string_incomplete_escaped_character.json: -------------------------------------------------------------------------------- 1 | ["\u00A"] -------------------------------------------------------------------------------- /testdata/json_suite/n_string_leading_uescaped_thinspace.json: -------------------------------------------------------------------------------- 1 | [\u0020"asd"] -------------------------------------------------------------------------------- /testdata/json_suite/n_structure_array_with_extra_array_close.json: -------------------------------------------------------------------------------- 1 | [1]] -------------------------------------------------------------------------------- /testdata/json_suite/n_structure_array_with_unclosed_string.json: -------------------------------------------------------------------------------- 1 | ["asd] -------------------------------------------------------------------------------- /testdata/json_suite/n_structure_object_followed_by_closing_object.json: -------------------------------------------------------------------------------- 1 | {}} -------------------------------------------------------------------------------- /testdata/json_suite/n_structure_uescaped_LF_before_string.json: -------------------------------------------------------------------------------- 1 | [\u000A""] -------------------------------------------------------------------------------- /testdata/json_suite/n_structure_whitespace_U+2060_word_joiner.json: -------------------------------------------------------------------------------- 1 | [⁠] -------------------------------------------------------------------------------- /testdata/json_suite/y_array_with_several_null.json: -------------------------------------------------------------------------------- 1 | [1,null,null,null,2] -------------------------------------------------------------------------------- /testdata/json_suite/y_object_escaped_null_in_key.json: -------------------------------------------------------------------------------- 1 | {"foo\u0000bar": 42} -------------------------------------------------------------------------------- /testdata/json_suite/y_string_accepted_surrogate_pair.json: -------------------------------------------------------------------------------- 1 | ["\uD801\udc37"] -------------------------------------------------------------------------------- /testdata/json_suite/y_string_allowed_escapes.json: -------------------------------------------------------------------------------- 1 | ["\"\\\/\b\f\n\r\t"] -------------------------------------------------------------------------------- /testdata/json_suite/y_string_backslash_and_u_escaped_zero.json: -------------------------------------------------------------------------------- 1 | ["\\u0000"] -------------------------------------------------------------------------------- /testdata/json_suite/y_string_escaped_control_character.json: -------------------------------------------------------------------------------- 1 | ["\u0012"] -------------------------------------------------------------------------------- /testdata/json_suite/y_string_in_array_with_leading_space.json: -------------------------------------------------------------------------------- 1 | [ "asd"] -------------------------------------------------------------------------------- /testdata/json_suite/y_string_last_surrogates_1_and_2.json: -------------------------------------------------------------------------------- 1 | ["\uDBFF\uDFFF"] -------------------------------------------------------------------------------- /testdata/json_suite/y_string_reservedCharacterInUTF-8_U+1BFFF.json: -------------------------------------------------------------------------------- 1 | ["𛿿"] -------------------------------------------------------------------------------- /testdata/json_suite/y_string_uEscape.json: -------------------------------------------------------------------------------- 1 | ["\u0061\u30af\u30EA\u30b9"] -------------------------------------------------------------------------------- /testdata/json_suite/y_string_unicode_U+1FFFE_nonchar.json: -------------------------------------------------------------------------------- 1 | ["\uD83F\uDFFE"] -------------------------------------------------------------------------------- /testdata/json_suite/y_string_unicode_U+2064_invisible_plus.json: -------------------------------------------------------------------------------- 1 | ["\u2064"] -------------------------------------------------------------------------------- /testdata/json_suite/y_string_unicode_escaped_double_quote.json: -------------------------------------------------------------------------------- 1 | ["\u0022"] -------------------------------------------------------------------------------- /testdata/json_suite/i_string_inverted_surrogates_U+1D11E.json: -------------------------------------------------------------------------------- 1 | ["\uDd1e\uD834"] -------------------------------------------------------------------------------- /testdata/json_suite/n_number_with_alpha_char.json: -------------------------------------------------------------------------------- 1 | [1.8011670033376514H-308] -------------------------------------------------------------------------------- /testdata/json_suite/n_object_with_single_string.json: -------------------------------------------------------------------------------- 1 | { "foo" : "bar", "a" } -------------------------------------------------------------------------------- /testdata/json_suite/n_string_1_surrogate_then_escape_u1x.json: -------------------------------------------------------------------------------- 1 | ["\uD800\u1x"] -------------------------------------------------------------------------------- /testdata/json_suite/n_structure_comma_instead_of_closing_brace.json: -------------------------------------------------------------------------------- 1 | {"x": true, -------------------------------------------------------------------------------- /testdata/json_suite/n_structure_object_with_comment.json: -------------------------------------------------------------------------------- 1 | {"a":/*comment*/"b"} -------------------------------------------------------------------------------- /testdata/json_suite/n_structure_open_object_string_with_apostrophes.json: -------------------------------------------------------------------------------- 1 | {'a' -------------------------------------------------------------------------------- /testdata/json_suite/n_structure_unclosed_array_partial_null.json: -------------------------------------------------------------------------------- 1 | [ false, nul -------------------------------------------------------------------------------- /testdata/json_suite/y_object_duplicated_key_and_value.json: -------------------------------------------------------------------------------- 1 | {"a":"b","a":"b"} -------------------------------------------------------------------------------- /testdata/json_suite/y_string_unicode_U+10FFFE_nonchar.json: -------------------------------------------------------------------------------- 1 | ["\uDBFF\uDFFE"] -------------------------------------------------------------------------------- /testdata/json_suite/y_string_unicode_U+200B_ZERO_WIDTH_SPACE.json: -------------------------------------------------------------------------------- 1 | ["\u200B"] -------------------------------------------------------------------------------- /testdata/json_suite/i_number_too_big_neg_int.json: -------------------------------------------------------------------------------- 1 | [-123123123123123123123123123123] -------------------------------------------------------------------------------- /testdata/json_suite/i_string_1st_valid_surrogate_2nd_invalid.json: -------------------------------------------------------------------------------- 1 | ["\uD888\u1234"] -------------------------------------------------------------------------------- /testdata/json_suite/i_string_incomplete_surrogate_and_escape_valid.json: -------------------------------------------------------------------------------- 1 | ["\uD800\n"] -------------------------------------------------------------------------------- /testdata/json_suite/n_object_trailing_comment_slash_open_incomplete.json: -------------------------------------------------------------------------------- 1 | {"a":"b"}/ -------------------------------------------------------------------------------- /testdata/json_suite/n_structure_object_with_trailing_garbage.json: -------------------------------------------------------------------------------- 1 | {"a": true} "x" -------------------------------------------------------------------------------- /testdata/json_suite/n_structure_unclosed_array_unfinished_false.json: -------------------------------------------------------------------------------- 1 | [ true, fals -------------------------------------------------------------------------------- /testdata/json_suite/n_structure_unclosed_array_unfinished_true.json: -------------------------------------------------------------------------------- 1 | [ false, tru -------------------------------------------------------------------------------- /testdata/json_suite/y_string_1_2_3_bytes_UTF-8_sequences.json: -------------------------------------------------------------------------------- 1 | ["\u0060\u012a\u12AB"] -------------------------------------------------------------------------------- /.github/release.yml: -------------------------------------------------------------------------------- 1 | changelog: 2 | exclude: 3 | authors: 4 | - dependabot -------------------------------------------------------------------------------- /testdata/json_suite/i_string_incomplete_surrogates_escape_valid.json: -------------------------------------------------------------------------------- 1 | ["\uD800\uD800\n"] -------------------------------------------------------------------------------- /testdata/json_suite/n_object_non_string_key_but_huge_number_instead.json: -------------------------------------------------------------------------------- 1 | {9999E9999:1} -------------------------------------------------------------------------------- /testdata/json_suite/n_string_incomplete_surrogate_escape_invalid.json: -------------------------------------------------------------------------------- 1 | ["\uD800\uD800\x"] -------------------------------------------------------------------------------- /testdata/json_suite/y_object_extreme_numbers.json: -------------------------------------------------------------------------------- 1 | { "min": -1.0e+28, "max": 1.0e+28 } -------------------------------------------------------------------------------- /testdata/json_suite/y_string_accepted_surrogate_pairs.json: -------------------------------------------------------------------------------- 1 | ["\ud83d\ude39\ud83d\udc8d"] -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Never modify line endings of corpus. 2 | testdata/fuzz/** text eol=lf 3 | -------------------------------------------------------------------------------- /testdata/fuzz/FuzzDecodeEncodeDecode/f79f09ab701cbe11: -------------------------------------------------------------------------------- 1 | go test fuzz v1 2 | []byte("!%5B") 3 | -------------------------------------------------------------------------------- /testdata/json_suite/y_string_surrogates_U+1D11E_MUSICAL_SYMBOL_G_CLEF.json: -------------------------------------------------------------------------------- 1 | ["\uD834\uDd1e"] -------------------------------------------------------------------------------- /testdata/fuzz/FuzzDecodeEncodeDecode/f21f52dada1442fc: -------------------------------------------------------------------------------- 1 | go test fuzz v1 2 | []byte("{{}#\n}0") 3 | -------------------------------------------------------------------------------- /testdata/fuzz/FuzzDecodeEncodeDecode/f62dc59e4c32e1d6: -------------------------------------------------------------------------------- 1 | go test fuzz v1 2 | []byte("!%C0%80") 3 | -------------------------------------------------------------------------------- /testdata/fuzz/FuzzDecodeEncodeDecode/f91ab6905aa88579: -------------------------------------------------------------------------------- 1 | go test fuzz v1 2 | []byte("{{} #\n}") 3 | -------------------------------------------------------------------------------- /testdata/fuzz/FuzzDecodeEncodeDecode/3fd9827db9432432: -------------------------------------------------------------------------------- 1 | go test fuzz v1 2 | []byte("0:\n 0: #\n !0\n -") 3 | -------------------------------------------------------------------------------- /testdata/json_suite/i_number_very_big_negative_int.json: -------------------------------------------------------------------------------- 1 | [-237462374673276894279832749832423479823246327846] -------------------------------------------------------------------------------- /testdata/fuzz/FuzzDecodeEncodeDecode/64588d00b12b492f: -------------------------------------------------------------------------------- 1 | go test fuzz v1 2 | []byte("0:\n 0: #\n !0\n 0:") 3 | -------------------------------------------------------------------------------- /testdata/fuzz/FuzzDecodeEncodeDecode/999e9f6055aa8567: -------------------------------------------------------------------------------- 1 | go test fuzz v1 2 | []byte("0: &\ud7ff\n? *\ud7ff") 3 | -------------------------------------------------------------------------------- /testdata/fuzz/FuzzDecodeEncodeDecode/20a8e7b63360c437: -------------------------------------------------------------------------------- 1 | go test fuzz v1 2 | []byte("0:\n 0000: 00000\n000: #0000\n !0\n 00:") 3 | -------------------------------------------------------------------------------- /testdata/fuzz/FuzzDecodeEncodeDecode/c18522695dec4f600bb0200536e2084f9f7e5ca10ec94d99bbf541b15f0de9e0: -------------------------------------------------------------------------------- 1 | go test fuzz v1 2 | []byte("?") 3 | -------------------------------------------------------------------------------- /testdata/fuzz/FuzzDecodeEncodeDecode/90513016cb18725627689d6b25adb2c440d71f64d72e23ef201ed3ac51443001: -------------------------------------------------------------------------------- 1 | go test fuzz v1 2 | []byte("{0}") 3 | -------------------------------------------------------------------------------- /testdata/json_suite/i_string_iso_latin_1.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-faster/yaml/HEAD/testdata/json_suite/i_string_iso_latin_1.json -------------------------------------------------------------------------------- /testdata/json_suite/n_array_invalid_utf8.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-faster/yaml/HEAD/testdata/json_suite/n_array_invalid_utf8.json -------------------------------------------------------------------------------- /testdata/json_suite/y_number_double_close_to_zero.json: -------------------------------------------------------------------------------- 1 | [-0.000000000000000000000000000000000000000000000000000000000000000000000000000001] 2 | -------------------------------------------------------------------------------- /testdata/json_suite/i_string_invalid_utf-8.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-faster/yaml/HEAD/testdata/json_suite/i_string_invalid_utf-8.json -------------------------------------------------------------------------------- /testdata/json_suite/i_string_truncated-utf-8.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-faster/yaml/HEAD/testdata/json_suite/i_string_truncated-utf-8.json -------------------------------------------------------------------------------- /testdata/json_suite/i_string_utf16BE_no_BOM.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-faster/yaml/HEAD/testdata/json_suite/i_string_utf16BE_no_BOM.json -------------------------------------------------------------------------------- /testdata/json_suite/i_string_utf16LE_no_BOM.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-faster/yaml/HEAD/testdata/json_suite/i_string_utf16LE_no_BOM.json -------------------------------------------------------------------------------- /testdata/json_suite/n_array_a_invalid_utf8.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-faster/yaml/HEAD/testdata/json_suite/n_array_a_invalid_utf8.json -------------------------------------------------------------------------------- /testdata/json_suite/i_string_UTF-16LE_with_BOM.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-faster/yaml/HEAD/testdata/json_suite/i_string_UTF-16LE_with_BOM.json -------------------------------------------------------------------------------- /testdata/json_suite/n_structure_single_eacute.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-faster/yaml/HEAD/testdata/json_suite/n_structure_single_eacute.json -------------------------------------------------------------------------------- /.codecov.yml: -------------------------------------------------------------------------------- 1 | ignore: 2 | - tools/** 3 | coverage: 4 | status: 5 | patch: false 6 | project: 7 | default: 8 | threshold: 0.5% 9 | -------------------------------------------------------------------------------- /testdata/json_suite/i_string_not_in_unicode_range.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-faster/yaml/HEAD/testdata/json_suite/i_string_not_in_unicode_range.json -------------------------------------------------------------------------------- /testdata/json_suite/n_number_invalid-utf-8-in-int.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-faster/yaml/HEAD/testdata/json_suite/n_number_invalid-utf-8-in-int.json -------------------------------------------------------------------------------- /testdata/json_suite/y_object_long_strings.json: -------------------------------------------------------------------------------- 1 | {"x":[{"id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}], "id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"} -------------------------------------------------------------------------------- /testdata/json_suite/y_object_string_unicode.json: -------------------------------------------------------------------------------- 1 | {"title":"\u041f\u043e\u043b\u0442\u043e\u0440\u0430 \u0417\u0435\u043c\u043b\u0435\u043a\u043e\u043f\u0430" } -------------------------------------------------------------------------------- /testdata/json_suite/i_string_UTF-8_invalid_sequence.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-faster/yaml/HEAD/testdata/json_suite/i_string_UTF-8_invalid_sequence.json -------------------------------------------------------------------------------- /testdata/json_suite/i_string_UTF8_surrogate_U+D800.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-faster/yaml/HEAD/testdata/json_suite/i_string_UTF8_surrogate_U+D800.json -------------------------------------------------------------------------------- /testdata/json_suite/n_structure_incomplete_UTF8_BOM.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-faster/yaml/HEAD/testdata/json_suite/n_structure_incomplete_UTF8_BOM.json -------------------------------------------------------------------------------- /testdata/json_suite/n_structure_lone-invalid-utf-8.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-faster/yaml/HEAD/testdata/json_suite/n_structure_lone-invalid-utf-8.json -------------------------------------------------------------------------------- /go.coverage.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | go test -race -v -coverpkg=./... -coverprofile=profile.out ./... 6 | go tool cover -func profile.out 7 | -------------------------------------------------------------------------------- /testdata/json_suite/i_string_overlong_sequence_2_bytes.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-faster/yaml/HEAD/testdata/json_suite/i_string_overlong_sequence_2_bytes.json -------------------------------------------------------------------------------- /testdata/json_suite/i_string_overlong_sequence_6_bytes.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-faster/yaml/HEAD/testdata/json_suite/i_string_overlong_sequence_6_bytes.json -------------------------------------------------------------------------------- /testdata/json_suite/n_number_invalid-utf-8-in-exponent.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-faster/yaml/HEAD/testdata/json_suite/n_number_invalid-utf-8-in-exponent.json -------------------------------------------------------------------------------- /testdata/json_suite/n_string_invalid-utf-8-in-escape.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-faster/yaml/HEAD/testdata/json_suite/n_string_invalid-utf-8-in-escape.json -------------------------------------------------------------------------------- /testdata/json_suite/n_string_invalid_utf8_after_escape.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-faster/yaml/HEAD/testdata/json_suite/n_string_invalid_utf8_after_escape.json -------------------------------------------------------------------------------- /testdata/json_suite/i_string_lone_utf8_continuation_byte.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-faster/yaml/HEAD/testdata/json_suite/i_string_lone_utf8_continuation_byte.json -------------------------------------------------------------------------------- /testdata/json_suite/n_number_invalid-utf-8-in-bigger-int.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-faster/yaml/HEAD/testdata/json_suite/n_number_invalid-utf-8-in-bigger-int.json -------------------------------------------------------------------------------- /testdata/json_suite/i_string_overlong_sequence_6_bytes_null.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-faster/yaml/HEAD/testdata/json_suite/i_string_overlong_sequence_6_bytes_null.json -------------------------------------------------------------------------------- /testdata/json_suite/n_number_real_with_invalid_utf8_after_e.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-faster/yaml/HEAD/testdata/json_suite/n_number_real_with_invalid_utf8_after_e.json -------------------------------------------------------------------------------- /testdata/json_suite/i_number_huge_exp.json: -------------------------------------------------------------------------------- 1 | [0.4e00669999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999969999999006] -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /vendor 2 | /bug_test.go 3 | /coverage.txt 4 | /.idea 5 | .idea 6 | _bin/* 7 | ./examples 8 | 9 | *-fuzz.zip 10 | 11 | *.out 12 | *.dump 13 | *.test 14 | 15 | corpus 16 | -------------------------------------------------------------------------------- /.github/dependency-review-config.yml: -------------------------------------------------------------------------------- 1 | fail_on_severity: "low" 2 | allow_licenses: 3 | - "MIT" 4 | - "ISC" 5 | - "MPL-2.0" 6 | - "BSD-2-Clause" 7 | - "BSD-3-Clause" 8 | - "Apache-2.0" 9 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @./go.test.sh 3 | .PHONY: test 4 | 5 | coverage: 6 | @./go.coverage.sh 7 | .PHONY: coverage 8 | 9 | test_fast: 10 | go test ./... 11 | 12 | tidy: 13 | go mod tidy 14 | -------------------------------------------------------------------------------- /testdata/json_suite/n_object_lone_continuation_byte_in_key_and_trailing_comma.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-faster/yaml/HEAD/testdata/json_suite/n_object_lone_continuation_byte_in_key_and_trailing_comma.json -------------------------------------------------------------------------------- /testdata/yaml_suite/HWV9.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Document-end marker 3 | from: '@perlpunk' 4 | tags: footer 5 | yaml: | 6 | ... 7 | tree: | 8 | +STR 9 | -STR 10 | json: '' 11 | dump: '' 12 | -------------------------------------------------------------------------------- /testdata/yaml_suite/9MMA.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Directive by itself with no document 3 | from: '@ingydotnet' 4 | tags: error directive 5 | fail: true 6 | yaml: | 7 | %YAML 1.2 8 | tree: | 9 | +STR 10 | -------------------------------------------------------------------------------- /testdata/yaml_suite/H7TQ.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Extra words on %YAML directive 3 | from: '@ingydotnet' 4 | tags: directive 5 | fail: true 6 | yaml: | 7 | %YAML 1.2 foo 8 | --- 9 | tree: | 10 | +STR 11 | -------------------------------------------------------------------------------- /testdata/yaml_suite/B63P.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Directive without document 3 | from: AdaYaml tests 4 | tags: error directive document 5 | fail: true 6 | yaml: | 7 | %YAML 1.2 8 | ... 9 | tree: | 10 | +STR 11 | -------------------------------------------------------------------------------- /testdata/yaml_suite/LHL4.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Invalid tag 3 | from: '@perlpunk' 4 | tags: error tag 5 | fail: true 6 | yaml: | 7 | --- 8 | !invalid{}tag scalar 9 | tree: | 10 | +STR 11 | +DOC --- 12 | -------------------------------------------------------------------------------- /testdata/yaml_suite/U99R.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Invalid comma in tag 3 | from: '@perlpunk' 4 | tags: error tag 5 | fail: true 6 | yaml: | 7 | - !!str, xxx 8 | tree: | 9 | +STR 10 | +DOC 11 | +SEQ 12 | -------------------------------------------------------------------------------- /testdata/yaml_suite/YJV2.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Dash in flow sequence 3 | from: '@ingydotnet' 4 | tags: flow sequence 5 | fail: true 6 | yaml: | 7 | [-] 8 | tree: | 9 | +STR 10 | +DOC 11 | +SEQ [] 12 | -------------------------------------------------------------------------------- /testdata/yaml_suite/SF5V.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Duplicate YAML directive 3 | from: '@perlpunk' 4 | tags: directive error 5 | fail: true 6 | yaml: | 7 | %YAML 1.2 8 | %YAML 1.2 9 | --- 10 | tree: | 11 | +STR 12 | -------------------------------------------------------------------------------- /go.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | echo "test" 6 | go test --timeout 5m ./... 7 | 8 | echo "test purego" 9 | go test --timeout 5m -tags purego ./... 10 | 11 | echo "test -race" 12 | go test --timeout 5m -race ./... 13 | -------------------------------------------------------------------------------- /testdata/yaml_suite/55WF.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Invalid escape in double quoted string 3 | from: '@perlpunk' 4 | tags: error double 5 | fail: true 6 | yaml: | 7 | --- 8 | "\." 9 | tree: | 10 | +STR 11 | +DOC --- 12 | -------------------------------------------------------------------------------- /testdata/yaml_suite/AVM7.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Empty Stream 3 | from: https://github.com/ingydotnet/yaml-pegex-pm/blob/master/test/misc.tml 4 | tags: edge 5 | yaml: | 6 | ∎ 7 | tree: | 8 | +STR 9 | -STR 10 | json: '' 11 | -------------------------------------------------------------------------------- /testdata/yaml_suite/SY6V.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Anchor before sequence entry on same line 3 | from: '@perlpunk' 4 | tags: anchor error sequence 5 | fail: true 6 | yaml: | 7 | &anchor - sequence entry 8 | tree: | 9 | +STR 10 | -------------------------------------------------------------------------------- /testdata/yaml_suite/QT73.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Comment and document-end marker 3 | from: '@perlpunk' 4 | tags: comment footer 5 | yaml: | 6 | # comment 7 | ... 8 | tree: | 9 | +STR 10 | -STR 11 | json: '' 12 | dump: '' 13 | -------------------------------------------------------------------------------- /testdata/yaml_suite/2CMS.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Invalid mapping in plain multiline 3 | from: '@perlpunk' 4 | tags: error mapping 5 | fail: true 6 | yaml: | 7 | this 8 | is 9 | invalid: x 10 | tree: | 11 | +STR 12 | +DOC 13 | -------------------------------------------------------------------------------- /testdata/yaml_suite/CXX2.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Mapping with anchor on document start line 3 | from: '@perlpunk' 4 | tags: anchor error header mapping 5 | fail: true 6 | yaml: | 7 | --- &anchor a: b 8 | tree: | 9 | +STR 10 | +DOC --- 11 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: gomod 4 | directory: "/" 5 | schedule: 6 | interval: daily 7 | - package-ecosystem: github-actions 8 | directory: "/" 9 | schedule: 10 | interval: daily 11 | -------------------------------------------------------------------------------- /testdata/yaml_suite/8MK2.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Explicit Non-Specific Tag 3 | from: NimYAML tests 4 | tags: tag 1.3-err 5 | yaml: | 6 | ! a 7 | tree: | 8 | +STR 9 | +DOC 10 | =VAL :a 11 | -DOC 12 | -STR 13 | json: | 14 | "a" 15 | -------------------------------------------------------------------------------- /testdata/yaml_suite/C2SP.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Flow Mapping Key on two lines 3 | from: '@perlpunk' 4 | tags: error flow mapping 5 | fail: true 6 | yaml: | 7 | [23 8 | ]: 42 9 | tree: | 10 | +STR 11 | +DOC 12 | +SEQ [] 13 | =VAL :23 14 | -------------------------------------------------------------------------------- /testdata/yaml_suite/EW3V.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Wrong indendation in mapping 3 | from: '@perlpunk' 4 | tags: error mapping indent 5 | fail: true 6 | yaml: | 7 | k1: v1 8 | k2: v2 9 | tree: | 10 | +STR 11 | +DOC 12 | +MAP 13 | =VAL :k1 14 | -------------------------------------------------------------------------------- /testdata/yaml_suite/G5U8.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Plain dashes in flow sequence 3 | from: '@ingydotnet' 4 | tags: flow sequence 5 | fail: true 6 | yaml: | 7 | --- 8 | - [-, -] 9 | tree: | 10 | +STR 11 | +DOC --- 12 | +SEQ 13 | +SEQ [] 14 | -------------------------------------------------------------------------------- /testdata/yaml_suite/JKF3.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Multiline unidented double quoted block key 3 | from: '@ingydotnet' 4 | tags: indent 5 | fail: true 6 | yaml: | 7 | - - "bar 8 | bar": x 9 | tree: | 10 | +STR 11 | +DOC 12 | +SEQ 13 | +SEQ 14 | -------------------------------------------------------------------------------- /testdata/yaml_suite/5TRB.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Invalid document-start marker in doublequoted tring 3 | from: '@perlpunk' 4 | tags: header double error 5 | fail: true 6 | yaml: | 7 | --- 8 | " 9 | --- 10 | " 11 | tree: | 12 | +STR 13 | +DOC --- 14 | -------------------------------------------------------------------------------- /testdata/yaml_suite/RXY3.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Invalid document-end marker in single quoted string 3 | from: '@perlpunk' 4 | tags: footer single error 5 | fail: true 6 | yaml: | 7 | --- 8 | ' 9 | ... 10 | ' 11 | tree: | 12 | +STR 13 | +DOC --- 14 | -------------------------------------------------------------------------------- /testdata/yaml_suite/98YD.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 5.5. Comment Indicator 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2773032 4 | tags: spec comment empty 5 | yaml: | 6 | # Comment only. 7 | tree: | 8 | +STR 9 | -STR 10 | json: '' 11 | dump: '' 12 | -------------------------------------------------------------------------------- /testdata/yaml_suite/9MAG.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Flow sequence with invalid comma at the beginning 3 | from: '@perlpunk' 4 | tags: error flow sequence 5 | fail: true 6 | yaml: | 7 | --- 8 | [ , a, b, c ] 9 | tree: | 10 | +STR 11 | +DOC --- 12 | +SEQ [] 13 | -------------------------------------------------------------------------------- /testdata/yaml_suite/ZL4Z.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Invalid nested mapping 3 | from: '@perlpunk' 4 | tags: error mapping 5 | fail: true 6 | yaml: | 7 | --- 8 | a: 'b': c 9 | tree: | 10 | +STR 11 | +DOC --- 12 | +MAP 13 | =VAL :a 14 | =VAL 'b 15 | -------------------------------------------------------------------------------- /testdata/yaml_suite/5U3A.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Sequence on same Line as Mapping Key 3 | from: '@perlpunk' 4 | tags: error sequence mapping 5 | fail: true 6 | yaml: | 7 | key: - a 8 | - b 9 | tree: | 10 | +STR 11 | +DOC 12 | +MAP 13 | =VAL :key 14 | -------------------------------------------------------------------------------- /testdata/yaml_suite/GT5M.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Node anchor in sequence 3 | from: '@perlpunk' 4 | tags: anchor error sequence 5 | fail: true 6 | yaml: | 7 | - item1 8 | &node 9 | - item2 10 | tree: | 11 | +STR 12 | +DOC 13 | +SEQ 14 | =VAL :item1 15 | -------------------------------------------------------------------------------- /testdata/yaml_suite/G7JE.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Multiline implicit keys 3 | from: '@perlpunk' 4 | tags: error mapping 5 | fail: true 6 | yaml: | 7 | a\nb: 1 8 | c 9 | d: 1 10 | tree: | 11 | +STR 12 | +DOC 13 | +MAP 14 | =VAL :a\\nb 15 | =VAL :1 16 | -------------------------------------------------------------------------------- /testdata/yaml_suite/N782.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Invalid document markers in flow style 3 | from: NimYAML tests 4 | tags: flow edge header footer error 5 | fail: true 6 | yaml: | 7 | [ 8 | --- , 9 | ... 10 | ] 11 | tree: | 12 | +STR 13 | +DOC 14 | +SEQ [] 15 | -------------------------------------------------------------------------------- /testdata/yaml_suite/236B.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Invalid value after mapping 3 | from: '@perlpunk' 4 | tags: error mapping 5 | fail: true 6 | yaml: | 7 | foo: 8 | bar 9 | invalid 10 | tree: | 11 | +STR 12 | +DOC 13 | +MAP 14 | =VAL :foo 15 | =VAL :bar 16 | -------------------------------------------------------------------------------- /testdata/yaml_suite/CQ3W.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Double quoted string without closing quote 3 | from: '@perlpunk' 4 | tags: error double 5 | fail: true 6 | yaml: | 7 | --- 8 | key: "missing closing quote 9 | tree: | 10 | +STR 11 | +DOC --- 12 | +MAP 13 | =VAL :key 14 | -------------------------------------------------------------------------------- /testdata/yaml_suite/DK4H.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Implicit key followed by newline 3 | from: '@perlpunk' 4 | tags: error flow mapping sequence 5 | fail: true 6 | yaml: | 7 | --- 8 | [ key 9 | : value ] 10 | tree: | 11 | +STR 12 | +DOC --- 13 | +SEQ [] 14 | =VAL :key 15 | -------------------------------------------------------------------------------- /testdata/yaml_suite/7LBH.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Multiline double quoted implicit keys 3 | from: '@perlpunk' 4 | tags: error double 5 | fail: true 6 | yaml: | 7 | "a\nb": 1 8 | "c 9 | d": 1 10 | tree: | 11 | +STR 12 | +DOC 13 | +MAP 14 | =VAL "a\nb 15 | =VAL :1 16 | -------------------------------------------------------------------------------- /testdata/yaml_suite/QB6E.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Wrong indented multiline quoted scalar 3 | from: '@perlpunk' 4 | tags: double error indent 5 | fail: true 6 | yaml: | 7 | --- 8 | quoted: "a 9 | b 10 | c" 11 | tree: | 12 | +STR 13 | +DOC --- 14 | +MAP 15 | =VAL :quoted 16 | -------------------------------------------------------------------------------- /testdata/yaml_suite/T833.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Flow mapping missing a separating comma 3 | from: '@perlpunk' 4 | tags: error flow mapping 5 | fail: true 6 | yaml: | 7 | --- 8 | { 9 | foo: 1 10 | bar: 2 } 11 | tree: | 12 | +STR 13 | +DOC --- 14 | +MAP 15 | =VAL :foo 16 | -------------------------------------------------------------------------------- /testdata/yaml_suite/ZXT5.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Implicit key followed by newline and adjacent value 3 | from: '@perlpunk' 4 | tags: error flow mapping sequence 5 | fail: true 6 | yaml: | 7 | [ "key" 8 | :value ] 9 | tree: | 10 | +STR 11 | +DOC 12 | +SEQ [] 13 | =VAL "key 14 | -------------------------------------------------------------------------------- /testdata/yaml_suite/D49Q.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Multiline single quoted implicit keys 3 | from: '@perlpunk' 4 | tags: error single mapping 5 | fail: true 6 | yaml: | 7 | 'a\nb': 1 8 | 'c 9 | d': 1 10 | tree: | 11 | +STR 12 | +DOC 13 | +MAP 14 | =VAL 'a\\nb 15 | =VAL :1 16 | -------------------------------------------------------------------------------- /testdata/yaml_suite/S4GJ.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Invalid text after block scalar indicator 3 | from: '@perlpunk' 4 | tags: error folded 5 | fail: true 6 | yaml: | 7 | --- 8 | folded: > first line 9 | second line 10 | tree: | 11 | +STR 12 | +DOC --- 13 | +MAP 14 | =VAL :folded 15 | -------------------------------------------------------------------------------- /testdata/yaml_suite/SR86.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Anchor plus Alias 3 | from: '@perlpunk' 4 | tags: alias error 5 | fail: true 6 | yaml: | 7 | key1: &a value 8 | key2: &b *a 9 | tree: | 10 | +STR 11 | +DOC 12 | +MAP 13 | =VAL :key1 14 | =VAL &a :value 15 | =VAL :key2 16 | -------------------------------------------------------------------------------- /testdata/yaml_suite/4UYU.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Colon in Double Quoted String 3 | from: NimYAML tests 4 | tags: mapping scalar 1.3-err 5 | yaml: | 6 | "foo: bar\": baz" 7 | tree: | 8 | +STR 9 | +DOC 10 | =VAL "foo: bar": baz 11 | -DOC 12 | -STR 13 | json: | 14 | "foo: bar\": baz" 15 | -------------------------------------------------------------------------------- /testdata/yaml_suite/GDY7.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Comment that looks like a mapping key 3 | from: '@perlpunk' 4 | tags: comment error mapping 5 | fail: true 6 | yaml: | 7 | key: value 8 | this is #not a: key 9 | tree: | 10 | +STR 11 | +DOC 12 | +MAP 13 | =VAL :key 14 | =VAL :value 15 | -------------------------------------------------------------------------------- /testdata/yaml_suite/TD5N.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Invalid scalar after sequence 3 | from: '@perlpunk' 4 | tags: error sequence scalar 5 | fail: true 6 | yaml: | 7 | - item1 8 | - item2 9 | invalid 10 | tree: | 11 | +STR 12 | +DOC 13 | +SEQ 14 | =VAL :item1 15 | =VAL :item2 16 | -------------------------------------------------------------------------------- /testdata/yaml_suite/BD7L.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Invalid mapping after sequence 3 | from: '@perlpunk' 4 | tags: error mapping sequence 5 | fail: true 6 | yaml: | 7 | - item1 8 | - item2 9 | invalid: x 10 | tree: | 11 | +STR 12 | +DOC 13 | +SEQ 14 | =VAL :item1 15 | =VAL :item2 16 | -------------------------------------------------------------------------------- /testdata/yaml_suite/G9HC.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Invalid anchor in zero indented sequence 3 | from: '@perlpunk' 4 | tags: anchor error sequence 5 | fail: true 6 | yaml: | 7 | --- 8 | seq: 9 | &anchor 10 | - a 11 | - b 12 | tree: | 13 | +STR 14 | +DOC --- 15 | +MAP 16 | =VAL :seq 17 | -------------------------------------------------------------------------------- /testdata/yaml_suite/Q5MG.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Tab at beginning of line followed by a flow mapping 3 | from: IRC 4 | tags: flow whitespace 5 | yaml: | 6 | ———»{} 7 | tree: | 8 | +STR 9 | +DOC 10 | +MAP {} 11 | -MAP 12 | -DOC 13 | -STR 14 | json: | 15 | {} 16 | dump: | 17 | {} 18 | -------------------------------------------------------------------------------- /testdata/yaml_suite/X4QW.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Comment without whitespace after block scalar indicator 3 | from: '@perlpunk' 4 | tags: folded comment error whitespace 5 | fail: true 6 | yaml: | 7 | block: ># comment 8 | scalar 9 | tree: | 10 | +STR 11 | +DOC 12 | +MAP 13 | =VAL :block 14 | -------------------------------------------------------------------------------- /testdata/yaml_suite/6CA3.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Tab indented top flow 3 | from: '@ingydotnet' 4 | tags: indent whitespace 5 | yaml: | 6 | ————»[ 7 | ————»] 8 | tree: | 9 | +STR 10 | +DOC 11 | +SEQ [] 12 | -SEQ 13 | -DOC 14 | -STR 15 | json: | 16 | [] 17 | emit: | 18 | --- [] 19 | -------------------------------------------------------------------------------- /testdata/yaml_suite/8G76.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 6.10. Comment Lines 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2780544 4 | tags: spec comment empty scalar whitespace 5 | yaml: |2 6 | # Comment 7 | ␣␣␣ 8 | ↵ 9 | ↵ 10 | tree: | 11 | +STR 12 | -STR 13 | json: '' 14 | dump: '' 15 | -------------------------------------------------------------------------------- /testdata/yaml_suite/9KBC.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Mapping starting at --- line 3 | from: https://gist.github.com/anonymous/c728390e92ec93fb371ac77f21435cca via @ingydotnet 4 | tags: error header mapping 5 | fail: true 6 | yaml: | 7 | --- key1: value1 8 | key2: value2 9 | tree: | 10 | +STR 11 | +DOC --- 12 | -------------------------------------------------------------------------------- /testdata/yaml_suite/CTN5.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Flow sequence with invalid extra comma 3 | from: '@perlpunk' 4 | tags: error flow sequence 5 | fail: true 6 | yaml: | 7 | --- 8 | [ a, b, c, , ] 9 | tree: | 10 | +STR 11 | +DOC --- 12 | +SEQ [] 13 | =VAL :a 14 | =VAL :b 15 | =VAL :c 16 | -------------------------------------------------------------------------------- /testdata/yaml_suite/52DL.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Explicit Non-Specific Tag [1.3] 3 | from: 8MK2, modified for YAML 1.3 4 | tags: tag 1.3-mod 5 | yaml: | 6 | --- 7 | ! a 8 | tree: | 9 | +STR 10 | +DOC --- 11 | =VAL :a 12 | -DOC 13 | -STR 14 | json: | 15 | "a" 16 | dump: | 17 | --- ! a 18 | -------------------------------------------------------------------------------- /testdata/yaml_suite/K54U.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Tab after document header 3 | from: '@perlpunk' 4 | tags: header whitespace 5 | yaml: | 6 | ---»scalar 7 | tree: | 8 | +STR 9 | +DOC --- 10 | =VAL :scalar 11 | -DOC 12 | -STR 13 | json: | 14 | "scalar" 15 | dump: | 16 | --- scalar 17 | ... 18 | -------------------------------------------------------------------------------- /testdata/yaml_suite/SU5Z.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Comment without whitespace after doublequoted scalar 3 | from: '@perlpunk' 4 | tags: comment error double whitespace 5 | fail: true 6 | yaml: | 7 | key: "value"# invalid comment 8 | tree: | 9 | +STR 10 | +DOC 11 | +MAP 12 | =VAL :key 13 | =VAL "value 14 | -------------------------------------------------------------------------------- /testdata/yaml_suite/CVW2.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Invalid comment after comma 3 | from: '@perlpunk' 4 | tags: comment error flow sequence 5 | fail: true 6 | yaml: | 7 | --- 8 | [ a, b, c,#invalid 9 | ] 10 | tree: | 11 | +STR 12 | +DOC --- 13 | +SEQ [] 14 | =VAL :a 15 | =VAL :b 16 | =VAL :c 17 | -------------------------------------------------------------------------------- /testdata/yaml_suite/HRE5.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Double quoted scalar with escaped single quote 3 | from: https://github.com/yaml/libyaml/issues/68 4 | tags: double error single 5 | fail: true 6 | yaml: | 7 | --- 8 | double: "quoted \' scalar" 9 | tree: | 10 | +STR 11 | +DOC --- 12 | +MAP 13 | =VAL :double 14 | -------------------------------------------------------------------------------- /testdata/yaml_suite/RHX7.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: YAML directive without document end marker 3 | from: '@perlpunk' 4 | tags: directive error 5 | fail: true 6 | yaml: | 7 | --- 8 | key: value 9 | %YAML 1.2 10 | --- 11 | tree: | 12 | +STR 13 | +DOC --- 14 | +MAP 15 | =VAL :key 16 | =VAL :value 17 | -------------------------------------------------------------------------------- /testdata/yaml_suite/SU74.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Anchor and alias as mapping key 3 | from: '@perlpunk' 4 | tags: error anchor alias mapping 5 | fail: true 6 | yaml: | 7 | key1: &alias value1 8 | &b *alias : value2 9 | tree: | 10 | +STR 11 | +DOC 12 | +MAP 13 | =VAL :key1 14 | =VAL &alias :value1 15 | -------------------------------------------------------------------------------- /testdata/yaml_suite/ZCZ6.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Invalid mapping in plain single line value 3 | from: https://gist.github.com/anonymous/0c8db51d151baf8113205ba3ce71d1b4 via @ingydotnet 4 | tags: error mapping scalar 5 | fail: true 6 | yaml: | 7 | a: b: c: d 8 | tree: | 9 | +STR 10 | +DOC 11 | +MAP 12 | =VAL :a 13 | -------------------------------------------------------------------------------- /testdata/yaml_suite/ZVH3.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Wrong indented sequence item 3 | from: '@perlpunk' 4 | tags: error sequence indent 5 | fail: true 6 | yaml: | 7 | - key: value 8 | - item1 9 | tree: | 10 | +STR 11 | +DOC 12 | +SEQ 13 | +MAP 14 | =VAL :key 15 | =VAL :value 16 | -MAP 17 | -------------------------------------------------------------------------------- /testdata/yaml_suite/9C9N.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Wrong indented flow sequence 3 | from: '@perlpunk' 4 | tags: error flow indent sequence 5 | fail: true 6 | yaml: | 7 | --- 8 | flow: [a, 9 | b, 10 | c] 11 | tree: | 12 | +STR 13 | +DOC --- 14 | +MAP 15 | =VAL :flow 16 | +SEQ [] 17 | =VAL :a 18 | -------------------------------------------------------------------------------- /testdata/yaml_suite/NHX8.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Empty Lines at End of Document 3 | from: NimYAML tests 4 | tags: empty-key whitespace 5 | yaml: | 6 | : 7 | ↵ 8 | ↵ 9 | tree: | 10 | +STR 11 | +DOC 12 | +MAP 13 | =VAL : 14 | =VAL : 15 | -MAP 16 | -DOC 17 | -STR 18 | emit: | 19 | : 20 | -------------------------------------------------------------------------------- /testdata/yaml_suite/7MNF.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Missing colon 3 | from: '@perlpunk' 4 | tags: error mapping 5 | fail: true 6 | yaml: | 7 | top1: 8 | key1: val1 9 | top2 10 | tree: | 11 | +STR 12 | +DOC 13 | +MAP 14 | =VAL :top1 15 | +MAP 16 | =VAL :key1 17 | =VAL :val1 18 | -MAP 19 | -------------------------------------------------------------------------------- /testdata/yaml_suite/BS4K.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Comment between plain scalar lines 3 | from: https://gist.github.com/anonymous/269f16d582fdd30a7dcf8c9249c5da7f via @ingydotnet 4 | tags: error scalar 5 | fail: true 6 | yaml: | 7 | word1 # comment 8 | word2 9 | tree: | 10 | +STR 11 | +DOC 12 | =VAL :word1 13 | -DOC 14 | -------------------------------------------------------------------------------- /testdata/yaml_suite/EB22.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Missing document-end marker before directive 3 | from: '@perlpunk' 4 | tags: error directive footer 5 | fail: true 6 | yaml: | 7 | --- 8 | scalar1 # comment 9 | %YAML 1.2 10 | --- 11 | scalar2 12 | tree: | 13 | +STR 14 | +DOC --- 15 | =VAL :scalar1 16 | -DOC 17 | -------------------------------------------------------------------------------- /testdata/yaml_suite/4EJS.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Invalid tabs as indendation in a mapping 3 | from: https://github.com/nodeca/js-yaml/issues/80 4 | tags: error mapping whitespace 5 | fail: true 6 | yaml: | 7 | --- 8 | a: 9 | ———»b: 10 | ———»———»c: value 11 | tree: | 12 | +STR 13 | +DOC --- 14 | +MAP 15 | =VAL :a 16 | -------------------------------------------------------------------------------- /testdata/yaml_suite/5LLU.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Block scalar with wrong indented line after spaces only 3 | from: '@perlpunk' 4 | tags: error folded whitespace 5 | fail: true 6 | yaml: | 7 | block scalar: > 8 | ␣ 9 | ␣␣ 10 | ␣␣␣ 11 | invalid 12 | tree: | 13 | +STR 14 | +DOC 15 | +MAP 16 | =VAL :block scalar 17 | -------------------------------------------------------------------------------- /testdata/yaml_suite/9HCY.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Need document footer before directives 3 | from: '@ingydotnet' 4 | tags: directive error footer tag unknown-tag 5 | fail: true 6 | yaml: | 7 | !foo "bar" 8 | %TAG ! tag:example.com,2000:app/ 9 | --- 10 | !foo "bar" 11 | tree: | 12 | +STR 13 | +DOC 14 | =VAL "bar 15 | -------------------------------------------------------------------------------- /testdata/yaml_suite/3HFZ.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Invalid content after document end marker 3 | from: '@perlpunk' 4 | tags: error footer 5 | fail: true 6 | yaml: | 7 | --- 8 | key: value 9 | ... invalid 10 | tree: | 11 | +STR 12 | +DOC --- 13 | +MAP 14 | =VAL :key 15 | =VAL :value 16 | -MAP 17 | -DOC ... 18 | -------------------------------------------------------------------------------- /testdata/yaml_suite/DMG6.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Wrong indendation in Map 3 | from: '@perlpunk' 4 | tags: error mapping indent 5 | fail: true 6 | yaml: | 7 | key: 8 | ok: 1 9 | wrong: 2 10 | tree: | 11 | +STR 12 | +DOC 13 | +MAP 14 | =VAL :key 15 | +MAP 16 | =VAL :ok 17 | =VAL :1 18 | -MAP 19 | -------------------------------------------------------------------------------- /testdata/yaml_suite/KS4U.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Invalid item after end of flow sequence 3 | from: '@perlpunk' 4 | tags: error flow sequence 5 | fail: true 6 | yaml: | 7 | --- 8 | [ 9 | sequence item 10 | ] 11 | invalid item 12 | tree: | 13 | +STR 14 | +DOC --- 15 | +SEQ [] 16 | =VAL :sequence item 17 | -SEQ 18 | -------------------------------------------------------------------------------- /testdata/yaml_suite/2JQS.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Block Mapping with Missing Keys 3 | from: NimYAML tests 4 | tags: duplicate-key mapping empty-key 5 | yaml: | 6 | : a 7 | : b 8 | tree: | 9 | +STR 10 | +DOC 11 | +MAP 12 | =VAL : 13 | =VAL :a 14 | =VAL : 15 | =VAL :b 16 | -MAP 17 | -DOC 18 | -STR 19 | -------------------------------------------------------------------------------- /testdata/yaml_suite/4H7K.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Flow sequence with invalid extra closing bracket 3 | from: '@perlpunk' 4 | tags: error flow sequence 5 | fail: true 6 | yaml: | 7 | --- 8 | [ a, b, c ] ] 9 | tree: | 10 | +STR 11 | +DOC --- 12 | +SEQ 13 | =VAL :a 14 | =VAL :b 15 | =VAL :c 16 | -SEQ 17 | -DOC 18 | -------------------------------------------------------------------------------- /testdata/yaml_suite/82AN.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Three dashes and content without space 3 | from: '@perlpunk' 4 | tags: scalar 1.3-err 5 | yaml: | 6 | ---word1 7 | word2 8 | tree: | 9 | +STR 10 | +DOC 11 | =VAL :---word1 word2 12 | -DOC 13 | -STR 14 | json: | 15 | "---word1 word2" 16 | dump: | 17 | '---word1 word2' 18 | -------------------------------------------------------------------------------- /testdata/yaml_suite/9JBA.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Invalid comment after end of flow sequence 3 | from: '@perlpunk' 4 | tags: comment error flow sequence 5 | fail: true 6 | yaml: | 7 | --- 8 | [ a, b, c, ]#invalid 9 | tree: | 10 | +STR 11 | +DOC --- 12 | +SEQ [] 13 | =VAL :a 14 | =VAL :b 15 | =VAL :c 16 | -SEQ 17 | -------------------------------------------------------------------------------- /testdata/yaml_suite/BF9H.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Trailing comment in multiline plain scalar 3 | from: '@perlpunk' 4 | tags: comment error scalar 5 | fail: true 6 | yaml: | 7 | --- 8 | plain: a 9 | b # end of scalar 10 | c 11 | tree: | 12 | +STR 13 | +DOC --- 14 | +MAP 15 | =VAL :plain 16 | =VAL :a b 17 | -------------------------------------------------------------------------------- /testdata/yaml_suite/6JTT.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Flow sequence without closing bracket 3 | from: '@perlpunk' 4 | tags: error flow sequence 5 | fail: true 6 | yaml: | 7 | --- 8 | [ [ a, b, c ] 9 | tree: | 10 | +STR 11 | +DOC --- 12 | +SEQ [] 13 | +SEQ [] 14 | =VAL :a 15 | =VAL :b 16 | =VAL :c 17 | -SEQ 18 | -------------------------------------------------------------------------------- /testdata/yaml_suite/HU3P.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Invalid Mapping in plain scalar 3 | from: https://gist.github.com/anonymous/d305fd8e54cfe7a484088c91a8a2e533 via @ingydotnet 4 | tags: error mapping scalar 5 | fail: true 6 | yaml: | 7 | key: 8 | word1 word2 9 | no: key 10 | tree: | 11 | +STR 12 | +DOC 13 | +MAP 14 | =VAL :key 15 | -------------------------------------------------------------------------------- /testdata/yaml_suite/P2EQ.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Invalid sequene item on same line as previous item 3 | from: '@perlpunk' 4 | tags: error flow mapping sequence 5 | fail: true 6 | yaml: | 7 | --- 8 | - { y: z }- invalid 9 | tree: | 10 | +STR 11 | +DOC --- 12 | +SEQ 13 | +MAP {} 14 | =VAL :y 15 | =VAL :z 16 | -MAP 17 | -------------------------------------------------------------------------------- /testdata/yaml_suite/S7BG.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Colon followed by comma 3 | from: '@perlpunk' 4 | tags: scalar 5 | yaml: | 6 | --- 7 | - :, 8 | tree: | 9 | +STR 10 | +DOC --- 11 | +SEQ 12 | =VAL ::, 13 | -SEQ 14 | -DOC 15 | -STR 16 | json: | 17 | [ 18 | ":," 19 | ] 20 | dump: | 21 | --- 22 | - :, 23 | -------------------------------------------------------------------------------- /testdata/yaml_suite/4GC6.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 7.7. Single Quoted Characters 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2788307 4 | tags: spec scalar 1.3-err 5 | yaml: | 6 | 'here''s to "quotes"' 7 | tree: | 8 | +STR 9 | +DOC 10 | =VAL 'here's to "quotes" 11 | -DOC 12 | -STR 13 | json: | 14 | "here's to \"quotes\"" 15 | -------------------------------------------------------------------------------- /testdata/yaml_suite/6S55.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Invalid scalar at the end of sequence 3 | from: '@perlpunk' 4 | tags: error mapping sequence 5 | fail: true 6 | yaml: | 7 | key: 8 | - bar 9 | - baz 10 | invalid 11 | tree: | 12 | +STR 13 | +DOC 14 | +MAP 15 | =VAL :key 16 | +SEQ 17 | =VAL :bar 18 | =VAL :baz 19 | -------------------------------------------------------------------------------- /testdata/yaml_suite/6XDY.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Two document start markers 3 | from: '@perlpunk' 4 | tags: header 5 | yaml: | 6 | --- 7 | --- 8 | tree: | 9 | +STR 10 | +DOC --- 11 | =VAL : 12 | -DOC 13 | +DOC --- 14 | =VAL : 15 | -DOC 16 | -STR 17 | json: | 18 | null 19 | null 20 | dump: | 21 | --- 22 | --- 23 | -------------------------------------------------------------------------------- /testdata/yaml_suite/H7J7.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Node anchor not indented 3 | from: https://gist.github.com/anonymous/f192e7dab6da31831f264dbf1947cb83 via @ingydotnet 4 | tags: anchor error indent tag 5 | fail: true 6 | yaml: | 7 | key: &x 8 | !!map 9 | a: b 10 | tree: | 11 | +STR 12 | +DOC 13 | +MAP 14 | =VAL :key 15 | =VAL &x : 16 | -------------------------------------------------------------------------------- /testdata/yaml_suite/27NA.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 5.9. Directive Indicator 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2774058 4 | tags: spec directive 1.3-err 5 | yaml: | 6 | %YAML 1.2 7 | --- text 8 | tree: | 9 | +STR 10 | +DOC --- 11 | =VAL :text 12 | -DOC 13 | -STR 14 | json: | 15 | "text" 16 | dump: | 17 | --- text 18 | -------------------------------------------------------------------------------- /testdata/yaml_suite/58MP.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Flow mapping edge cases 3 | from: '@ingydotnet' 4 | tags: edge flow mapping 5 | yaml: | 6 | {x: :x} 7 | tree: | 8 | +STR 9 | +DOC 10 | +MAP {} 11 | =VAL :x 12 | =VAL ::x 13 | -MAP 14 | -DOC 15 | -STR 16 | json: | 17 | { 18 | "x": ":x" 19 | } 20 | dump: | 21 | x: :x 22 | -------------------------------------------------------------------------------- /testdata/yaml_suite/62EZ.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Invalid block mapping key on same line as previous key 3 | from: '@perlpunk' 4 | tags: error flow mapping 5 | fail: true 6 | yaml: | 7 | --- 8 | x: { y: z }in: valid 9 | tree: | 10 | +STR 11 | +DOC --- 12 | +MAP 13 | =VAL :x 14 | +MAP {} 15 | =VAL :y 16 | =VAL :z 17 | -MAP 18 | -------------------------------------------------------------------------------- /testdata/yaml_suite/65WH.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Single Entry Block Sequence 3 | from: https://github.com/ingydotnet/yaml-pegex-pm/blob/master/test/sequence.tml 4 | tags: sequence 5 | yaml: | 6 | - foo 7 | tree: | 8 | +STR 9 | +DOC 10 | +SEQ 11 | =VAL :foo 12 | -SEQ 13 | -DOC 14 | -STR 15 | json: | 16 | [ 17 | "foo" 18 | ] 19 | -------------------------------------------------------------------------------- /testdata/yaml_suite/MYW6.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Block Scalar Strip 3 | from: NimYAML tests 4 | tags: literal scalar whitespace 1.3-err 5 | yaml: | 6 | |- 7 | ab 8 | ␣ 9 | ␣ 10 | ... 11 | tree: | 12 | +STR 13 | +DOC 14 | =VAL |ab 15 | -DOC ... 16 | -STR 17 | json: | 18 | "ab" 19 | dump: | 20 | |- 21 | ab 22 | ... 23 | -------------------------------------------------------------------------------- /testdata/yaml_suite/S98Z.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Block scalar with more spaces than first content line 3 | from: '@perlpunk' 4 | tags: error folded comment scalar whitespace 5 | fail: true 6 | yaml: | 7 | empty block scalar: > 8 | ␣ 9 | ␣␣ 10 | ␣␣␣ 11 | # comment 12 | tree: | 13 | +STR 14 | +DOC 15 | +MAP 16 | =VAL :empty block scalar 17 | -------------------------------------------------------------------------------- /testdata/yaml_suite/8XDJ.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Comment in plain multiline value 3 | from: https://gist.github.com/anonymous/deeb1ace28d5bf21fb56d80c13e2dc69 via @ingydotnet 4 | tags: error comment scalar 5 | fail: true 6 | yaml: | 7 | key: word1 8 | # xxx 9 | word2 10 | tree: | 11 | +STR 12 | +DOC 13 | +MAP 14 | =VAL :key 15 | =VAL :word1 16 | -------------------------------------------------------------------------------- /testdata/yaml_suite/4HVU.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Wrong indendation in Sequence 3 | from: '@perlpunk' 4 | tags: error sequence indent 5 | fail: true 6 | yaml: | 7 | key: 8 | - ok 9 | - also ok 10 | - wrong 11 | tree: | 12 | +STR 13 | +DOC 14 | +MAP 15 | =VAL :key 16 | +SEQ 17 | =VAL :ok 18 | =VAL :also ok 19 | -SEQ 20 | -------------------------------------------------------------------------------- /testdata/yaml_suite/U44R.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Bad indentation in mapping (2) 3 | from: '@perlpunk' 4 | tags: error mapping indent double 5 | fail: true 6 | yaml: | 7 | map: 8 | key1: "quoted1" 9 | key2: "bad indentation" 10 | tree: | 11 | +STR 12 | +DOC 13 | +MAP 14 | =VAL :map 15 | +MAP 16 | =VAL :key1 17 | =VAL "quoted1 18 | -------------------------------------------------------------------------------- /testdata/yaml_suite/W9L4.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Literal block scalar with more spaces in first line 3 | from: '@perlpunk' 4 | tags: error literal whitespace 5 | fail: true 6 | yaml: | 7 | --- 8 | block scalar: | 9 | ␣␣␣␣␣ 10 | more spaces at the beginning 11 | are invalid 12 | tree: | 13 | +STR 14 | +DOC --- 15 | +MAP 16 | =VAL :block scalar 17 | -------------------------------------------------------------------------------- /testdata/yaml_suite/9CWY.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Invalid scalar at the end of mapping 3 | from: '@perlpunk' 4 | tags: error mapping sequence 5 | fail: true 6 | yaml: | 7 | key: 8 | - item1 9 | - item2 10 | invalid 11 | tree: | 12 | +STR 13 | +DOC 14 | +MAP 15 | =VAL :key 16 | +SEQ 17 | =VAL :item1 18 | =VAL :item2 19 | -SEQ 20 | -------------------------------------------------------------------------------- /testdata/yaml_suite/3R3P.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Single block sequence with anchor 3 | from: '@perlpunk' 4 | tags: anchor sequence 5 | yaml: | 6 | &sequence 7 | - a 8 | tree: | 9 | +STR 10 | +DOC 11 | +SEQ &sequence 12 | =VAL :a 13 | -SEQ 14 | -DOC 15 | -STR 16 | json: | 17 | [ 18 | "a" 19 | ] 20 | dump: | 21 | &sequence 22 | - a 23 | -------------------------------------------------------------------------------- /testdata/yaml_suite/9YRD.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Multiline Scalar at Top Level 3 | from: NimYAML tests 4 | tags: scalar whitespace 1.3-err 5 | yaml: | 6 | a 7 | b␣␣ 8 | c 9 | d 10 | 11 | e 12 | tree: | 13 | +STR 14 | +DOC 15 | =VAL :a b c d\ne 16 | -DOC 17 | -STR 18 | json: | 19 | "a b c d\ne" 20 | dump: | 21 | 'a b c d 22 | 23 | e' 24 | -------------------------------------------------------------------------------- /testdata/yaml_suite/CML9.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Missing comma in flow 3 | from: ihttps://gist.github.com/anonymous/4ba3365607cc14b4f656e391b45bf4f4 via @ingydotnet 4 | tags: error flow comment 5 | fail: true 6 | yaml: | 7 | key: [ word1 8 | # xxx 9 | word2 ] 10 | tree: | 11 | +STR 12 | +DOC 13 | +MAP 14 | =VAL :key 15 | +SEQ [] 16 | =VAL :word1 17 | -------------------------------------------------------------------------------- /testdata/yaml_suite/N4JP.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Bad indentation in mapping 3 | from: '@perlpunk' 4 | tags: error mapping indent double 5 | fail: true 6 | yaml: | 7 | map: 8 | key1: "quoted1" 9 | key2: "bad indentation" 10 | tree: | 11 | +STR 12 | +DOC 13 | +MAP 14 | =VAL :map 15 | +MAP 16 | =VAL :key1 17 | =VAL "quoted1 18 | -MAP 19 | -------------------------------------------------------------------------------- /testdata/yaml_suite/753E.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Block Scalar Strip [1.3] 3 | from: MYW6, modified for YAML 1.3 4 | tags: literal scalar 1.3-mod whitespace 5 | yaml: | 6 | --- |- 7 | ab 8 | ␣ 9 | ␣ 10 | ... 11 | tree: | 12 | +STR 13 | +DOC --- 14 | =VAL |ab 15 | -DOC ... 16 | -STR 17 | json: | 18 | "ab" 19 | dump: | 20 | --- |- 21 | ab 22 | ... 23 | -------------------------------------------------------------------------------- /testdata/yaml_suite/FP8R.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Zero indented block scalar 3 | from: '@perlpunk' 4 | tags: folded indent scalar 5 | yaml: | 6 | --- > 7 | line1 8 | line2 9 | line3 10 | tree: | 11 | +STR 12 | +DOC --- 13 | =VAL >line1 line2 line3\n 14 | -DOC 15 | -STR 16 | json: | 17 | "line1 line2 line3\n" 18 | dump: | 19 | --- > 20 | line1 line2 line3 21 | -------------------------------------------------------------------------------- /testdata/yaml_suite/Q4CL.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Trailing content after quoted value 3 | from: '@perlpunk' 4 | tags: error mapping double 5 | fail: true 6 | yaml: | 7 | key1: "quoted1" 8 | key2: "quoted2" trailing content 9 | key3: "quoted3" 10 | tree: | 11 | +STR 12 | +DOC 13 | +MAP 14 | =VAL :key1 15 | =VAL "quoted1 16 | =VAL :key2 17 | =VAL "quoted2 18 | -------------------------------------------------------------------------------- /testdata/yaml_suite/XLQ9.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Multiline scalar that looks like a YAML directive 3 | from: '@perlpunk' 4 | tags: directive scalar 5 | yaml: | 6 | --- 7 | scalar 8 | %YAML 1.2 9 | tree: | 10 | +STR 11 | +DOC --- 12 | =VAL :scalar %YAML 1.2 13 | -DOC 14 | -STR 15 | json: | 16 | "scalar %YAML 1.2" 17 | dump: | 18 | --- scalar %YAML 1.2 19 | ... 20 | -------------------------------------------------------------------------------- /testdata/yaml_suite/4V8U.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Plain scalar with backslashes 3 | from: '@perlpunk' 4 | tags: scalar 5 | yaml: | 6 | --- 7 | plain\value\with\backslashes 8 | tree: | 9 | +STR 10 | +DOC --- 11 | =VAL :plain\\value\\with\\backslashes 12 | -DOC 13 | -STR 14 | json: | 15 | "plain\\value\\with\\backslashes" 16 | dump: | 17 | --- plain\value\with\backslashes 18 | -------------------------------------------------------------------------------- /testdata/yaml_suite/D9TU.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Single Pair Block Mapping 3 | from: https://github.com/ingydotnet/yaml-pegex-pm/blob/master/test/mapping.tml 4 | tags: simple mapping 5 | yaml: | 6 | foo: bar 7 | tree: | 8 | +STR 9 | +DOC 10 | +MAP 11 | =VAL :foo 12 | =VAL :bar 13 | -MAP 14 | -DOC 15 | -STR 16 | json: | 17 | { 18 | "foo": "bar" 19 | } 20 | -------------------------------------------------------------------------------- /testdata/yaml_suite/JY7Z.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Trailing content that looks like a mapping 3 | from: '@perlpunk' 4 | tags: error mapping double 5 | fail: true 6 | yaml: | 7 | key1: "quoted1" 8 | key2: "quoted2" no key: nor value 9 | key3: "quoted3" 10 | tree: | 11 | +STR 12 | +DOC 13 | +MAP 14 | =VAL :key1 15 | =VAL "quoted1 16 | =VAL :key2 17 | =VAL "quoted2 18 | -------------------------------------------------------------------------------- /testdata/yaml_suite/6H3V.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Backslashes in singlequotes 3 | from: '@perlpunk' 4 | tags: scalar single 5 | yaml: | 6 | 'foo: bar\': baz' 7 | tree: | 8 | +STR 9 | +DOC 10 | +MAP 11 | =VAL 'foo: bar\\ 12 | =VAL :baz' 13 | -MAP 14 | -DOC 15 | -STR 16 | json: | 17 | { 18 | "foo: bar\\": "baz'" 19 | } 20 | dump: | 21 | 'foo: bar\': baz' 22 | -------------------------------------------------------------------------------- /testdata/yaml_suite/LX3P.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Implicit Flow Mapping Key on one line 3 | from: '@perlpunk' 4 | tags: complex-key mapping flow sequence 1.3-err 5 | yaml: | 6 | [flow]: block 7 | tree: | 8 | +STR 9 | +DOC 10 | +MAP 11 | +SEQ [] 12 | =VAL :flow 13 | -SEQ 14 | =VAL :block 15 | -MAP 16 | -DOC 17 | -STR 18 | dump: | 19 | ? - flow 20 | : block 21 | -------------------------------------------------------------------------------- /testdata/yaml_suite/S4T7.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Document with footer 3 | from: https://github.com/ingydotnet/yaml-pegex-pm/blob/master/test/footer.tml 4 | tags: mapping footer 5 | yaml: | 6 | aaa: bbb 7 | ... 8 | tree: | 9 | +STR 10 | +DOC 11 | +MAP 12 | =VAL :aaa 13 | =VAL :bbb 14 | -MAP 15 | -DOC ... 16 | -STR 17 | json: | 18 | { 19 | "aaa": "bbb" 20 | } 21 | -------------------------------------------------------------------------------- /testdata/yaml_suite/ZH7C.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Anchors in Mapping 3 | from: NimYAML tests 4 | tags: anchor mapping 5 | yaml: | 6 | &a a: b 7 | c: &d d 8 | tree: | 9 | +STR 10 | +DOC 11 | +MAP 12 | =VAL &a :a 13 | =VAL :b 14 | =VAL :c 15 | =VAL &d :d 16 | -MAP 17 | -DOC 18 | -STR 19 | json: | 20 | { 21 | "a": "b", 22 | "c": "d" 23 | } 24 | -------------------------------------------------------------------------------- /testdata/yaml_suite/3UYS.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Escaped slash in double quotes 3 | from: '@perlpunk' 4 | tags: double 5 | yaml: | 6 | escaped slash: "a\/b" 7 | tree: | 8 | +STR 9 | +DOC 10 | +MAP 11 | =VAL :escaped slash 12 | =VAL "a/b 13 | -MAP 14 | -DOC 15 | -STR 16 | json: | 17 | { 18 | "escaped slash": "a/b" 19 | } 20 | dump: | 21 | escaped slash: "a/b" 22 | -------------------------------------------------------------------------------- /testdata/yaml_suite/SSW6.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 7.7. Single Quoted Characters [1.3] 3 | from: 4GC6, modified for YAML 1.3 4 | tags: spec scalar single 1.3-mod 5 | yaml: | 6 | --- 7 | 'here''s to "quotes"' 8 | tree: | 9 | +STR 10 | +DOC --- 11 | =VAL 'here's to "quotes" 12 | -DOC 13 | -STR 14 | json: | 15 | "here's to \"quotes\"" 16 | dump: | 17 | --- 'here''s to "quotes"' 18 | -------------------------------------------------------------------------------- /testdata/yaml_suite/6M2F.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Aliases in Explicit Block Mapping 3 | from: NimYAML tests 4 | tags: alias explicit-key empty-key 5 | yaml: | 6 | ? &a a 7 | : &b b 8 | : *a 9 | tree: | 10 | +STR 11 | +DOC 12 | +MAP 13 | =VAL &a :a 14 | =VAL &b :b 15 | =VAL : 16 | =ALI *a 17 | -MAP 18 | -DOC 19 | -STR 20 | dump: | 21 | &a a: &b b 22 | : *a 23 | -------------------------------------------------------------------------------- /testdata/yaml_suite/BEC7.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 6.14. “YAML” directive 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2781929 4 | tags: spec directive 5 | yaml: | 6 | %YAML 1.3 # Attempt parsing 7 | # with a warning 8 | --- 9 | "foo" 10 | tree: | 11 | +STR 12 | +DOC --- 13 | =VAL "foo 14 | -DOC 15 | -STR 16 | json: | 17 | "foo" 18 | dump: | 19 | --- "foo" 20 | -------------------------------------------------------------------------------- /testdata/yaml_suite/L383.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Two scalar docs with trailing comments 3 | from: '@ingydotnet' 4 | tags: comment 5 | yaml: | 6 | --- foo # comment 7 | --- foo # comment 8 | tree: | 9 | +STR 10 | +DOC --- 11 | =VAL :foo 12 | -DOC 13 | +DOC --- 14 | =VAL :foo 15 | -DOC 16 | -STR 17 | json: | 18 | "foo" 19 | "foo" 20 | dump: | 21 | --- foo 22 | --- foo 23 | -------------------------------------------------------------------------------- /testdata/yaml_suite/4JVG.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Scalar value with two anchors 3 | from: '@perlpunk' 4 | tags: anchor error mapping 5 | fail: true 6 | yaml: | 7 | top1: &node1 8 | &k1 key1: val1 9 | top2: &node2 10 | &v2 val2 11 | tree: | 12 | +STR 13 | +DOC 14 | +MAP 15 | =VAL :top1 16 | +MAP &node1 17 | =VAL &k1 :key1 18 | =VAL :val1 19 | -MAP 20 | =VAL :top2 21 | -------------------------------------------------------------------------------- /testdata/yaml_suite/EXG3.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Three dashes and content without space [1.3] 3 | from: 82AN, modified for YAML 1.3 4 | tags: scalar 1.3-mod 5 | yaml: | 6 | --- 7 | ---word1 8 | word2 9 | tree: | 10 | +STR 11 | +DOC --- 12 | =VAL :---word1 word2 13 | -DOC 14 | -STR 15 | json: | 16 | "---word1 word2" 17 | dump: | 18 | '---word1 word2' 19 | emit: | 20 | --- '---word1 word2' 21 | -------------------------------------------------------------------------------- /testdata/yaml_suite/G992.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 8.9. Folded Scalar 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2796371 4 | tags: spec folded scalar 1.3-err 5 | yaml: | 6 | > 7 | folded 8 | text 9 | ↵ 10 | ↵ 11 | tree: | 12 | +STR 13 | +DOC 14 | =VAL >folded text\n 15 | -DOC 16 | -STR 17 | json: | 18 | "folded text\n" 19 | dump: | 20 | > 21 | folded text 22 | -------------------------------------------------------------------------------- /testdata/yaml_suite/RTP8.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 9.2. Document Markers 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2800866 4 | tags: spec header footer 5 | yaml: | 6 | %YAML 1.2 7 | --- 8 | Document 9 | ... # Suffix 10 | tree: | 11 | +STR 12 | +DOC --- 13 | =VAL :Document 14 | -DOC ... 15 | -STR 16 | json: | 17 | "Document" 18 | dump: | 19 | --- Document 20 | ... 21 | -------------------------------------------------------------------------------- /testdata/yaml_suite/U3C3.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 6.16. “TAG” directive 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2782252 4 | tags: spec header tag 5 | yaml: | 6 | %TAG !yaml! tag:yaml.org,2002: 7 | --- 8 | !yaml!str "foo" 9 | tree: | 10 | +STR 11 | +DOC --- 12 | =VAL "foo 13 | -DOC 14 | -STR 15 | json: | 16 | "foo" 17 | dump: | 18 | --- !!str "foo" 19 | -------------------------------------------------------------------------------- /yamlx_test.go: -------------------------------------------------------------------------------- 1 | package yaml_test 2 | 3 | import ( 4 | "io" 5 | "testing" 6 | "testing/iotest" 7 | ) 8 | 9 | func testReader(t *testing.T, test func(wrap func(io.Reader) io.Reader) func(t *testing.T)) { 10 | t.Run("Plain", test(func(r io.Reader) io.Reader { return r })) 11 | t.Run("OneByteReader", test(iotest.OneByteReader)) 12 | t.Run("DataErrReader", test(iotest.DataErrReader)) 13 | t.Run("HalfReader", test(iotest.HalfReader)) 14 | } 15 | -------------------------------------------------------------------------------- /testdata/yaml_suite/FTA2.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Single block sequence with anchor and explicit document start 3 | from: '@perlpunk' 4 | tags: anchor header sequence 5 | yaml: | 6 | --- &sequence 7 | - a 8 | tree: | 9 | +STR 10 | +DOC --- 11 | +SEQ &sequence 12 | =VAL :a 13 | -SEQ 14 | -DOC 15 | -STR 16 | json: | 17 | [ 18 | "a" 19 | ] 20 | dump: | 21 | --- &sequence 22 | - a 23 | -------------------------------------------------------------------------------- /testdata/yaml_suite/Y2GN.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Anchor with colon in the middle 3 | from: '@perlpunk' 4 | tags: anchor 5 | yaml: | 6 | --- 7 | key: &an:chor value 8 | tree: | 9 | +STR 10 | +DOC --- 11 | +MAP 12 | =VAL :key 13 | =VAL &an:chor :value 14 | -MAP 15 | -DOC 16 | -STR 17 | json: | 18 | { 19 | "key": "value" 20 | } 21 | dump: | 22 | --- 23 | key: &an:chor value 24 | -------------------------------------------------------------------------------- /testdata/yaml_suite/3MYT.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Plain Scalar looking like key, comment, anchor and tag 3 | from: https://gist.github.com/anonymous/a98d50ce42a59b1e999552bea7a31f57 via @ingydotnet 4 | tags: scalar 5 | yaml: | 6 | --- 7 | k:#foo 8 | &a !t s 9 | tree: | 10 | +STR 11 | +DOC --- 12 | =VAL :k:#foo &a !t s 13 | -DOC 14 | -STR 15 | json: | 16 | "k:#foo &a !t s" 17 | dump: | 18 | --- k:#foo &a !t s 19 | -------------------------------------------------------------------------------- /testdata/yaml_suite/5MUD.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Colon and adjacent value on next line 3 | from: '@perlpunk' 4 | tags: double flow mapping 5 | yaml: | 6 | --- 7 | { "foo" 8 | :bar } 9 | tree: | 10 | +STR 11 | +DOC --- 12 | +MAP {} 13 | =VAL "foo 14 | =VAL :bar 15 | -MAP 16 | -DOC 17 | -STR 18 | json: | 19 | { 20 | "foo": "bar" 21 | } 22 | dump: | 23 | --- 24 | "foo": bar 25 | -------------------------------------------------------------------------------- /testdata/yaml_suite/CPZ3.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Doublequoted scalar starting with a tab 3 | from: '@perlpunk' 4 | tags: double scalar 5 | yaml: | 6 | --- 7 | tab: "\tstring" 8 | tree: | 9 | +STR 10 | +DOC --- 11 | +MAP 12 | =VAL :tab 13 | =VAL "\tstring 14 | -MAP 15 | -DOC 16 | -STR 17 | json: | 18 | { 19 | "tab": "\tstring" 20 | } 21 | dump: | 22 | --- 23 | tab: "\tstring" 24 | -------------------------------------------------------------------------------- /testdata/yaml_suite/MXS3.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Flow Mapping in Block Sequence 3 | from: NimYAML tests 4 | tags: mapping sequence flow 5 | yaml: | 6 | - {a: b} 7 | tree: | 8 | +STR 9 | +DOC 10 | +SEQ 11 | +MAP {} 12 | =VAL :a 13 | =VAL :b 14 | -MAP 15 | -SEQ 16 | -DOC 17 | -STR 18 | json: | 19 | [ 20 | { 21 | "a": "b" 22 | } 23 | ] 24 | dump: | 25 | - a: b 26 | -------------------------------------------------------------------------------- /testdata/yaml_suite/TS54.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Folded Block Scalar 3 | from: NimYAML tests 4 | tags: folded scalar 1.3-err 5 | yaml: | 6 | > 7 | ab 8 | cd 9 | ␣ 10 | ef 11 | 12 | 13 | gh 14 | tree: | 15 | +STR 16 | +DOC 17 | =VAL >ab cd\nef\n\ngh\n 18 | -DOC 19 | -STR 20 | json: | 21 | "ab cd\nef\n\ngh\n" 22 | dump: | 23 | > 24 | ab cd 25 | 26 | ef 27 | 28 | 29 | gh 30 | -------------------------------------------------------------------------------- /testdata/yaml_suite/6LVF.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 6.13. Reserved Directives 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2781445 4 | tags: spec directive header double 1.3-err 5 | yaml: | 6 | %FOO bar baz # Should be ignored 7 | # with a warning. 8 | --- "foo" 9 | tree: | 10 | +STR 11 | +DOC --- 12 | =VAL "foo 13 | -DOC 14 | -STR 15 | json: | 16 | "foo" 17 | dump: | 18 | --- "foo" 19 | -------------------------------------------------------------------------------- /testdata/yaml_suite/8XYN.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Anchor with unicode character 3 | from: https://github.com/yaml/pyyaml/issues/94 4 | tags: anchor 5 | yaml: | 6 | --- 7 | - &😁 unicode anchor 8 | tree: | 9 | +STR 10 | +DOC --- 11 | +SEQ 12 | =VAL &😁 :unicode anchor 13 | -SEQ 14 | -DOC 15 | -STR 16 | json: | 17 | [ 18 | "unicode anchor" 19 | ] 20 | dump: | 21 | --- 22 | - &😁 unicode anchor 23 | -------------------------------------------------------------------------------- /testdata/yaml_suite/FRK4.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 7.3. Completely Empty Flow Nodes 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2786868 4 | tags: empty-key explicit-key spec flow mapping 5 | yaml: | 6 | { 7 | ? foo :, 8 | : bar, 9 | } 10 | tree: | 11 | +STR 12 | +DOC 13 | +MAP {} 14 | =VAL :foo 15 | =VAL : 16 | =VAL : 17 | =VAL :bar 18 | -MAP 19 | -DOC 20 | -STR 21 | -------------------------------------------------------------------------------- /testdata/yaml_suite/6FWR.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Block Scalar Keep 3 | from: NimYAML tests 4 | tags: literal scalar whitespace 5 | yaml: | 6 | --- |+ 7 | ab 8 | ␣ 9 | ␣␣ 10 | ... 11 | tree: | 12 | +STR 13 | +DOC --- 14 | =VAL |ab\n\n \n 15 | -DOC ... 16 | -STR 17 | json: | 18 | "ab\n\n \n" 19 | dump: | 20 | "ab\n\n \n" 21 | ... 22 | emit: | 23 | --- | 24 | ab 25 | 26 | ␣␣␣ 27 | ... 28 | -------------------------------------------------------------------------------- /testdata/yaml_suite/5NYZ.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 6.9. Separated Comment 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2780342 4 | tags: mapping spec comment 5 | yaml: | 6 | key: # Comment 7 | value 8 | tree: | 9 | +STR 10 | +DOC 11 | +MAP 12 | =VAL :key 13 | =VAL :value 14 | -MAP 15 | -DOC 16 | -STR 17 | json: | 18 | { 19 | "key": "value" 20 | } 21 | dump: | 22 | key: value 23 | -------------------------------------------------------------------------------- /testdata/yaml_suite/TL85.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 6.8. Flow Folding 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2779950 4 | tags: double spec whitespace scalar upto-1.2 5 | yaml: | 6 | " 7 | foo␣ 8 | ␣ 9 | —» bar 10 | 11 | baz 12 | " 13 | tree: | 14 | +STR 15 | +DOC 16 | =VAL " foo\nbar\nbaz␣ 17 | -DOC 18 | -STR 19 | json: | 20 | " foo\nbar\nbaz " 21 | dump: | 22 | " foo\nbar\nbaz " 23 | -------------------------------------------------------------------------------- /testdata/yaml_suite/4RWC.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Trailing spaces after flow collection 3 | tags: flow whitespace 4 | from: '@ingydotnet' 5 | yaml: |2 6 | [1, 2, 3]␣␣ 7 | ␣␣∎ 8 | tree: | 9 | +STR 10 | +DOC 11 | +SEQ [] 12 | =VAL :1 13 | =VAL :2 14 | =VAL :3 15 | -SEQ 16 | -DOC 17 | -STR 18 | json: | 19 | [ 20 | 1, 21 | 2, 22 | 3 23 | ] 24 | dump: | 25 | - 1 26 | - 2 27 | - 3 28 | -------------------------------------------------------------------------------- /testdata/yaml_suite/96NN.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Leading tab content in literals 3 | from: '@ingydotnet' 4 | tags: indent literal whitespace 5 | yaml: | 6 | foo: |- 7 | ——»bar 8 | tree: | 9 | +STR 10 | +DOC 11 | +MAP 12 | =VAL :foo 13 | =VAL |\tbar 14 | -MAP 15 | -DOC 16 | -STR 17 | json: | 18 | {"foo":"\tbar"} 19 | dump: | 20 | foo: |- 21 | ——»bar 22 | 23 | - yaml: | 24 | foo: |- 25 | ——»bar∎ 26 | -------------------------------------------------------------------------------- /testdata/yaml_suite/DK3J.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Zero indented block scalar with line that looks like a comment 3 | from: '@perlpunk' 4 | tags: comment folded scalar 5 | yaml: | 6 | --- > 7 | line1 8 | # no comment 9 | line3 10 | tree: | 11 | +STR 12 | +DOC --- 13 | =VAL >line1 # no comment line3\n 14 | -DOC 15 | -STR 16 | json: | 17 | "line1 # no comment line3\n" 18 | dump: | 19 | --- > 20 | line1 # no comment line3 21 | -------------------------------------------------------------------------------- /testdata/yaml_suite/M9B4.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 8.7. Literal Scalar 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2795789 4 | tags: spec literal scalar whitespace 1.3-err 5 | yaml: | 6 | | 7 | literal 8 | ——»text 9 | ↵ 10 | ↵ 11 | tree: | 12 | +STR 13 | +DOC 14 | =VAL |literal\n\ttext\n 15 | -DOC 16 | -STR 17 | json: | 18 | "literal\n\ttext\n" 19 | dump: | 20 | | 21 | literal 22 | —»text 23 | -------------------------------------------------------------------------------- /testdata/yaml_suite/H3Z8.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Literal unicode 3 | from: '@perlpunk' 4 | tags: scalar 5 | yaml: | 6 | --- 7 | wanted: love ♥ and peace ☮ 8 | tree: | 9 | +STR 10 | +DOC --- 11 | +MAP 12 | =VAL :wanted 13 | =VAL :love ♥ and peace ☮ 14 | -MAP 15 | -DOC 16 | -STR 17 | json: | 18 | { 19 | "wanted": "love ♥ and peace ☮" 20 | } 21 | dump: | 22 | --- 23 | wanted: "love \u2665 and peace \u262E" 24 | -------------------------------------------------------------------------------- /testdata/yaml_suite/MJS9.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 6.7. Block Folding 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2779603 4 | tags: folded spec scalar whitespace 1.3-err 5 | yaml: | 6 | > 7 | foo␣ 8 | ␣ 9 | —» bar 10 | 11 | baz 12 | tree: | 13 | +STR 14 | +DOC 15 | =VAL >foo \n\n\t bar\n\nbaz\n 16 | -DOC 17 | -STR 18 | json: | 19 | "foo \n\n\t bar\n\nbaz\n" 20 | dump: | 21 | "foo \n\n\t bar\n\nbaz\n" 22 | -------------------------------------------------------------------------------- /testdata/yaml_suite/V55R.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Aliases in Block Sequence 3 | from: NimYAML tests 4 | tags: alias sequence 5 | yaml: | 6 | - &a a 7 | - &b b 8 | - *a 9 | - *b 10 | tree: | 11 | +STR 12 | +DOC 13 | +SEQ 14 | =VAL &a :a 15 | =VAL &b :b 16 | =ALI *a 17 | =ALI *b 18 | -SEQ 19 | -DOC 20 | -STR 21 | json: | 22 | [ 23 | "a", 24 | "b", 25 | "a", 26 | "b" 27 | ] 28 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org/ 2 | 3 | root = true 4 | 5 | [*] 6 | charset = utf-8 7 | insert_final_newline = true 8 | trim_trailing_whitespace = true 9 | end_of_line = lf 10 | 11 | [{*.go, go.mod}] 12 | indent_style = tab 13 | indent_size = 4 14 | 15 | [{*.yml,*.yaml}] 16 | indent_style = space 17 | indent_size = 2 18 | 19 | [*.py] 20 | indent_style = space 21 | indent_size = 4 22 | 23 | # Makefiles always use tabs for indentation 24 | [Makefile] 25 | indent_style = tab 26 | -------------------------------------------------------------------------------- /testdata/yaml_suite/B3HG.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 8.9. Folded Scalar [1.3] 3 | from: G992, modified for YAML 1.3 4 | tags: spec folded scalar 1.3-mod 5 | yaml: | 6 | --- > 7 | folded 8 | text 9 | ↵ 10 | ↵ 11 | tree: | 12 | +STR 13 | +DOC --- 14 | =VAL >folded text\n 15 | -DOC 16 | -STR 17 | json: | 18 | "folded text\n" 19 | dump: | 20 | > 21 | folded text 22 | emit: | 23 | --- > 24 | folded text 25 | -------------------------------------------------------------------------------- /testdata/yaml_suite/CC74.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 6.20. Tag Handles 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2783195 4 | tags: spec directive tag unknown-tag 5 | yaml: | 6 | %TAG !e! tag:example.com,2000:app/ 7 | --- 8 | !e!foo "bar" 9 | tree: | 10 | +STR 11 | +DOC --- 12 | =VAL "bar 13 | -DOC 14 | -STR 15 | json: | 16 | "bar" 17 | dump: | 18 | --- ! "bar" 19 | -------------------------------------------------------------------------------- /testdata/yaml_suite/K4SU.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Multiple Entry Block Sequence 3 | from: https://github.com/ingydotnet/yaml-pegex-pm/blob/master/test/sequence.tml 4 | tags: sequence 5 | yaml: | 6 | - foo 7 | - bar 8 | - 42 9 | tree: | 10 | +STR 11 | +DOC 12 | +SEQ 13 | =VAL :foo 14 | =VAL :bar 15 | =VAL :42 16 | -SEQ 17 | -DOC 18 | -STR 19 | json: | 20 | [ 21 | "foo", 22 | "bar", 23 | 42 24 | ] 25 | -------------------------------------------------------------------------------- /testdata/yaml_suite/UV7Q.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Legal tab after indentation 3 | from: '@ingydotnet' 4 | tags: indent whitespace 5 | yaml: | 6 | x: 7 | - x 8 | ——»x 9 | tree: | 10 | +STR 11 | +DOC 12 | +MAP 13 | =VAL :x 14 | +SEQ 15 | =VAL :x x 16 | -SEQ 17 | -MAP 18 | -DOC 19 | -STR 20 | json: | 21 | { 22 | "x": [ 23 | "x x" 24 | ] 25 | } 26 | dump: | 27 | x: 28 | - x x 29 | -------------------------------------------------------------------------------- /testdata/yaml_suite/X8DW.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Explicit key and value seperated by comment 3 | from: '@perlpunk' 4 | tags: comment explicit-key mapping 5 | yaml: | 6 | --- 7 | ? key 8 | # comment 9 | : value 10 | tree: | 11 | +STR 12 | +DOC --- 13 | +MAP 14 | =VAL :key 15 | =VAL :value 16 | -MAP 17 | -DOC 18 | -STR 19 | json: | 20 | { 21 | "key": "value" 22 | } 23 | dump: | 24 | --- 25 | key: value 26 | -------------------------------------------------------------------------------- /testdata/yaml_suite/36F6.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Multiline plain scalar with empty line 3 | from: '@perlpunk' 4 | tags: mapping scalar 5 | yaml: | 6 | --- 7 | plain: a 8 | b 9 | 10 | c 11 | tree: | 12 | +STR 13 | +DOC --- 14 | +MAP 15 | =VAL :plain 16 | =VAL :a b\nc 17 | -MAP 18 | -DOC 19 | -STR 20 | json: | 21 | { 22 | "plain": "a b\nc" 23 | } 24 | dump: | 25 | --- 26 | plain: 'a b 27 | 28 | c' 29 | -------------------------------------------------------------------------------- /testdata/yaml_suite/E76Z.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Aliases in Implicit Block Mapping 3 | from: NimYAML tests 4 | tags: mapping alias 5 | yaml: | 6 | &a a: &b b 7 | *b : *a 8 | tree: | 9 | +STR 10 | +DOC 11 | +MAP 12 | =VAL &a :a 13 | =VAL &b :b 14 | =ALI *b 15 | =ALI *a 16 | -MAP 17 | -DOC 18 | -STR 19 | json: | 20 | { 21 | "a": "b", 22 | "b": "a" 23 | } 24 | dump: | 25 | &a a: &b b 26 | *b : *a 27 | -------------------------------------------------------------------------------- /testdata/yaml_suite/EX5H.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Multiline Scalar at Top Level [1.3] 3 | from: 9YRD, modified for YAML 1.3 4 | tags: scalar whitespace 1.3-mod 5 | yaml: | 6 | --- 7 | a 8 | b␣␣ 9 | c 10 | d 11 | 12 | e 13 | tree: | 14 | +STR 15 | +DOC --- 16 | =VAL :a b c d\ne 17 | -DOC 18 | -STR 19 | json: | 20 | "a b c d\ne" 21 | dump: | 22 | 'a b c d 23 | 24 | e' 25 | emit: | 26 | --- a b c d 27 | 28 | e 29 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/go-faster/yaml 2 | 3 | go 1.18 4 | 5 | require ( 6 | github.com/go-faster/errors v0.7.1 7 | github.com/go-faster/jx v1.1.0 8 | github.com/stretchr/testify v1.11.0 9 | go.uber.org/multierr v1.11.0 10 | ) 11 | 12 | require ( 13 | github.com/davecgh/go-spew v1.1.1 // indirect 14 | github.com/pmezard/go-difflib v1.0.0 // indirect 15 | github.com/segmentio/asm v1.2.0 // indirect 16 | golang.org/x/sys v0.1.0 // indirect 17 | gopkg.in/yaml.v3 v3.0.1 // indirect 18 | ) 19 | -------------------------------------------------------------------------------- /testdata/yaml_suite/K3WX.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Colon and adjacent value after comment on next line 3 | from: 4 | tags: comment flow mapping 5 | yaml: | 6 | --- 7 | { "foo" # comment 8 | :bar } 9 | tree: | 10 | +STR 11 | +DOC --- 12 | +MAP {} 13 | =VAL "foo 14 | =VAL :bar 15 | -MAP 16 | -DOC 17 | -STR 18 | json: | 19 | { 20 | "foo": "bar" 21 | } 22 | dump: | 23 | --- 24 | "foo": bar 25 | -------------------------------------------------------------------------------- /testdata/yaml_suite/W5VH.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Allowed characters in alias 3 | from: '@perlpunk' 4 | tags: alias 1.3-err 5 | yaml: | 6 | a: &:@*!$": scalar a 7 | b: *:@*!$": 8 | tree: | 9 | +STR 10 | +DOC 11 | +MAP 12 | =VAL :a 13 | =VAL &:@*!$": :scalar a 14 | =VAL :b 15 | =ALI *:@*!$": 16 | -MAP 17 | -DOC 18 | -STR 19 | json: | 20 | { 21 | "a": "scalar a", 22 | "b": "scalar a" 23 | } 24 | -------------------------------------------------------------------------------- /testdata/yaml_suite/2LFX.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 6.13. Reserved Directives [1.3] 3 | from: 6LVF, modified for YAML 1.3 4 | tags: spec directive header double 1.3-mod 5 | yaml: | 6 | %FOO bar baz # Should be ignored 7 | # with a warning. 8 | --- 9 | "foo" 10 | tree: | 11 | +STR 12 | +DOC --- 13 | =VAL "foo 14 | -DOC 15 | -STR 16 | json: | 17 | "foo" 18 | dump: | 19 | --- 20 | "foo" 21 | emit: | 22 | --- "foo" 23 | -------------------------------------------------------------------------------- /testdata/yaml_suite/4Q9F.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Folded Block Scalar [1.3] 3 | from: TS54, modified for YAML 1.3 4 | tags: folded scalar 1.3-mod whitespace 5 | yaml: | 6 | --- > 7 | ab 8 | cd 9 | ␣ 10 | ef 11 | 12 | 13 | gh 14 | tree: | 15 | +STR 16 | +DOC --- 17 | =VAL >ab cd\nef\n\ngh\n 18 | -DOC 19 | -STR 20 | json: | 21 | "ab cd\nef\n\ngh\n" 22 | dump: | 23 | --- > 24 | ab cd 25 | 26 | ef 27 | 28 | 29 | gh 30 | -------------------------------------------------------------------------------- /testdata/yaml_suite/A984.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Multiline Scalar in Mapping 3 | from: NimYAML tests 4 | tags: scalar 5 | yaml: | 6 | a: b 7 | c 8 | d: 9 | e 10 | f 11 | tree: | 12 | +STR 13 | +DOC 14 | +MAP 15 | =VAL :a 16 | =VAL :b c 17 | =VAL :d 18 | =VAL :e f 19 | -MAP 20 | -DOC 21 | -STR 22 | json: | 23 | { 24 | "a": "b c", 25 | "d": "e f" 26 | } 27 | dump: | 28 | a: b c 29 | d: e f 30 | -------------------------------------------------------------------------------- /testdata/yaml_suite/PUW8.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Document start on last line 3 | from: '@perlpunk' 4 | tags: header 5 | yaml: | 6 | --- 7 | a: b 8 | --- 9 | tree: | 10 | +STR 11 | +DOC --- 12 | +MAP 13 | =VAL :a 14 | =VAL :b 15 | -MAP 16 | -DOC 17 | +DOC --- 18 | =VAL : 19 | -DOC 20 | -STR 21 | json: | 22 | { 23 | "a": "b" 24 | } 25 | null 26 | dump: | 27 | --- 28 | a: b 29 | --- 30 | ... 31 | -------------------------------------------------------------------------------- /testdata/yaml_suite/RR7F.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Mixed Block Mapping (implicit to explicit) 3 | from: NimYAML tests 4 | tags: explicit-key mapping 5 | yaml: | 6 | a: 4.2 7 | ? d 8 | : 23 9 | tree: | 10 | +STR 11 | +DOC 12 | +MAP 13 | =VAL :a 14 | =VAL :4.2 15 | =VAL :d 16 | =VAL :23 17 | -MAP 18 | -DOC 19 | -STR 20 | json: | 21 | { 22 | "d": 23, 23 | "a": 4.2 24 | } 25 | dump: | 26 | a: 4.2 27 | d: 23 28 | -------------------------------------------------------------------------------- /testdata/yaml_suite/7TMG.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Comment in flow sequence before comma 3 | from: '@perlpunk' 4 | tags: comment flow sequence 5 | yaml: | 6 | --- 7 | [ word1 8 | # comment 9 | , word2] 10 | tree: | 11 | +STR 12 | +DOC --- 13 | +SEQ [] 14 | =VAL :word1 15 | =VAL :word2 16 | -SEQ 17 | -DOC 18 | -STR 19 | json: | 20 | [ 21 | "word1", 22 | "word2" 23 | ] 24 | dump: | 25 | --- 26 | - word1 27 | - word2 28 | -------------------------------------------------------------------------------- /testdata/yaml_suite/J7VC.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Empty Lines Between Mapping Elements 3 | from: NimYAML tests 4 | tags: whitespace mapping 5 | yaml: | 6 | one: 2 7 | 8 | 9 | three: 4 10 | tree: | 11 | +STR 12 | +DOC 13 | +MAP 14 | =VAL :one 15 | =VAL :2 16 | =VAL :three 17 | =VAL :4 18 | -MAP 19 | -DOC 20 | -STR 21 | json: | 22 | { 23 | "one": 2, 24 | "three": 4 25 | } 26 | dump: | 27 | one: 2 28 | three: 4 29 | -------------------------------------------------------------------------------- /testdata/yaml_suite/QLJ7.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Tag shorthand used in documents but only defined in the first 3 | from: IRC 4 | tags: error directive tag 5 | fail: true 6 | yaml: | 7 | %TAG !prefix! tag:example.com,2011: 8 | --- !prefix!A 9 | a: b 10 | --- !prefix!B 11 | c: d 12 | --- !prefix!C 13 | e: f 14 | tree: | 15 | +STR 16 | +DOC --- 17 | +MAP 18 | =VAL :a 19 | =VAL :b 20 | -MAP 21 | -DOC 22 | +DOC --- 23 | -------------------------------------------------------------------------------- /testdata/yaml_suite/3ALJ.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Block Sequence in Block Sequence 3 | from: NimYAML tests 4 | tags: sequence 5 | yaml: | 6 | - - s1_i1 7 | - s1_i2 8 | - s2 9 | tree: | 10 | +STR 11 | +DOC 12 | +SEQ 13 | +SEQ 14 | =VAL :s1_i1 15 | =VAL :s1_i2 16 | -SEQ 17 | =VAL :s2 18 | -SEQ 19 | -DOC 20 | -STR 21 | json: | 22 | [ 23 | [ 24 | "s1_i1", 25 | "s1_i2" 26 | ], 27 | "s2" 28 | ] 29 | -------------------------------------------------------------------------------- /testdata/yaml_suite/6WPF.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 6.8. Flow Folding [1.3] 3 | from: TL85, modified for YAML 1.3 4 | tags: double spec whitespace scalar 1.3-mod 5 | yaml: | 6 | --- 7 | " 8 | foo␣ 9 | ␣ 10 | bar 11 | 12 | baz 13 | " 14 | tree: | 15 | +STR 16 | +DOC --- 17 | =VAL " foo\nbar\nbaz␣ 18 | -DOC 19 | -STR 20 | json: | 21 | " foo\nbar\nbaz " 22 | dump: | 23 | " foo\nbar\nbaz " 24 | emit: | 25 | --- " foo\nbar\nbaz " 26 | -------------------------------------------------------------------------------- /testdata/yaml_suite/AB8U.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Sequence entry that looks like two with wrong indentation 3 | from: '@perlpunk' 4 | tags: scalar sequence 5 | yaml: | 6 | - single multiline 7 | - sequence entry 8 | tree: | 9 | +STR 10 | +DOC 11 | +SEQ 12 | =VAL :single multiline - sequence entry 13 | -SEQ 14 | -DOC 15 | -STR 16 | json: | 17 | [ 18 | "single multiline - sequence entry" 19 | ] 20 | dump: | 21 | - single multiline - sequence entry 22 | -------------------------------------------------------------------------------- /testdata/yaml_suite/DHP8.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Flow Sequence 3 | from: https://github.com/ingydotnet/yaml-pegex-pm/blob/master/test/sequence.tml 4 | tags: flow sequence 5 | yaml: | 6 | [foo, bar, 42] 7 | tree: | 8 | +STR 9 | +DOC 10 | +SEQ [] 11 | =VAL :foo 12 | =VAL :bar 13 | =VAL :42 14 | -SEQ 15 | -DOC 16 | -STR 17 | json: | 18 | [ 19 | "foo", 20 | "bar", 21 | 42 22 | ] 23 | dump: | 24 | - foo 25 | - bar 26 | - 42 27 | -------------------------------------------------------------------------------- /testdata/yaml_suite/P94K.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 6.11. Multi-Line Comments 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2780696 4 | tags: spec comment 5 | yaml: | 6 | key: # Comment 7 | # lines 8 | value 9 | ↵ 10 | ↵ 11 | tree: | 12 | +STR 13 | +DOC 14 | +MAP 15 | =VAL :key 16 | =VAL :value 17 | -MAP 18 | -DOC 19 | -STR 20 | json: | 21 | { 22 | "key": "value" 23 | } 24 | dump: | 25 | key: value 26 | -------------------------------------------------------------------------------- /testdata/yaml_suite/93WF.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 6.6. Line Folding [1.3] 3 | from: K527, modified for YAML 1.3 4 | tags: folded spec whitespace scalar 1.3-mod 5 | yaml: | 6 | --- >- 7 | trimmed 8 | ␣␣ 9 | ␣ 10 | 11 | as 12 | space 13 | tree: | 14 | +STR 15 | +DOC --- 16 | =VAL >trimmed\n\n\nas space 17 | -DOC 18 | -STR 19 | json: | 20 | "trimmed\n\n\nas space" 21 | dump: | 22 | --- >- 23 | trimmed 24 | 25 | 26 | 27 | as space 28 | -------------------------------------------------------------------------------- /testdata/yaml_suite/9SHH.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 5.8. Quoted Scalar Indicators 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2773890 4 | tags: spec scalar 5 | yaml: | 6 | single: 'text' 7 | double: "text" 8 | tree: | 9 | +STR 10 | +DOC 11 | +MAP 12 | =VAL :single 13 | =VAL 'text 14 | =VAL :double 15 | =VAL "text 16 | -MAP 17 | -DOC 18 | -STR 19 | json: | 20 | { 21 | "single": "text", 22 | "double": "text" 23 | } 24 | -------------------------------------------------------------------------------- /testdata/yaml_suite/D88J.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Flow Sequence in Block Mapping 3 | from: NimYAML tests 4 | tags: flow sequence mapping 5 | yaml: | 6 | a: [b, c] 7 | tree: | 8 | +STR 9 | +DOC 10 | +MAP 11 | =VAL :a 12 | +SEQ [] 13 | =VAL :b 14 | =VAL :c 15 | -SEQ 16 | -MAP 17 | -DOC 18 | -STR 19 | json: | 20 | { 21 | "a": [ 22 | "b", 23 | "c" 24 | ] 25 | } 26 | dump: | 27 | a: 28 | - b 29 | - c 30 | -------------------------------------------------------------------------------- /testdata/yaml_suite/P76L.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 6.19. Secondary Tag Handle 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2782940 4 | tags: spec header tag unknown-tag 5 | yaml: | 6 | %TAG !! tag:example.com,2000:app/ 7 | --- 8 | !!int 1 - 3 # Interval, not integer 9 | tree: | 10 | +STR 11 | +DOC --- 12 | =VAL :1 - 3 13 | -DOC 14 | -STR 15 | json: | 16 | "1 - 3" 17 | dump: | 18 | --- ! 1 - 3 19 | -------------------------------------------------------------------------------- /testdata/yaml_suite/T5N4.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 8.7. Literal Scalar [1.3] 3 | from: M9B4, modified for YAML 1.3 4 | tags: spec literal scalar whitespace 1.3-mod 5 | yaml: | 6 | --- | 7 | literal 8 | ——»text 9 | ↵ 10 | ↵ 11 | tree: | 12 | +STR 13 | +DOC --- 14 | =VAL |literal\n\ttext\n 15 | -DOC 16 | -STR 17 | json: | 18 | "literal\n\ttext\n" 19 | dump: | 20 | "literal\n\ttext\n" 21 | emit: | 22 | --- | 23 | literal 24 | —»text 25 | -------------------------------------------------------------------------------- /testdata/yaml_suite/9J7A.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Simple Mapping Indent 3 | from: https://github.com/ingydotnet/yaml-pegex-pm/blob/master/test/indent.tml 4 | tags: simple mapping indent 5 | yaml: | 6 | foo: 7 | bar: baz 8 | tree: | 9 | +STR 10 | +DOC 11 | +MAP 12 | =VAL :foo 13 | +MAP 14 | =VAL :bar 15 | =VAL :baz 16 | -MAP 17 | -MAP 18 | -DOC 19 | -STR 20 | json: | 21 | { 22 | "foo": { 23 | "bar": "baz" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /testdata/yaml_suite/GH63.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Mixed Block Mapping (explicit to implicit) 3 | from: NimYAML tests 4 | tags: explicit-key mapping 5 | yaml: | 6 | ? a 7 | : 1.3 8 | fifteen: d 9 | tree: | 10 | +STR 11 | +DOC 12 | +MAP 13 | =VAL :a 14 | =VAL :1.3 15 | =VAL :fifteen 16 | =VAL :d 17 | -MAP 18 | -DOC 19 | -STR 20 | json: | 21 | { 22 | "a": 1.3, 23 | "fifteen": "d" 24 | } 25 | dump: | 26 | a: 1.3 27 | fifteen: d 28 | -------------------------------------------------------------------------------- /testdata/yaml_suite/K527.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 6.6. Line Folding 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2779289 4 | tags: folded spec whitespace scalar 1.3-err 5 | yaml: | 6 | >- 7 | trimmed 8 | ␣␣ 9 | ␣ 10 | 11 | as 12 | space 13 | tree: | 14 | +STR 15 | +DOC 16 | =VAL >trimmed\n\n\nas space 17 | -DOC 18 | -STR 19 | json: | 20 | "trimmed\n\n\nas space" 21 | dump: | 22 | >- 23 | trimmed 24 | 25 | 26 | 27 | as space 28 | -------------------------------------------------------------------------------- /testdata/yaml_suite/NB6Z.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Multiline plain value with tabs on empty lines 3 | from: '@perlpunk' 4 | tags: scalar whitespace 5 | yaml: | 6 | key: 7 | value 8 | with 9 | —» 10 | tabs 11 | tree: | 12 | +STR 13 | +DOC 14 | +MAP 15 | =VAL :key 16 | =VAL :value with\ntabs 17 | -MAP 18 | -DOC 19 | -STR 20 | json: | 21 | { 22 | "key": "value with\ntabs" 23 | } 24 | dump: | 25 | key: 'value with 26 | 27 | tabs' 28 | -------------------------------------------------------------------------------- /testdata/yaml_suite/6JQW.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 2.13. In literals, newlines are preserved 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2759963 4 | tags: spec scalar literal comment 5 | yaml: | 6 | # ASCII Art 7 | --- | 8 | \//||\/|| 9 | // || ||__ 10 | tree: | 11 | +STR 12 | +DOC --- 13 | =VAL |\\//||\\/||\n// || ||__\n 14 | -DOC 15 | -STR 16 | json: | 17 | "\\//||\\/||\n// || ||__\n" 18 | dump: | 19 | --- | 20 | \//||\/|| 21 | // || ||__ 22 | -------------------------------------------------------------------------------- /testdata/yaml_suite/7FWL.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 6.24. Verbatim Tags 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2784370 4 | tags: mapping spec tag unknown-tag 5 | yaml: | 6 | ! foo : 7 | ! baz 8 | tree: | 9 | +STR 10 | +DOC 11 | +MAP 12 | =VAL :foo 13 | =VAL :baz 14 | -MAP 15 | -DOC 16 | -STR 17 | json: | 18 | { 19 | "foo": "baz" 20 | } 21 | dump: | 22 | !!str foo: !bar baz 23 | -------------------------------------------------------------------------------- /testdata/yaml_suite/8CWC.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Plain mapping key ending with colon 3 | from: '@perlpunk' 4 | tags: mapping scalar 5 | yaml: | 6 | --- 7 | key ends with two colons::: value 8 | tree: | 9 | +STR 10 | +DOC --- 11 | +MAP 12 | =VAL :key ends with two colons:: 13 | =VAL :value 14 | -MAP 15 | -DOC 16 | -STR 17 | json: | 18 | { 19 | "key ends with two colons::": "value" 20 | } 21 | dump: | 22 | --- 23 | 'key ends with two colons::': value 24 | -------------------------------------------------------------------------------- /testdata/yaml_suite/FUP4.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Flow Sequence in Flow Sequence 3 | from: NimYAML tests 4 | tags: sequence flow 5 | yaml: | 6 | [a, [b, c]] 7 | tree: | 8 | +STR 9 | +DOC 10 | +SEQ [] 11 | =VAL :a 12 | +SEQ [] 13 | =VAL :b 14 | =VAL :c 15 | -SEQ 16 | -SEQ 17 | -DOC 18 | -STR 19 | json: | 20 | [ 21 | "a", 22 | [ 23 | "b", 24 | "c" 25 | ] 26 | ] 27 | dump: | 28 | - a 29 | - - b 30 | - c 31 | -------------------------------------------------------------------------------- /testdata/yaml_suite/54T7.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Flow Mapping 3 | from: https://github.com/ingydotnet/yaml-pegex-pm/blob/master/test/mapping.tml 4 | tags: flow mapping 5 | yaml: | 6 | {foo: you, bar: far} 7 | tree: | 8 | +STR 9 | +DOC 10 | +MAP {} 11 | =VAL :foo 12 | =VAL :you 13 | =VAL :bar 14 | =VAL :far 15 | -MAP 16 | -DOC 17 | -STR 18 | json: | 19 | { 20 | "foo": "you", 21 | "bar": "far" 22 | } 23 | dump: | 24 | foo: you 25 | bar: far 26 | -------------------------------------------------------------------------------- /testdata/yaml_suite/QF4Y.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 7.19. Single Pair Flow Mappings 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2792291 4 | tags: spec flow mapping 5 | yaml: | 6 | [ 7 | foo: bar 8 | ] 9 | tree: | 10 | +STR 11 | +DOC 12 | +SEQ [] 13 | +MAP {} 14 | =VAL :foo 15 | =VAL :bar 16 | -MAP 17 | -SEQ 18 | -DOC 19 | -STR 20 | json: | 21 | [ 22 | { 23 | "foo": "bar" 24 | } 25 | ] 26 | dump: | 27 | - foo: bar 28 | -------------------------------------------------------------------------------- /testdata/yaml_suite/UDM2.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Plain URL in flow mapping 3 | from: https://github.com/yaml/libyaml/pull/28 4 | tags: flow scalar 5 | yaml: | 6 | - { url: http://example.org } 7 | tree: | 8 | +STR 9 | +DOC 10 | +SEQ 11 | +MAP {} 12 | =VAL :url 13 | =VAL :http://example.org 14 | -MAP 15 | -SEQ 16 | -DOC 17 | -STR 18 | json: | 19 | [ 20 | { 21 | "url": "http://example.org" 22 | } 23 | ] 24 | dump: | 25 | - url: http://example.org 26 | -------------------------------------------------------------------------------- /testdata/yaml_suite/HS5T.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 7.12. Plain Lines 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2789986 4 | tags: spec scalar whitespace upto-1.2 5 | yaml: | 6 | 1st non-empty 7 | 8 | 2nd non-empty␣ 9 | ———»3rd non-empty 10 | tree: | 11 | +STR 12 | +DOC 13 | =VAL :1st non-empty\n2nd non-empty 3rd non-empty 14 | -DOC 15 | -STR 16 | json: | 17 | "1st non-empty\n2nd non-empty 3rd non-empty" 18 | dump: | 19 | '1st non-empty 20 | 21 | 2nd non-empty 3rd non-empty' 22 | -------------------------------------------------------------------------------- /testdata/yaml_suite/M29M.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Literal Block Scalar 3 | from: NimYAML tests 4 | tags: literal scalar whitespace 5 | yaml: | 6 | a: | 7 | ab 8 | ␣ 9 | cd 10 | ef 11 | ␣ 12 | 13 | ... 14 | tree: | 15 | +STR 16 | +DOC 17 | +MAP 18 | =VAL :a 19 | =VAL |ab\n\ncd\nef\n 20 | -MAP 21 | -DOC ... 22 | -STR 23 | json: | 24 | { 25 | "a": "ab\n\ncd\nef\n" 26 | } 27 | dump: | 28 | a: | 29 | ab 30 | 31 | cd 32 | ef 33 | ... 34 | -------------------------------------------------------------------------------- /testdata/yaml_suite/2SXE.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Anchors With Colon in Name 3 | from: Mailing List Discussion 4 | tags: alias edge mapping 1.3-err 5 | yaml: | 6 | &a: key: &a value 7 | foo: 8 | *a: 9 | tree: | 10 | +STR 11 | +DOC 12 | +MAP 13 | =VAL &a: :key 14 | =VAL &a :value 15 | =VAL :foo 16 | =ALI *a: 17 | -MAP 18 | -DOC 19 | -STR 20 | json: | 21 | { 22 | "key": "value", 23 | "foo": "key" 24 | } 25 | dump: | 26 | &a: key: &a value 27 | foo: *a: 28 | -------------------------------------------------------------------------------- /testdata/yaml_suite/6KGN.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Anchor for empty node 3 | from: https://github.com/nodeca/js-yaml/issues/301 4 | tags: alias anchor 5 | yaml: | 6 | --- 7 | a: &anchor 8 | b: *anchor 9 | tree: | 10 | +STR 11 | +DOC --- 12 | +MAP 13 | =VAL :a 14 | =VAL &anchor : 15 | =VAL :b 16 | =ALI *anchor 17 | -MAP 18 | -DOC 19 | -STR 20 | json: | 21 | { 22 | "a": null, 23 | "b": null 24 | } 25 | dump: | 26 | --- 27 | a: &anchor 28 | b: *anchor 29 | -------------------------------------------------------------------------------- /testdata/yaml_suite/7A4E.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 7.6. Double Quoted Lines 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2787994 4 | tags: spec scalar upto-1.2 whitespace 5 | yaml: | 6 | " 1st non-empty 7 | 8 | 2nd non-empty␣ 9 | ———»3rd non-empty " 10 | tree: | 11 | +STR 12 | +DOC 13 | =VAL " 1st non-empty\n2nd non-empty 3rd non-empty␣ 14 | -DOC 15 | -STR 16 | json: | 17 | " 1st non-empty\n2nd non-empty 3rd non-empty " 18 | dump: | 19 | " 1st non-empty\n2nd non-empty 3rd non-empty " 20 | -------------------------------------------------------------------------------- /testdata/yaml_suite/7W2P.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Block Mapping with Missing Values 3 | from: NimYAML tests 4 | tags: explicit-key mapping 5 | yaml: | 6 | ? a 7 | ? b 8 | c: 9 | tree: | 10 | +STR 11 | +DOC 12 | +MAP 13 | =VAL :a 14 | =VAL : 15 | =VAL :b 16 | =VAL : 17 | =VAL :c 18 | =VAL : 19 | -MAP 20 | -DOC 21 | -STR 22 | json: | 23 | { 24 | "a": null, 25 | "b": null, 26 | "c": null 27 | } 28 | dump: | 29 | a: 30 | b: 31 | c: 32 | -------------------------------------------------------------------------------- /testdata/yaml_suite/9MQT.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Scalar doc with '...' in content 3 | from: '@ingydotnet' 4 | tags: double scalar 5 | yaml: | 6 | --- "a 7 | ...x 8 | b" 9 | tree: | 10 | +STR 11 | +DOC --- 12 | =VAL "a ...x b 13 | -DOC 14 | -STR 15 | json: | 16 | "a ...x b" 17 | dump: | 18 | --- a ...x b 19 | emit: | 20 | --- "a ...x b" 21 | 22 | - fail: true 23 | yaml: | 24 | --- "a 25 | ... x 26 | b" 27 | tree: | 28 | +STR 29 | +DOC --- 30 | dump: null 31 | emit: null 32 | -------------------------------------------------------------------------------- /testdata/yaml_suite/SM9W.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Single character streams 3 | from: '@ingydotnet' 4 | tags: sequence 5 | yaml: | 6 | -∎ 7 | tree: | 8 | +STR 9 | +DOC 10 | +SEQ 11 | =VAL : 12 | -SEQ 13 | -DOC 14 | -STR 15 | json: | 16 | [null] 17 | dump: | 18 | - 19 | 20 | - tags: mapping 21 | yaml: | 22 | :∎ 23 | tree: | 24 | +STR 25 | +DOC 26 | +MAP 27 | =VAL : 28 | =VAL : 29 | -MAP 30 | -DOC 31 | -STR 32 | json: null 33 | dump: | 34 | : 35 | -------------------------------------------------------------------------------- /testdata/yaml_suite/7Z25.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Bare document after document end marker 3 | from: '@perlpunk' 4 | tags: footer 5 | yaml: | 6 | --- 7 | scalar1 8 | ... 9 | key: value 10 | tree: | 11 | +STR 12 | +DOC --- 13 | =VAL :scalar1 14 | -DOC ... 15 | +DOC 16 | +MAP 17 | =VAL :key 18 | =VAL :value 19 | -MAP 20 | -DOC 21 | -STR 22 | json: | 23 | "scalar1" 24 | { 25 | "key": "value" 26 | } 27 | dump: | 28 | --- scalar1 29 | ... 30 | key: value 31 | -------------------------------------------------------------------------------- /testdata/yaml_suite/Z9M4.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 6.22. Global Tag Prefix 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2783726 4 | tags: spec header tag unknown-tag 5 | yaml: | 6 | %TAG !e! tag:example.com,2000:app/ 7 | --- 8 | - !e!foo "bar" 9 | tree: | 10 | +STR 11 | +DOC --- 12 | +SEQ 13 | =VAL "bar 14 | -SEQ 15 | -DOC 16 | -STR 17 | json: | 18 | [ 19 | "bar" 20 | ] 21 | dump: | 22 | --- 23 | - ! "bar" 24 | -------------------------------------------------------------------------------- /testdata/yaml_suite/KSS4.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Scalars on --- line 3 | from: '@perlpunk' 4 | tags: anchor header scalar 1.3-err 5 | yaml: | 6 | --- "quoted 7 | string" 8 | --- &node foo 9 | tree: | 10 | +STR 11 | +DOC --- 12 | =VAL "quoted string 13 | -DOC 14 | +DOC --- 15 | =VAL &node :foo 16 | -DOC 17 | -STR 18 | json: | 19 | "quoted string" 20 | "foo" 21 | dump: | 22 | --- "quoted string" 23 | --- &node foo 24 | ... 25 | emit: | 26 | --- "quoted string" 27 | --- &node foo 28 | -------------------------------------------------------------------------------- /testdata/yaml_suite/8QBE.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Block Sequence in Block Mapping 3 | from: NimYAML tests 4 | tags: mapping sequence 5 | yaml: | 6 | key: 7 | - item1 8 | - item2 9 | tree: | 10 | +STR 11 | +DOC 12 | +MAP 13 | =VAL :key 14 | +SEQ 15 | =VAL :item1 16 | =VAL :item2 17 | -SEQ 18 | -MAP 19 | -DOC 20 | -STR 21 | json: | 22 | { 23 | "key": [ 24 | "item1", 25 | "item2" 26 | ] 27 | } 28 | dump: | 29 | key: 30 | - item1 31 | - item2 32 | -------------------------------------------------------------------------------- /testdata/yaml_suite/652Z.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Question mark at start of flow key 3 | from: '@ingydotnet' 4 | tags: flow 5 | yaml: | 6 | { ?foo: bar, 7 | bar: 42 8 | } 9 | tree: | 10 | +STR 11 | +DOC 12 | +MAP {} 13 | =VAL :?foo 14 | =VAL :bar 15 | =VAL :bar 16 | =VAL :42 17 | -MAP 18 | -DOC 19 | -STR 20 | json: | 21 | { 22 | "?foo" : "bar", 23 | "bar" : 42 24 | } 25 | dump: | 26 | --- 27 | ?foo: bar 28 | bar: 42 29 | emit: | 30 | ?foo: bar 31 | bar: 42 32 | -------------------------------------------------------------------------------- /testdata/yaml_suite/S4JQ.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 6.28. Non-Specific Tags 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2785512 4 | tags: spec tag 5 | yaml: | 6 | # Assuming conventional resolution: 7 | - "12" 8 | - 12 9 | - ! 12 10 | tree: | 11 | +STR 12 | +DOC 13 | +SEQ 14 | =VAL "12 15 | =VAL :12 16 | =VAL :12 17 | -SEQ 18 | -DOC 19 | -STR 20 | json: | 21 | [ 22 | "12", 23 | 12, 24 | "12" 25 | ] 26 | dump: | 27 | - "12" 28 | - 12 29 | - ! 12 30 | -------------------------------------------------------------------------------- /testdata/yaml_suite/CT4Q.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 7.20. Single Pair Explicit Entry 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2792424 4 | tags: explicit-key spec flow mapping 5 | yaml: | 6 | [ 7 | ? foo 8 | bar : baz 9 | ] 10 | tree: | 11 | +STR 12 | +DOC 13 | +SEQ [] 14 | +MAP {} 15 | =VAL :foo bar 16 | =VAL :baz 17 | -MAP 18 | -SEQ 19 | -DOC 20 | -STR 21 | json: | 22 | [ 23 | { 24 | "foo bar": "baz" 25 | } 26 | ] 27 | dump: | 28 | - foo bar: baz 29 | -------------------------------------------------------------------------------- /testdata/yaml_suite/JTV5.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Block Mapping with Multiline Scalars 3 | from: NimYAML tests 4 | tags: explicit-key mapping scalar 5 | yaml: | 6 | ? a 7 | true 8 | : null 9 | d 10 | ? e 11 | 42 12 | tree: | 13 | +STR 14 | +DOC 15 | +MAP 16 | =VAL :a true 17 | =VAL :null d 18 | =VAL :e 42 19 | =VAL : 20 | -MAP 21 | -DOC 22 | -STR 23 | json: | 24 | { 25 | "a true": "null d", 26 | "e 42": null 27 | } 28 | dump: | 29 | a true: null d 30 | e 42: 31 | -------------------------------------------------------------------------------- /testdata/yaml_suite/KMK3.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Block Submapping 3 | from: https://github.com/ingydotnet/yaml-pegex-pm/blob/master/test/mapping.tml 4 | tags: mapping 5 | yaml: | 6 | foo: 7 | bar: 1 8 | baz: 2 9 | tree: | 10 | +STR 11 | +DOC 12 | +MAP 13 | =VAL :foo 14 | +MAP 15 | =VAL :bar 16 | =VAL :1 17 | -MAP 18 | =VAL :baz 19 | =VAL :2 20 | -MAP 21 | -DOC 22 | -STR 23 | json: | 24 | { 25 | "foo": { 26 | "bar": 1 27 | }, 28 | "baz": 2 29 | } 30 | -------------------------------------------------------------------------------- /testdata/yaml_suite/AZ63.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Sequence With Same Indentation as Parent Mapping 3 | from: NimYAML tests 4 | tags: indent mapping sequence 5 | yaml: | 6 | one: 7 | - 2 8 | - 3 9 | four: 5 10 | tree: | 11 | +STR 12 | +DOC 13 | +MAP 14 | =VAL :one 15 | +SEQ 16 | =VAL :2 17 | =VAL :3 18 | -SEQ 19 | =VAL :four 20 | =VAL :5 21 | -MAP 22 | -DOC 23 | -STR 24 | json: | 25 | { 26 | "one": [ 27 | 2, 28 | 3 29 | ], 30 | "four": 5 31 | } 32 | -------------------------------------------------------------------------------- /testdata/yaml_suite/SBG9.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Flow Sequence in Flow Mapping 3 | from: NimYAML tests 4 | tags: complex-key sequence mapping flow 5 | yaml: | 6 | {a: [b, c], [d, e]: f} 7 | tree: | 8 | +STR 9 | +DOC 10 | +MAP {} 11 | =VAL :a 12 | +SEQ [] 13 | =VAL :b 14 | =VAL :c 15 | -SEQ 16 | +SEQ [] 17 | =VAL :d 18 | =VAL :e 19 | -SEQ 20 | =VAL :f 21 | -MAP 22 | -DOC 23 | -STR 24 | dump: | 25 | a: 26 | - b 27 | - c 28 | ? - d 29 | - e 30 | : f 31 | -------------------------------------------------------------------------------- /.github/workflows/x.yml: -------------------------------------------------------------------------------- 1 | name: x 2 | 3 | on: 4 | push: 5 | branches: [main] 6 | pull_request: 7 | workflow_dispatch: 8 | 9 | # Common Go workflows from go faster 10 | # See https://github.com/go-faster/x 11 | jobs: 12 | test: 13 | uses: go-faster/x/.github/workflows/test.yml@main 14 | cover: 15 | uses: go-faster/x/.github/workflows/cover.yml@main 16 | lint: 17 | uses: go-faster/x/.github/workflows/lint.yml@main 18 | commit: 19 | uses: go-faster/x/.github/workflows/commit.yml@main 20 | codeql: 21 | uses: go-faster/x/.github/workflows/codeql.yml@main 22 | -------------------------------------------------------------------------------- /testdata/yaml_suite/J5UC.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Multiple Pair Block Mapping 3 | from: https://github.com/ingydotnet/yaml-pegex-pm/blob/master/test/mapping.tml 4 | tags: mapping 5 | yaml: | 6 | foo: blue 7 | bar: arrr 8 | baz: jazz 9 | tree: | 10 | +STR 11 | +DOC 12 | +MAP 13 | =VAL :foo 14 | =VAL :blue 15 | =VAL :bar 16 | =VAL :arrr 17 | =VAL :baz 18 | =VAL :jazz 19 | -MAP 20 | -DOC 21 | -STR 22 | json: | 23 | { 24 | "foo": "blue", 25 | "bar": "arrr", 26 | "baz": "jazz" 27 | } 28 | -------------------------------------------------------------------------------- /testdata/yaml_suite/JS2J.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 6.29. Node Anchors 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2785977 4 | tags: spec alias 5 | yaml: | 6 | First occurrence: &anchor Value 7 | Second occurrence: *anchor 8 | tree: | 9 | +STR 10 | +DOC 11 | +MAP 12 | =VAL :First occurrence 13 | =VAL &anchor :Value 14 | =VAL :Second occurrence 15 | =ALI *anchor 16 | -MAP 17 | -DOC 18 | -STR 19 | json: | 20 | { 21 | "First occurrence": "Value", 22 | "Second occurrence": "Value" 23 | } 24 | -------------------------------------------------------------------------------- /testdata/yaml_suite/5TYM.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 6.21. Local Tag Prefix 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2783499 4 | tags: local-tag spec directive tag 5 | yaml: | 6 | %TAG !m! !my- 7 | --- # Bulb here 8 | !m!light fluorescent 9 | ... 10 | %TAG !m! !my- 11 | --- # Color here 12 | !m!light green 13 | tree: | 14 | +STR 15 | +DOC --- 16 | =VAL :fluorescent 17 | -DOC ... 18 | +DOC --- 19 | =VAL :green 20 | -DOC 21 | -STR 22 | json: | 23 | "fluorescent" 24 | "green" 25 | -------------------------------------------------------------------------------- /.github/workflows/pr.yml: -------------------------------------------------------------------------------- 1 | name: "Dependency Review" 2 | on: [pull_request] 3 | 4 | permissions: 5 | contents: read 6 | 7 | jobs: 8 | dependency-review: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: "Checkout Repository" 12 | uses: actions/checkout@v6 13 | 14 | # Their stupid action rely on PR event metadata, so 15 | # there is no much sense to setup a re-usable workflow. 16 | - name: "Dependency Review" 17 | uses: actions/dependency-review-action@v4 18 | with: 19 | config-file: "./.github/dependency-review-config.yml" 20 | -------------------------------------------------------------------------------- /testdata/yaml_suite/6PBE.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Zero-indented sequences in explicit mapping keys 3 | from: '@perlpunk' 4 | tags: explicit-key mapping sequence 5 | yaml: | 6 | --- 7 | ? 8 | - a 9 | - b 10 | : 11 | - c 12 | - d 13 | tree: | 14 | +STR 15 | +DOC --- 16 | +MAP 17 | +SEQ 18 | =VAL :a 19 | =VAL :b 20 | -SEQ 21 | +SEQ 22 | =VAL :c 23 | =VAL :d 24 | -SEQ 25 | -MAP 26 | -DOC 27 | -STR 28 | emit: | 29 | --- 30 | ? - a 31 | - b 32 | : - c 33 | - d 34 | -------------------------------------------------------------------------------- /testdata/yaml_suite/AZW3.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Lookahead test cases 3 | from: NimYAML tests 4 | tags: mapping edge 5 | yaml: | 6 | - bla"keks: foo 7 | - bla]keks: foo 8 | tree: | 9 | +STR 10 | +DOC 11 | +SEQ 12 | +MAP 13 | =VAL :bla"keks 14 | =VAL :foo 15 | -MAP 16 | +MAP 17 | =VAL :bla]keks 18 | =VAL :foo 19 | -MAP 20 | -SEQ 21 | -DOC 22 | -STR 23 | json: | 24 | [ 25 | { 26 | "bla\"keks": "foo" 27 | }, 28 | { 29 | "bla]keks": "foo" 30 | } 31 | ] 32 | -------------------------------------------------------------------------------- /testdata/yaml_suite/TE2A.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 8.16. Block Mappings 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2798147 4 | tags: spec mapping 5 | yaml: | 6 | block mapping: 7 | key: value 8 | tree: | 9 | +STR 10 | +DOC 11 | +MAP 12 | =VAL :block mapping 13 | +MAP 14 | =VAL :key 15 | =VAL :value 16 | -MAP 17 | -MAP 18 | -DOC 19 | -STR 20 | json: | 21 | { 22 | "block mapping": { 23 | "key": "value" 24 | } 25 | } 26 | dump: | 27 | block mapping: 28 | key: value 29 | -------------------------------------------------------------------------------- /testdata/yaml_suite/2AUY.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Tags in Block Sequence 3 | from: NimYAML tests 4 | tags: tag sequence 5 | yaml: |2 6 | - !!str a 7 | - b 8 | - !!int 42 9 | - d 10 | tree: | 11 | +STR 12 | +DOC 13 | +SEQ 14 | =VAL :a 15 | =VAL :b 16 | =VAL :42 17 | =VAL :d 18 | -SEQ 19 | -DOC 20 | -STR 21 | json: | 22 | [ 23 | "a", 24 | "b", 25 | 42, 26 | "d" 27 | ] 28 | dump: | 29 | - !!str a 30 | - b 31 | - !!int 42 32 | - d 33 | -------------------------------------------------------------------------------- /testdata/yaml_suite/6BFJ.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Mapping, key and flow sequence item anchors 3 | from: '@perlpunk' 4 | tags: anchor complex-key flow mapping sequence 5 | yaml: | 6 | --- 7 | &mapping 8 | &key [ &item a, b, c ]: value 9 | tree: | 10 | +STR 11 | +DOC --- 12 | +MAP &mapping 13 | +SEQ [] &key 14 | =VAL &item :a 15 | =VAL :b 16 | =VAL :c 17 | -SEQ 18 | =VAL :value 19 | -MAP 20 | -DOC 21 | -STR 22 | dump: | 23 | --- &mapping 24 | ? &key 25 | - &item a 26 | - b 27 | - c 28 | : value 29 | -------------------------------------------------------------------------------- /testdata/yaml_suite/DFF7.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 7.16. Flow Mapping Entries 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2791260 4 | tags: explicit-key spec flow mapping 5 | yaml: | 6 | { 7 | ? explicit: entry, 8 | implicit: entry, 9 | ? 10 | } 11 | tree: | 12 | +STR 13 | +DOC 14 | +MAP {} 15 | =VAL :explicit 16 | =VAL :entry 17 | =VAL :implicit 18 | =VAL :entry 19 | =VAL : 20 | =VAL : 21 | -MAP 22 | -DOC 23 | -STR 24 | dump: | 25 | explicit: entry 26 | implicit: entry 27 | : 28 | -------------------------------------------------------------------------------- /testdata/yaml_suite/L94M.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Tags in Explicit Mapping 3 | from: NimYAML tests 4 | tags: explicit-key tag mapping 5 | yaml: | 6 | ? !!str a 7 | : !!int 47 8 | ? c 9 | : !!str d 10 | tree: | 11 | +STR 12 | +DOC 13 | +MAP 14 | =VAL :a 15 | =VAL :47 16 | =VAL :c 17 | =VAL :d 18 | -MAP 19 | -DOC 20 | -STR 21 | json: | 22 | { 23 | "a": 47, 24 | "c": "d" 25 | } 26 | dump: | 27 | !!str a: !!int 47 28 | c: !!str d 29 | -------------------------------------------------------------------------------- /testdata/yaml_suite/HM87.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Scalars in flow start with syntax char 3 | from: '@ingydotnet' 4 | tags: flow scalar 5 | yaml: | 6 | [:x] 7 | tree: | 8 | +STR 9 | +DOC 10 | +SEQ [] 11 | =VAL ::x 12 | -SEQ 13 | -DOC 14 | -STR 15 | json: | 16 | [ 17 | ":x" 18 | ] 19 | dump: | 20 | - :x 21 | 22 | - yaml: | 23 | [?x] 24 | tree: | 25 | +STR 26 | +DOC 27 | +SEQ [] 28 | =VAL :?x 29 | -SEQ 30 | -DOC 31 | -STR 32 | json: | 33 | [ 34 | "?x" 35 | ] 36 | dump: | 37 | - ?x 38 | -------------------------------------------------------------------------------- /testdata/yaml_suite/SKE5.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Anchor before zero indented sequence 3 | from: '@perlpunk' 4 | tags: anchor indent sequence 5 | yaml: | 6 | --- 7 | seq: 8 | &anchor 9 | - a 10 | - b 11 | tree: | 12 | +STR 13 | +DOC --- 14 | +MAP 15 | =VAL :seq 16 | +SEQ &anchor 17 | =VAL :a 18 | =VAL :b 19 | -SEQ 20 | -MAP 21 | -DOC 22 | -STR 23 | json: | 24 | { 25 | "seq": [ 26 | "a", 27 | "b" 28 | ] 29 | } 30 | dump: | 31 | --- 32 | seq: &anchor 33 | - a 34 | - b 35 | -------------------------------------------------------------------------------- /testdata/yaml_suite/2G84.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Literal modifers 3 | from: '@ingydotnet' 4 | tags: literal scalar 5 | fail: true 6 | yaml: | 7 | --- |0 8 | tree: | 9 | +STR 10 | +DOC --- 11 | 12 | - fail: true 13 | yaml: | 14 | --- |10 15 | 16 | - yaml: | 17 | --- |1-∎ 18 | tree: | 19 | +STR 20 | +DOC --- 21 | =VAL | 22 | -DOC 23 | -STR 24 | json: | 25 | "" 26 | emit: | 27 | --- "" 28 | 29 | - yaml: | 30 | --- |1+∎ 31 | tree: | 32 | +STR 33 | +DOC --- 34 | =VAL | 35 | -DOC 36 | -STR 37 | emit: | 38 | --- "" 39 | -------------------------------------------------------------------------------- /testdata/yaml_suite/33X3.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Three explicit integers in a block sequence 3 | from: IRC 4 | tags: sequence tag 5 | yaml: | 6 | --- 7 | - !!int 1 8 | - !!int -2 9 | - !!int 33 10 | tree: | 11 | +STR 12 | +DOC --- 13 | +SEQ 14 | =VAL :1 15 | =VAL :-2 16 | =VAL :33 17 | -SEQ 18 | -DOC 19 | -STR 20 | json: | 21 | [ 22 | 1, 23 | -2, 24 | 33 25 | ] 26 | dump: | 27 | --- 28 | - !!int 1 29 | - !!int -2 30 | - !!int 33 31 | -------------------------------------------------------------------------------- /testdata/yaml_suite/96L6.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 2.14. In the folded scalars, newlines become spaces 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2761032 4 | tags: spec folded scalar 5 | yaml: | 6 | --- > 7 | Mark McGwire's 8 | year was crippled 9 | by a knee injury. 10 | tree: | 11 | +STR 12 | +DOC --- 13 | =VAL >Mark McGwire's year was crippled by a knee injury.\n 14 | -DOC 15 | -STR 16 | json: | 17 | "Mark McGwire's year was crippled by a knee injury.\n" 18 | dump: | 19 | --- > 20 | Mark McGwire's year was crippled by a knee injury. 21 | -------------------------------------------------------------------------------- /testdata/yaml_suite/NP9H.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 7.5. Double Quoted Line Breaks 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2787745 4 | tags: double spec scalar whitespace upto-1.2 5 | yaml: | 6 | "folded␣ 7 | to a space,» 8 | ␣ 9 | to a line feed, or »\ 10 | \ »non-content" 11 | tree: | 12 | +STR 13 | +DOC 14 | =VAL "folded to a space,\nto a line feed, or \t \tnon-content 15 | -DOC 16 | -STR 17 | json: | 18 | "folded to a space,\nto a line feed, or \t \tnon-content" 19 | dump: | 20 | "folded to a space,\nto a line feed, or \t \tnon-content" 21 | -------------------------------------------------------------------------------- /testdata/yaml_suite/WZ62.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 7.2. Empty Content 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2786720 4 | tags: spec flow scalar tag 5 | yaml: | 6 | { 7 | foo : !!str, 8 | !!str : bar, 9 | } 10 | tree: | 11 | +STR 12 | +DOC 13 | +MAP {} 14 | =VAL :foo 15 | =VAL : 16 | =VAL : 17 | =VAL :bar 18 | -MAP 19 | -DOC 20 | -STR 21 | json: | 22 | { 23 | "foo": "", 24 | "": "bar" 25 | } 26 | dump: | 27 | foo: !!str 28 | !!str : bar 29 | -------------------------------------------------------------------------------- /testdata/yaml_suite/6CK3.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 6.26. Tag Shorthands 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2785009 4 | tags: spec tag local-tag 5 | yaml: | 6 | %TAG !e! tag:example.com,2000:app/ 7 | --- 8 | - !local foo 9 | - !!str bar 10 | - !e!tag%21 baz 11 | tree: | 12 | +STR 13 | +DOC --- 14 | +SEQ 15 | =VAL :foo 16 | =VAL :bar 17 | =VAL :baz 18 | -SEQ 19 | -DOC 20 | -STR 21 | json: | 22 | [ 23 | "foo", 24 | "bar", 25 | "baz" 26 | ] 27 | -------------------------------------------------------------------------------- /testdata/yaml_suite/DWX9.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 8.8. Literal Content 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2796118 4 | tags: spec literal scalar comment whitespace 1.3-err 5 | yaml: | 6 | | 7 | ␣ 8 | ␣␣ 9 | literal 10 | ␣␣␣ 11 | ␣␣ 12 | text 13 | 14 | # Comment 15 | tree: | 16 | +STR 17 | +DOC 18 | =VAL |\n\nliteral\n \n\ntext\n 19 | -DOC 20 | -STR 21 | json: | 22 | "\n\nliteral\n \n\ntext\n" 23 | dump: | 24 | "\n\nliteral\n \n\ntext\n" 25 | emit: | 26 | | 27 | 28 | 29 | literal 30 | ␣␣␣ 31 | 32 | text 33 | -------------------------------------------------------------------------------- /testdata/yaml_suite/T26H.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 8.8. Literal Content [1.3] 3 | from: DWX9, modified for YAML 1.3 4 | tags: spec literal scalar comment whitespace 1.3-mod 5 | yaml: | 6 | --- | 7 | ␣ 8 | ␣␣ 9 | literal 10 | ␣␣␣ 11 | ␣␣ 12 | text 13 | 14 | # Comment 15 | tree: | 16 | +STR 17 | +DOC --- 18 | =VAL |\n\nliteral\n \n\ntext\n 19 | -DOC 20 | -STR 21 | json: | 22 | "\n\nliteral\n \n\ntext\n" 23 | dump: | 24 | "\n\nliteral\n \n\ntext\n" 25 | emit: | 26 | --- | 27 | 28 | 29 | literal 30 | ␣␣␣ 31 | 32 | text 33 | -------------------------------------------------------------------------------- /testdata/yaml_suite/4ABK.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Flow Mapping Separate Values 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2791704 4 | tags: flow mapping 5 | yaml: | 6 | { 7 | unquoted : "separate", 8 | http://foo.com, 9 | omitted value:, 10 | } 11 | tree: | 12 | +STR 13 | +DOC 14 | +MAP {} 15 | =VAL :unquoted 16 | =VAL "separate 17 | =VAL :http://foo.com 18 | =VAL : 19 | =VAL :omitted value 20 | =VAL : 21 | -MAP 22 | -DOC 23 | -STR 24 | dump: | 25 | unquoted: "separate" 26 | http://foo.com: null 27 | omitted value: null 28 | -------------------------------------------------------------------------------- /testdata/yaml_suite/9TFX.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 7.6. Double Quoted Lines [1.3] 3 | from: 7A4E, modified for YAML 1.3 4 | tags: double spec scalar whitespace 1.3-mod 5 | yaml: | 6 | --- 7 | " 1st non-empty 8 | 9 | 2nd non-empty␣ 10 | 3rd non-empty " 11 | tree: | 12 | +STR 13 | +DOC --- 14 | =VAL " 1st non-empty\n2nd non-empty 3rd non-empty␣ 15 | -DOC 16 | -STR 17 | json: | 18 | " 1st non-empty\n2nd non-empty 3rd non-empty " 19 | dump: | 20 | " 1st non-empty\n2nd non-empty 3rd non-empty " 21 | emit: | 22 | --- " 1st non-empty\n2nd non-empty 3rd non-empty " 23 | -------------------------------------------------------------------------------- /testdata/yaml_suite/ZWK4.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Key with anchor after missing explicit mapping value 3 | from: '@perlpunk' 4 | tags: anchor explicit-key mapping 5 | yaml: | 6 | --- 7 | a: 1 8 | ? b 9 | &anchor c: 3 10 | tree: | 11 | +STR 12 | +DOC --- 13 | +MAP 14 | =VAL :a 15 | =VAL :1 16 | =VAL :b 17 | =VAL : 18 | =VAL &anchor :c 19 | =VAL :3 20 | -MAP 21 | -DOC 22 | -STR 23 | json: | 24 | { 25 | "a": 1, 26 | "b": null, 27 | "c": 3 28 | } 29 | dump: | 30 | --- 31 | a: 1 32 | b: 33 | &anchor c: 3 34 | -------------------------------------------------------------------------------- /testdata/yaml_suite/LE5A.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 7.24. Flow Nodes 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2793490 4 | tags: spec tag alias 5 | yaml: | 6 | - !!str "a" 7 | - 'b' 8 | - &anchor "c" 9 | - *anchor 10 | - !!str 11 | tree: | 12 | +STR 13 | +DOC 14 | +SEQ 15 | =VAL "a 16 | =VAL 'b 17 | =VAL &anchor "c 18 | =ALI *anchor 19 | =VAL : 20 | -SEQ 21 | -DOC 22 | -STR 23 | json: | 24 | [ 25 | "a", 26 | "b", 27 | "c", 28 | "c", 29 | "" 30 | ] 31 | -------------------------------------------------------------------------------- /testdata/yaml_suite/X38W.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Aliases in Flow Objects 3 | from: NimYAML tests 4 | tags: alias complex-key flow 5 | yaml: | 6 | { &a [a, &b b]: *b, *a : [c, *b, d]} 7 | tree: | 8 | +STR 9 | +DOC 10 | +MAP {} 11 | +SEQ [] &a 12 | =VAL :a 13 | =VAL &b :b 14 | -SEQ 15 | =ALI *b 16 | =ALI *a 17 | +SEQ [] 18 | =VAL :c 19 | =ALI *b 20 | =VAL :d 21 | -SEQ 22 | -MAP 23 | -DOC 24 | -STR 25 | dump: | 26 | ? &a 27 | - a 28 | - &b b 29 | : *b 30 | *a : 31 | - c 32 | - *b 33 | - d 34 | -------------------------------------------------------------------------------- /testdata/yaml_suite/W4TN.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 9.5. Directives Documents 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2801606 4 | tags: spec header footer 1.3-err 5 | yaml: | 6 | %YAML 1.2 7 | --- | 8 | %!PS-Adobe-2.0 9 | ... 10 | %YAML 1.2 11 | --- 12 | # Empty 13 | ... 14 | tree: | 15 | +STR 16 | +DOC --- 17 | =VAL |%!PS-Adobe-2.0\n 18 | -DOC ... 19 | +DOC --- 20 | =VAL : 21 | -DOC ... 22 | -STR 23 | json: | 24 | "%!PS-Adobe-2.0\n" 25 | null 26 | dump: | 27 | --- | 28 | %!PS-Adobe-2.0 29 | ... 30 | --- 31 | ... 32 | -------------------------------------------------------------------------------- /testdata/yaml_suite/CUP7.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 5.6. Node Property Indicators 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2773402 4 | tags: local-tag spec tag alias 5 | yaml: | 6 | anchored: !local &anchor value 7 | alias: *anchor 8 | tree: | 9 | +STR 10 | +DOC 11 | +MAP 12 | =VAL :anchored 13 | =VAL &anchor :value 14 | =VAL :alias 15 | =ALI *anchor 16 | -MAP 17 | -DOC 18 | -STR 19 | json: | 20 | { 21 | "anchored": "value", 22 | "alias": "value" 23 | } 24 | dump: | 25 | anchored: &anchor !local value 26 | alias: *anchor 27 | -------------------------------------------------------------------------------- /testdata/yaml_suite/HMQ5.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 6.23. Node Properties 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2783940 4 | tags: spec tag alias 5 | yaml: | 6 | !!str &a1 "foo": 7 | !!str bar 8 | &a2 baz : *a1 9 | tree: | 10 | +STR 11 | +DOC 12 | +MAP 13 | =VAL &a1 "foo 14 | =VAL :bar 15 | =VAL &a2 :baz 16 | =ALI *a1 17 | -MAP 18 | -DOC 19 | -STR 20 | json: | 21 | { 22 | "foo": "bar", 23 | "baz": "foo" 24 | } 25 | dump: | 26 | &a1 !!str "foo": !!str bar 27 | &a2 baz: *a1 28 | -------------------------------------------------------------------------------- /testdata/yaml_suite/CFD4.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Empty implicit key in single pair flow sequences 3 | from: '@perlpunk' 4 | tags: empty-key flow sequence 5 | yaml: | 6 | - [ : empty key ] 7 | - [: another empty key] 8 | tree: | 9 | +STR 10 | +DOC 11 | +SEQ 12 | +SEQ [] 13 | +MAP {} 14 | =VAL : 15 | =VAL :empty key 16 | -MAP 17 | -SEQ 18 | +SEQ [] 19 | +MAP {} 20 | =VAL : 21 | =VAL :another empty key 22 | -MAP 23 | -SEQ 24 | -SEQ 25 | -DOC 26 | -STR 27 | dump: | 28 | - - : empty key 29 | - - : another empty key 30 | -------------------------------------------------------------------------------- /testdata/yaml_suite/F2C7.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Anchors and Tags 3 | from: NimYAML tests 4 | tags: anchor tag 5 | yaml: |2 6 | - &a !!str a 7 | - !!int 2 8 | - !!int &c 4 9 | - &d d 10 | tree: | 11 | +STR 12 | +DOC 13 | +SEQ 14 | =VAL &a :a 15 | =VAL :2 16 | =VAL &c :4 17 | =VAL &d :d 18 | -SEQ 19 | -DOC 20 | -STR 21 | json: | 22 | [ 23 | "a", 24 | 2, 25 | 4, 26 | "d" 27 | ] 28 | dump: | 29 | - &a !!str a 30 | - !!int 2 31 | - &c !!int 4 32 | - &d d 33 | -------------------------------------------------------------------------------- /testdata/yaml_suite/BU8L.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Node Anchor and Tag on Seperate Lines 3 | from: https://gist.github.com/anonymous/f192e7dab6da31831f264dbf1947cb83 via @ingydotnet 4 | tags: anchor indent 1.3-err tag 5 | yaml: | 6 | key: &anchor 7 | !!map 8 | a: b 9 | tree: | 10 | +STR 11 | +DOC 12 | +MAP 13 | =VAL :key 14 | +MAP &anchor 15 | =VAL :a 16 | =VAL :b 17 | -MAP 18 | -MAP 19 | -DOC 20 | -STR 21 | json: | 22 | { 23 | "key": { 24 | "a": "b" 25 | } 26 | } 27 | dump: | 28 | key: &anchor !!map 29 | a: b 30 | -------------------------------------------------------------------------------- /testdata/yaml_suite/D83L.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Block scalar indicator order 3 | from: '@perlpunk' 4 | tags: indent literal 5 | yaml: | 6 | - |2- 7 | explicit indent and chomp 8 | - |-2 9 | chomp and explicit indent 10 | tree: | 11 | +STR 12 | +DOC 13 | +SEQ 14 | =VAL |explicit indent and chomp 15 | =VAL |chomp and explicit indent 16 | -SEQ 17 | -DOC 18 | -STR 19 | json: | 20 | [ 21 | "explicit indent and chomp", 22 | "chomp and explicit indent" 23 | ] 24 | dump: | 25 | - |- 26 | explicit indent and chomp 27 | - |- 28 | chomp and explicit indent 29 | -------------------------------------------------------------------------------- /testdata/yaml_suite/DC7X.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Various trailing tabs 3 | from: '@perlpunk' 4 | tags: comment whitespace 5 | yaml: | 6 | a: b———» 7 | seq:———» 8 | - a———» 9 | c: d———»#X 10 | tree: | 11 | +STR 12 | +DOC 13 | +MAP 14 | =VAL :a 15 | =VAL :b 16 | =VAL :seq 17 | +SEQ 18 | =VAL :a 19 | -SEQ 20 | =VAL :c 21 | =VAL :d 22 | -MAP 23 | -DOC 24 | -STR 25 | json: | 26 | { 27 | "a": "b", 28 | "seq": [ 29 | "a" 30 | ], 31 | "c": "d" 32 | } 33 | dump: | 34 | a: b 35 | seq: 36 | - a 37 | c: d 38 | -------------------------------------------------------------------------------- /testdata/yaml_suite/MZX3.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Non-Specific Tags on Scalars 3 | from: NimYAML tests 4 | tags: folded scalar 5 | yaml: | 6 | - plain 7 | - "double quoted" 8 | - 'single quoted' 9 | - > 10 | block 11 | - plain again 12 | tree: | 13 | +STR 14 | +DOC 15 | +SEQ 16 | =VAL :plain 17 | =VAL "double quoted 18 | =VAL 'single quoted 19 | =VAL >block\n 20 | =VAL :plain again 21 | -SEQ 22 | -DOC 23 | -STR 24 | json: | 25 | [ 26 | "plain", 27 | "double quoted", 28 | "single quoted", 29 | "block\n", 30 | "plain again" 31 | ] 32 | -------------------------------------------------------------------------------- /testdata/yaml_suite/PRH3.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 7.9. Single Quoted Lines 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2788756 4 | tags: single spec scalar whitespace upto-1.2 5 | yaml: | 6 | ' 1st non-empty 7 | 8 | 2nd non-empty␣ 9 | ———»3rd non-empty ' 10 | tree: | 11 | +STR 12 | +DOC 13 | =VAL ' 1st non-empty\n2nd non-empty 3rd non-empty␣ 14 | -DOC 15 | -STR 16 | json: | 17 | " 1st non-empty\n2nd non-empty 3rd non-empty " 18 | dump: | 19 | ' 1st non-empty 20 | 21 | 2nd non-empty 3rd non-empty ' 22 | emit: | 23 | ' 1st non-empty 24 | 25 | 2nd non-empty 3rd non-empty ' 26 | -------------------------------------------------------------------------------- /testdata/yaml_suite/T4YY.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 7.9. Single Quoted Lines [1.3] 3 | from: PRH3, modified for YAML 1.3 4 | tags: single spec scalar whitespace 1.3-mod 5 | yaml: | 6 | --- 7 | ' 1st non-empty 8 | 9 | 2nd non-empty␣ 10 | 3rd non-empty ' 11 | tree: | 12 | +STR 13 | +DOC --- 14 | =VAL ' 1st non-empty\n2nd non-empty 3rd non-empty␣ 15 | -DOC 16 | -STR 17 | json: | 18 | " 1st non-empty\n2nd non-empty 3rd non-empty " 19 | dump: | 20 | ' 1st non-empty 21 | 22 | 2nd non-empty 3rd non-empty ' 23 | emit: | 24 | --- ' 1st non-empty 25 | 26 | 2nd non-empty 3rd non-empty ' 27 | -------------------------------------------------------------------------------- /testdata/yaml_suite/EHF6.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Tags for Flow Objects 3 | from: NimYAML tests 4 | tags: tag flow mapping sequence 5 | yaml: | 6 | !!map { 7 | k: !!seq 8 | [ a, !!str b] 9 | } 10 | tree: | 11 | +STR 12 | +DOC 13 | +MAP {} 14 | =VAL :k 15 | +SEQ [] 16 | =VAL :a 17 | =VAL :b 18 | -SEQ 19 | -MAP 20 | -DOC 21 | -STR 22 | json: | 23 | { 24 | "k": [ 25 | "a", 26 | "b" 27 | ] 28 | } 29 | dump: | 30 | !!map 31 | k: !!seq 32 | - a 33 | - !!str b 34 | -------------------------------------------------------------------------------- /testdata/yaml_suite/V9D5.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 8.19. Compact Block Mappings 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2799091 4 | tags: complex-key explicit-key spec mapping 5 | yaml: | 6 | - sun: yellow 7 | - ? earth: blue 8 | : moon: white 9 | tree: | 10 | +STR 11 | +DOC 12 | +SEQ 13 | +MAP 14 | =VAL :sun 15 | =VAL :yellow 16 | -MAP 17 | +MAP 18 | +MAP 19 | =VAL :earth 20 | =VAL :blue 21 | -MAP 22 | +MAP 23 | =VAL :moon 24 | =VAL :white 25 | -MAP 26 | -MAP 27 | -SEQ 28 | -DOC 29 | -STR 30 | -------------------------------------------------------------------------------- /testdata/yaml_suite/6SLA.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Allowed characters in quoted mapping key 3 | from: '@perlpunk' 4 | tags: mapping single double 5 | yaml: | 6 | "foo\nbar:baz\tx \\$%^&*()x": 23 7 | 'x\ny:z\tx $%^&*()x': 24 8 | tree: | 9 | +STR 10 | +DOC 11 | +MAP 12 | =VAL "foo\nbar:baz\tx \\$%^&*()x 13 | =VAL :23 14 | =VAL 'x\\ny:z\\tx $%^&*()x 15 | =VAL :24 16 | -MAP 17 | -DOC 18 | -STR 19 | json: | 20 | { 21 | "foo\nbar:baz\tx \\$%^&*()x": 23, 22 | "x\\ny:z\\tx $%^&*()x": 24 23 | } 24 | dump: | 25 | ? "foo\nbar:baz\tx \\$%^&*()x" 26 | : 23 27 | 'x\ny:z\tx $%^&*()x': 24 28 | -------------------------------------------------------------------------------- /testdata/yaml_suite/Z67P.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 8.21. Block Scalar Nodes [1.3] 3 | from: M5C3, modified for YAML 1.3 4 | tags: indent spec literal folded tag local-tag 1.3-mod 5 | yaml: | 6 | literal: |2 7 | value 8 | folded: !foo >1 9 | value 10 | tree: | 11 | +STR 12 | +DOC 13 | +MAP 14 | =VAL :literal 15 | =VAL |value\n 16 | =VAL :folded 17 | =VAL >value\n 18 | -MAP 19 | -DOC 20 | -STR 21 | json: | 22 | { 23 | "literal": "value\n", 24 | "folded": "value\n" 25 | } 26 | dump: | 27 | literal: | 28 | value 29 | folded: !foo > 30 | value 31 | -------------------------------------------------------------------------------- /testdata/yaml_suite/S3PD.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 8.18. Implicit Block Mapping Entries 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2798896 4 | tags: empty-key spec mapping 5 | yaml: | 6 | plain key: in-line value 7 | : # Both empty 8 | "quoted key": 9 | - entry 10 | tree: | 11 | +STR 12 | +DOC 13 | +MAP 14 | =VAL :plain key 15 | =VAL :in-line value 16 | =VAL : 17 | =VAL : 18 | =VAL "quoted key 19 | +SEQ 20 | =VAL :entry 21 | -SEQ 22 | -MAP 23 | -DOC 24 | -STR 25 | emit: | 26 | plain key: in-line value 27 | : 28 | "quoted key": 29 | - entry 30 | -------------------------------------------------------------------------------- /testdata/yaml_suite/UT92.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 9.4. Explicit Documents 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2801448 4 | tags: flow spec header footer comment 5 | yaml: | 6 | --- 7 | { matches 8 | % : 20 } 9 | ... 10 | --- 11 | # Empty 12 | ... 13 | tree: | 14 | +STR 15 | +DOC --- 16 | +MAP {} 17 | =VAL :matches % 18 | =VAL :20 19 | -MAP 20 | -DOC ... 21 | +DOC --- 22 | =VAL : 23 | -DOC ... 24 | -STR 25 | json: | 26 | { 27 | "matches %": 20 28 | } 29 | null 30 | dump: | 31 | --- 32 | matches %: 20 33 | ... 34 | --- 35 | ... 36 | -------------------------------------------------------------------------------- /testdata/yaml_suite/9WXW.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 6.18. Primary Tag Handle 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2782728 4 | tags: local-tag spec directive tag unknown-tag 1.3-err 5 | yaml: | 6 | # Private 7 | !foo "bar" 8 | ... 9 | # Global 10 | %TAG ! tag:example.com,2000:app/ 11 | --- 12 | !foo "bar" 13 | tree: | 14 | +STR 15 | +DOC 16 | =VAL "bar 17 | -DOC ... 18 | +DOC --- 19 | =VAL "bar 20 | -DOC 21 | -STR 22 | json: | 23 | "bar" 24 | "bar" 25 | dump: | 26 | !foo "bar" 27 | ... 28 | --- ! "bar" 29 | -------------------------------------------------------------------------------- /testdata/yaml_suite/M6YH.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Block sequence indentation 3 | from: '@ingydotnet' 4 | tags: indent 5 | yaml: | 6 | - | 7 | x 8 | - 9 | foo: bar 10 | - 11 | - 42 12 | tree: | 13 | +STR 14 | +DOC 15 | +SEQ 16 | =VAL |x\n 17 | +MAP 18 | =VAL :foo 19 | =VAL :bar 20 | -MAP 21 | +SEQ 22 | =VAL :42 23 | -SEQ 24 | -SEQ 25 | -DOC 26 | -STR 27 | json: | 28 | [ 29 | "x\n", 30 | { 31 | "foo" : "bar" 32 | }, 33 | [ 34 | 42 35 | ] 36 | ] 37 | dump: | 38 | - | 39 | x 40 | - foo: bar 41 | - - 42 42 | -------------------------------------------------------------------------------- /testdata/yaml_suite/ZK9H.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Nested top level flow mapping 3 | from: '@perlpunk' 4 | tags: flow indent mapping sequence 5 | yaml: | 6 | { key: [[[ 7 | value 8 | ]]] 9 | } 10 | tree: | 11 | +STR 12 | +DOC 13 | +MAP {} 14 | =VAL :key 15 | +SEQ [] 16 | +SEQ [] 17 | +SEQ [] 18 | =VAL :value 19 | -SEQ 20 | -SEQ 21 | -SEQ 22 | -MAP 23 | -DOC 24 | -STR 25 | json: | 26 | { 27 | "key": [ 28 | [ 29 | [ 30 | "value" 31 | ] 32 | ] 33 | ] 34 | } 35 | dump: | 36 | key: 37 | - - - value 38 | -------------------------------------------------------------------------------- /testdata/yaml_suite/ZYU8.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - skip: true 3 | note: The following cases are valid YAML according to the 1.2 productions but 4 | not at all usefully valid. We don't want to encourage parsers to support 5 | them when we'll likely make them invalid later. 6 | also: MU58 7 | name: Directive variants 8 | from: '@ingydotnet' 9 | tags: directive 10 | yaml: | 11 | %YAML1.1 12 | --- 13 | tree: | 14 | +STR 15 | +DOC --- 16 | =VAL : 17 | -DOC 18 | -STR 19 | json: | 20 | null 21 | 22 | - yaml: | 23 | %*** 24 | --- 25 | 26 | - yaml: | 27 | %YAML 1.1 1.2 28 | --- 29 | 30 | - yaml: | 31 | %YAML 1.12345 32 | --- 33 | -------------------------------------------------------------------------------- /testdata/yaml_suite/K858.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 8.6. Empty Scalar Chomping 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2795596 4 | tags: spec folded literal whitespace 5 | yaml: | 6 | strip: >- 7 | 8 | clip: > 9 | 10 | keep: |+ 11 | ↵ 12 | tree: | 13 | +STR 14 | +DOC 15 | +MAP 16 | =VAL :strip 17 | =VAL > 18 | =VAL :clip 19 | =VAL > 20 | =VAL :keep 21 | =VAL |\n 22 | -MAP 23 | -DOC 24 | -STR 25 | json: | 26 | { 27 | "strip": "", 28 | "clip": "", 29 | "keep": "\n" 30 | } 31 | dump: | 32 | strip: "" 33 | clip: "" 34 | keep: |2+ 35 | 36 | ... 37 | -------------------------------------------------------------------------------- /testdata/yaml_suite/M7A3.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 9.3. Bare Documents 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2801226 4 | tags: spec footer 1.3-err 5 | yaml: | 6 | Bare 7 | document 8 | ... 9 | # No document 10 | ... 11 | | 12 | %!PS-Adobe-2.0 # Not the first line 13 | tree: | 14 | +STR 15 | +DOC 16 | =VAL :Bare document 17 | -DOC ... 18 | +DOC 19 | =VAL |%!PS-Adobe-2.0 # Not the first line\n 20 | -DOC 21 | -STR 22 | json: | 23 | "Bare document" 24 | "%!PS-Adobe-2.0 # Not the first line\n" 25 | emit: | 26 | Bare document 27 | ... 28 | | 29 | %!PS-Adobe-2.0 # Not the first line 30 | -------------------------------------------------------------------------------- /testdata/yaml_suite/RLU9.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Sequence Indent 3 | from: https://github.com/ingydotnet/yaml-pegex-pm/blob/master/test/indent.tml 4 | tags: sequence indent 5 | yaml: | 6 | foo: 7 | - 42 8 | bar: 9 | - 44 10 | tree: | 11 | +STR 12 | +DOC 13 | +MAP 14 | =VAL :foo 15 | +SEQ 16 | =VAL :42 17 | -SEQ 18 | =VAL :bar 19 | +SEQ 20 | =VAL :44 21 | -SEQ 22 | -MAP 23 | -DOC 24 | -STR 25 | json: | 26 | { 27 | "foo": [ 28 | 42 29 | ], 30 | "bar": [ 31 | 44 32 | ] 33 | } 34 | dump: | 35 | foo: 36 | - 42 37 | bar: 38 | - 44 39 | -------------------------------------------------------------------------------- /testdata/yaml_suite/UKK6.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Syntax character edge cases 3 | from: '@ingydotnet' 4 | tags: edge empty-key 5 | yaml: | 6 | - : 7 | tree: | 8 | +STR 9 | +DOC 10 | +SEQ 11 | +MAP 12 | =VAL : 13 | =VAL : 14 | -MAP 15 | -SEQ 16 | -DOC 17 | -STR 18 | 19 | - yaml: | 20 | :: 21 | tree: | 22 | +STR 23 | +DOC 24 | +MAP 25 | =VAL :: 26 | =VAL : 27 | -MAP 28 | -DOC 29 | -STR 30 | json: | 31 | { 32 | ":": null 33 | } 34 | 35 | - yaml: | 36 | ! 37 | tree: | 38 | +STR 39 | +DOC 40 | =VAL : 41 | -DOC 42 | -STR 43 | json: null 44 | -------------------------------------------------------------------------------- /testdata/yaml_suite/SYW4.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 2.2. Mapping Scalars to Scalars 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2759963 4 | tags: spec scalar comment 5 | yaml: | 6 | hr: 65 # Home runs 7 | avg: 0.278 # Batting average 8 | rbi: 147 # Runs Batted In 9 | tree: | 10 | +STR 11 | +DOC 12 | +MAP 13 | =VAL :hr 14 | =VAL :65 15 | =VAL :avg 16 | =VAL :0.278 17 | =VAL :rbi 18 | =VAL :147 19 | -MAP 20 | -DOC 21 | -STR 22 | json: | 23 | { 24 | "hr": 65, 25 | "avg": 0.278, 26 | "rbi": 147 27 | } 28 | dump: | 29 | hr: 65 30 | avg: 0.278 31 | rbi: 147 32 | -------------------------------------------------------------------------------- /testdata/yaml_suite/Q8AD.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 7.5. Double Quoted Line Breaks [1.3] 3 | from: NP9H, modified for YAML 1.3 4 | tags: double spec scalar whitespace 1.3-mod 5 | yaml: | 6 | --- 7 | "folded␣ 8 | to a space, 9 | ␣ 10 | to a line feed, or »\ 11 | \ »non-content" 12 | tree: | 13 | +STR 14 | +DOC --- 15 | =VAL "folded to a space,\nto a line feed, or \t \tnon-content 16 | -DOC 17 | -STR 18 | json: | 19 | "folded to a space,\nto a line feed, or \t \tnon-content" 20 | dump: | 21 | "folded to a space,\nto a line feed, or \t \tnon-content" 22 | emit: | 23 | --- "folded to a space,\nto a line feed, or \t \tnon-content" 24 | -------------------------------------------------------------------------------- /testdata/yaml_suite/M5C3.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 8.21. Block Scalar Nodes 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2799693 4 | tags: indent spec literal folded tag local-tag 1.3-err 5 | yaml: | 6 | literal: |2 7 | value 8 | folded: 9 | !foo 10 | >1 11 | value 12 | tree: | 13 | +STR 14 | +DOC 15 | +MAP 16 | =VAL :literal 17 | =VAL |value\n 18 | =VAL :folded 19 | =VAL >value\n 20 | -MAP 21 | -DOC 22 | -STR 23 | json: | 24 | { 25 | "literal": "value\n", 26 | "folded": "value\n" 27 | } 28 | dump: | 29 | literal: | 30 | value 31 | folded: !foo > 32 | value 33 | -------------------------------------------------------------------------------- /testdata/yaml_suite/5BVJ.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Spec Example 5.7. Block Scalar Indicators 3 | from: http://www.yaml.org/spec/1.2/spec.html#id2773653 4 | tags: spec literal folded scalar 5 | yaml: | 6 | literal: | 7 | some 8 | text 9 | folded: > 10 | some 11 | text 12 | tree: | 13 | +STR 14 | +DOC 15 | +MAP 16 | =VAL :literal 17 | =VAL |some\ntext\n 18 | =VAL :folded 19 | =VAL >some text\n 20 | -MAP 21 | -DOC 22 | -STR 23 | json: | 24 | { 25 | "literal": "some\ntext\n", 26 | "folded": "some text\n" 27 | } 28 | dump: | 29 | literal: | 30 | some 31 | text 32 | folded: > 33 | some text 34 | --------------------------------------------------------------------------------