this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

imore

+263 -113
+2
yaml/ocaml-yamle/.gitignore
··· 1 1 _build 2 + *.cmi 3 + *.cmo
+9 -5
yaml/ocaml-yamle/bin/dune
··· 8 8 (libraries yamle)) 9 9 10 10 (executable 11 - (name test_anchor) 11 + (name test_remaining) 12 12 (libraries yamle)) 13 13 14 14 (executable 15 - (name test_anchor_comprehensive) 15 + (name test_scan) 16 16 (libraries yamle)) 17 17 18 18 (executable 19 - (name test_anchor_boundaries) 19 + (name test_empty) 20 20 (libraries yamle)) 21 21 22 22 (executable 23 - (name test_alias) 23 + (name test_specific) 24 24 (libraries yamle)) 25 25 26 26 (executable 27 - (name test_anchor_fix_final) 27 + (name test_detailed) 28 + (libraries yamle test_suite_lib)) 29 + 30 + (executable 31 + (name test_empty_final) 28 32 (libraries yamle))
+26 -7
yaml/ocaml-yamle/lib/parser.ml
··· 127 127 Error.raise_span tok.span (Invalid_yaml_version "duplicate YAML directive"); 128 128 t.version <- Some (major, minor) 129 129 | Token.Tag_directive { handle; prefix } -> 130 - if List.mem_assoc handle t.tag_directives && 131 - handle <> "!" && handle <> "!!" then 132 - Error.raise_span tok.span (Invalid_tag_directive ("duplicate tag handle: " ^ handle)); 133 - t.tag_directives <- (handle, prefix) :: t.tag_directives 130 + (* Skip empty tag directives (these are reserved/unknown directives that were ignored) *) 131 + if handle = "" && prefix = "" then 132 + () (* Ignore reserved directives *) 133 + else begin 134 + if List.mem_assoc handle t.tag_directives && 135 + handle <> "!" && handle <> "!!" then 136 + Error.raise_span tok.span (Invalid_tag_directive ("duplicate tag handle: " ^ handle)); 137 + t.tag_directives <- (handle, prefix) :: t.tag_directives 138 + end 134 139 | _ -> () 135 140 done 136 141 ··· 458 463 let tok = current_token t in 459 464 match tok.token with 460 465 | Token.Flow_sequence_end -> 461 - t.state <- Flow_sequence_entry; 462 - empty_scalar_event ~anchor:None ~tag:None tok.span 466 + (* Trailing comma case - don't emit empty scalar, just go back to sequence entry state *) 467 + skip_token t; 468 + t.state <- pop_state t; 469 + Event.Sequence_end, tok.span 463 470 | Token.Flow_entry -> 464 471 (* Double comma or comma after comma - invalid *) 465 472 Error.raise_span tok.span (Unexpected_token "unexpected ',' in flow sequence") 466 473 | Token.Key -> 467 474 skip_token t; 468 - push_state t Flow_sequence_entry_mapping_end; 475 + t.state <- Flow_sequence_entry_mapping_key; 476 + Event.Mapping_start { 477 + anchor = None; tag = None; 478 + implicit = true; 479 + style = Layout_style.Flow; 480 + }, tok.span 481 + | Token.Value -> 482 + (* Implicit empty key mapping: [ : value ] *) 469 483 t.state <- Flow_sequence_entry_mapping_key; 470 484 Event.Mapping_start { 471 485 anchor = None; tag = None; ··· 587 601 parse_stream_start t 588 602 589 603 | Implicit_document_start -> 604 + (* Skip any document end markers before checking what's next *) 605 + while check t (function Token.Document_end -> true | _ -> false) do 606 + skip_token t 607 + done; 608 + 590 609 let tok = current_token t in 591 610 (match tok.token with 592 611 | Token.Stream_end ->
+184 -60
yaml/ocaml-yamle/lib/scanner.ml
··· 29 29 mutable allow_simple_key : bool; 30 30 mutable leading_whitespace : bool; (** True when at start of line (only whitespace seen) *) 31 31 mutable document_has_content : bool; (** True if we've emitted content tokens in current document *) 32 + mutable adjacent_value_allowed_at : Position.t option; (** Position where adjacent : is allowed *) 33 + mutable pending_value : bool; (** True if we've emitted a KEY and are waiting for VALUE *) 32 34 } 33 35 34 36 let create input = ··· 46 48 allow_simple_key = true; 47 49 leading_whitespace = true; (* Start at beginning of stream *) 48 50 document_has_content = false; 51 + adjacent_value_allowed_at = None; 52 + pending_value = false; 49 53 } 50 54 51 55 let of_string s = create (Input.of_string s) ··· 63 67 (** Get current indent level *) 64 68 let current_indent t = 65 69 match t.indent_stack with 66 - | [] -> 0 70 + | [] -> -1 67 71 | { indent; _ } :: _ -> indent 68 72 69 73 (** Skip whitespace to end of line, checking for valid comments. ··· 79 83 if Input.next_is (( = ) '#') t.input then begin 80 84 (* Validate: comment must be preceded by whitespace or be at start of line *) 81 85 if not !has_whitespace then begin 82 - (* Check if we're at the start of input or after a line break *) 86 + (* Check if we're at the start of input or after whitespace (blank or line break) *) 83 87 match Input.peek_back t.input with 84 88 | None -> () (* Start of input - OK *) 85 - | Some c when Input.is_break c -> () (* After line break - OK *) 89 + | Some c when Input.is_whitespace c -> () (* After whitespace - OK *) 86 90 | _ -> 87 91 (* Comment not preceded by whitespace - ERROR *) 88 92 Error.raise_at (Input.mark t.input) Invalid_comment ··· 107 111 (* Check for tabs used as indentation in block context *) 108 112 (match Input.peek t.input with 109 113 | Some '\t' when t.flow_level = 0 && t.leading_whitespace && 110 - (column t - 1) <= current_indent t -> 114 + (column t - 1) < current_indent t -> 111 115 (* Tab found in indentation zone - this is invalid *) 112 116 (* Skip to end of line to check if line has content *) 113 117 let start_pos = Input.mark t.input in ··· 129 133 skip_to_next_token t 130 134 end 131 135 else if t.flow_level > 0 && Input.next_is_whitespace t.input then begin 132 - ignore (Input.next t.input); 133 - skip_to_next_token t 136 + (* In flow context, skip all whitespace including line breaks *) 137 + if Input.next_is_break t.input then begin 138 + Input.consume_break t.input; 139 + (* Allow simple keys after line breaks in flow context *) 140 + t.allow_simple_key <- true; 141 + skip_to_next_token t 142 + end else begin 143 + ignore (Input.next t.input); 144 + skip_to_next_token t 145 + end 134 146 end 135 147 136 148 (** Roll the indentation level *) ··· 253 265 254 266 (** Scan tag suffix (after handle) *) 255 267 let scan_tag_suffix t = 268 + let is_hex_digit c = 269 + (c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f') 270 + in 271 + let hex_val c = 272 + match c with 273 + | '0'..'9' -> Char.code c - Char.code '0' 274 + | 'A'..'F' -> Char.code c - Char.code 'A' + 10 275 + | 'a'..'f' -> Char.code c - Char.code 'a' + 10 276 + | _ -> 0 277 + in 256 278 let buf = Buffer.create 32 in 257 279 while 258 280 match Input.peek t.input with 281 + | Some '%' -> 282 + (* Percent-encoded character *) 283 + ignore (Input.next t.input); 284 + (match Input.peek t.input, Input.peek_nth t.input 1 with 285 + | Some c1, Some c2 when is_hex_digit c1 && is_hex_digit c2 -> 286 + ignore (Input.next t.input); 287 + ignore (Input.next t.input); 288 + let code = (hex_val c1) * 16 + (hex_val c2) in 289 + Buffer.add_char buf (Char.chr code); 290 + true 291 + | _ -> 292 + (* Invalid percent encoding - keep the % *) 293 + Buffer.add_char buf '%'; 294 + true) 259 295 | Some c when not (Input.is_whitespace c) && 260 296 not (Input.is_flow_indicator c) -> 261 297 Buffer.add_char buf c; ··· 396 432 let start = Input.mark t.input in 397 433 ignore (Input.next t.input); (* consume opening double-quote *) 398 434 let buf = Buffer.create 64 in 435 + let whitespace = Buffer.create 16 in (* Track pending whitespace *) 436 + 437 + let flush_whitespace () = 438 + if Buffer.length whitespace > 0 then begin 439 + Buffer.add_buffer buf whitespace; 440 + Buffer.clear whitespace 441 + end 442 + in 443 + 399 444 let rec loop () = 400 445 match Input.peek t.input with 401 446 | None -> Error.raise_at start Unclosed_double_quote 402 447 | Some '"' -> 448 + (* Flush trailing whitespace before closing quote to preserve it *) 449 + flush_whitespace (); 403 450 ignore (Input.next t.input) 451 + | Some ' ' | Some '\t' as c_opt -> 452 + (* Track whitespace - don't add to buf yet *) 453 + let c = match c_opt with Some c -> c | None -> assert false in 454 + Buffer.add_char whitespace c; 455 + ignore (Input.next t.input); 456 + loop () 404 457 | Some '\\' -> 458 + (* Escape sequence - this is non-whitespace content *) 459 + flush_whitespace (); (* Commit any pending whitespace *) 405 460 ignore (Input.next t.input); 406 461 (match Input.peek t.input with 407 462 | None -> Error.raise_at start (Invalid_escape_sequence "\\<EOF>") ··· 432 487 ignore (Input.next t.input); 433 488 Buffer.add_string buf (decode_hex t 8) 434 489 | Some '\n' | Some '\r' -> 435 - (* Line continuation *) 490 + (* Line continuation escape *) 436 491 Input.consume_break t.input; 437 492 while Input.next_is_blank t.input do 438 493 ignore (Input.next t.input) ··· 442 497 (Invalid_escape_sequence (Printf.sprintf "\\%c" c))); 443 498 loop () 444 499 | Some '\n' | Some '\r' -> 445 - (* Per YAML spec: discard trailing whitespace before line break *) 446 - let len = Buffer.length buf in 447 - let rec trim_end i = 448 - if i < 0 then 0 449 - else match Buffer.nth buf i with 450 - | ' ' | '\t' -> trim_end (i - 1) 451 - | _ -> i + 1 452 - in 453 - Buffer.truncate buf (trim_end (len - 1)); 500 + (* Line break: discard any pending trailing whitespace *) 501 + Buffer.clear whitespace; 454 502 Input.consume_break t.input; 455 503 (* Count consecutive line breaks (empty lines) *) 456 504 let empty_lines = ref 0 in ··· 481 529 Buffer.add_char buf ' '; 482 530 loop () 483 531 | Some c -> 532 + (* Non-whitespace character *) 533 + flush_whitespace (); (* Commit any pending whitespace *) 484 534 Buffer.add_char buf c; 485 535 ignore (Input.next t.input); 486 536 loop () ··· 516 566 let start = Input.mark t.input in 517 567 let in_flow = t.flow_level > 0 in 518 568 let indent = current_indent t in 519 - (* Validate flow collection indentation *) 520 - if in_flow && (column t) < t.flow_indent then 569 + (* In flow context, scalars must be indented more than the current block indent. 570 + This ensures that content at block indent or less ends the flow context. *) 571 + if in_flow && (column t - 1) < indent then 521 572 Error.raise_at start Invalid_flow_indentation; 522 573 let buf = Buffer.create 64 in 523 574 let spaces = Buffer.create 16 in 575 + let whitespace = Buffer.create 16 in (* Track whitespace within a line *) 524 576 let leading_blanks = ref false in 525 577 526 578 let rec scan_line () = 527 579 match Input.peek t.input with 528 580 | None -> () 581 + | Some c when Input.is_blank c && can_continue_plain t c ~in_flow -> 582 + (* Blank character within a line - save to whitespace buffer *) 583 + Buffer.add_char whitespace c; 584 + ignore (Input.next t.input); 585 + scan_line () 529 586 | Some c when can_continue_plain t c ~in_flow -> 530 - (* can_continue_plain already handles # correctly - it returns false 531 - when # is preceded by whitespace (making it a comment indicator) *) 587 + (* Non-blank character - process any pending breaks/whitespace first *) 532 588 begin 533 589 if Buffer.length spaces > 0 then begin 534 590 if !leading_blanks then begin ··· 544 600 Buffer.add_buffer buf spaces; 545 601 Buffer.clear spaces 546 602 end; 603 + (* Add any pending whitespace from within the line *) 604 + if Buffer.length whitespace > 0 then begin 605 + Buffer.add_buffer buf whitespace; 606 + Buffer.clear whitespace 607 + end; 608 + (* Add the character *) 547 609 Buffer.add_char buf c; 548 610 ignore (Input.next t.input); 549 611 leading_blanks := false; ··· 555 617 let rec scan_lines () = 556 618 scan_line (); 557 619 (* Check for line continuation *) 558 - if not in_flow && Input.next_is_break t.input then begin 620 + if Input.next_is_break t.input then begin 621 + (* Discard any trailing whitespace from the current line *) 622 + Buffer.clear whitespace; 559 623 (* Save the line break *) 560 624 if !leading_blanks then begin 561 625 (* We already had a break - this is an additional break (empty line) *) ··· 567 631 leading_blanks := true 568 632 end; 569 633 Input.consume_break t.input; 570 - (* Line break in block context allows simple key *) 571 - t.allow_simple_key <- true; 634 + (* Line break allows simple key in both block and flow contexts *) 635 + if in_flow then 636 + t.allow_simple_key <- true; 637 + if not in_flow then 638 + t.allow_simple_key <- true; 572 639 (* Skip leading blanks on the next line *) 573 640 while Input.next_is_blank t.input do 574 641 ignore (Input.next t.input) 575 642 done; 576 643 let col = (Input.position t.input).column in 577 644 (* Check indentation - stop if we're at or before the containing block's indent *) 578 - if not in_flow && col <= indent then 579 - () (* Stop - dedented or at parent level *) 645 + (* However, allow empty lines (line breaks) to continue even if dedented *) 646 + if Input.next_is_break t.input then 647 + scan_lines () (* Empty line - continue *) 648 + else if not in_flow && col <= indent then 649 + () (* Stop - dedented or at parent level in block context *) 580 650 else if Input.at_document_boundary t.input then 581 651 () (* Stop - document boundary *) 582 652 else ··· 652 722 653 723 let buf = Buffer.create 256 in 654 724 let trailing_breaks = Buffer.create 16 in 725 + let leading_blank = ref false in (* Was the previous line "more indented"? *) 655 726 656 727 (* Skip to content indentation, skipping empty lines. 657 728 Returns the number of spaces actually skipped (important for detecting dedentation). *) ··· 686 757 (* Check if we found a break (empty line) or content *) 687 758 (match Input.peek_nth t.input (!idx) with 688 759 | None | Some '\n' | Some '\r' -> 689 - (* Empty line - consume all blanks and break *) 690 - while Input.next_is_blank t.input do 691 - ignore (Input.next t.input) 692 - done; 760 + (* Empty line - preserve spaces for literal scalars *) 761 + if literal then begin 762 + while Input.next_is_blank t.input do 763 + Buffer.add_char trailing_breaks ' '; 764 + ignore (Input.next t.input) 765 + done 766 + end else begin 767 + while Input.next_is_blank t.input do 768 + ignore (Input.next t.input) 769 + done 770 + end; 693 771 Buffer.add_char trailing_breaks '\n'; 694 772 Input.consume_break t.input; 695 773 skip_to_content_indent () ··· 748 826 let line_indent = spaces_skipped + !extra_spaces in 749 827 750 828 (* Determine content indent from first content line (implicit case) *) 829 + let first_line = !content_indent = 0 in 751 830 if !content_indent = 0 then begin 752 831 if line_indent <= base_indent then begin 753 832 (* No content - restore position conceptually *) ··· 760 839 (* Dedented - done with content *) 761 840 () 762 841 end else begin 842 + (* Check if current line is "more indented" (has extra indent beyond content_indent) *) 843 + let trailing_blank = line_indent > !content_indent in 844 + 763 845 (* Add trailing breaks to buffer *) 764 846 if Buffer.length buf > 0 then begin 765 847 if Buffer.length trailing_breaks > 0 then begin 766 848 if literal then 767 849 Buffer.add_buffer buf trailing_breaks 768 850 else begin 769 - let breaks = Buffer.contents trailing_breaks in 770 - if String.length breaks = 1 then 771 - Buffer.add_char buf ' ' 772 - else 773 - Buffer.add_substring buf breaks 1 (String.length breaks - 1) 851 + (* Folded scalar: fold only if both previous and current lines are not more-indented *) 852 + if not !leading_blank && not trailing_blank then begin 853 + let breaks = Buffer.contents trailing_breaks in 854 + if String.length breaks = 1 then 855 + Buffer.add_char buf ' ' 856 + else 857 + Buffer.add_substring buf breaks 1 (String.length breaks - 1) 858 + end else begin 859 + (* Preserve breaks for more-indented lines *) 860 + Buffer.add_buffer buf trailing_breaks 861 + end 774 862 end 775 863 end else if not literal then 776 864 Buffer.add_char buf ' ' ··· 778 866 Buffer.add_buffer buf trailing_breaks; 779 867 Buffer.clear trailing_breaks; 780 868 781 - (* Add extra indentation for literal *) 782 - if literal then begin 783 - for _ = !content_indent + 1 to line_indent do 869 + (* Add extra indentation for literal or more-indented folded lines *) 870 + (* On the first line (when determining content_indent), we've already consumed all spaces, 871 + so we should NOT add any back. On subsequent lines, we add only the spaces beyond content_indent. *) 872 + if not first_line && (literal || (!extra_spaces > 0 && not literal)) then begin 873 + for _ = 1 to !extra_spaces do 784 874 Buffer.add_char buf ' ' 785 875 done 786 876 end; ··· 795 885 Buffer.add_char trailing_breaks '\n'; 796 886 Input.consume_break t.input 797 887 end; 888 + 889 + (* Update leading_blank for next iteration *) 890 + leading_blank := trailing_blank; 798 891 799 892 read_lines () 800 893 end ··· 840 933 ignore (Input.next t.input) 841 934 done; 842 935 843 - let span = Span.make ~start ~stop:(Input.mark t.input) in 844 - 845 936 match name with 846 937 | "YAML" -> 847 938 (* Version directive: %YAML 1.2 *) ··· 883 974 let span = Span.make ~start ~stop:(Input.mark t.input) in 884 975 Token.Tag_directive { handle; prefix }, span 885 976 886 - | _ when String.length name > 0 && name.[0] >= 'A' && name.[0] <= 'Z' -> 887 - (* Reserved directive *) 888 - Error.raise_span span (Reserved_directive name) 889 - 890 977 | _ -> 891 - (* Unknown directive - skip to end of line *) 978 + (* Reserved/Unknown directive - skip to end of line and ignore *) 979 + (* Per YAML spec, reserved directives should be ignored with a warning *) 892 980 while not (Input.is_eof t.input) && not (Input.next_is_break t.input) do 893 981 ignore (Input.next t.input) 894 982 done; 895 - Error.raise_span span (Invalid_directive name) 983 + let span = Span.make ~start ~stop:(Input.mark t.input) in 984 + (* Return an empty tag directive token to indicate directive was processed but ignored *) 985 + Token.Tag_directive { handle = ""; prefix = "" }, span 896 986 897 987 (** Fetch the next token(s) into the queue *) 898 988 let rec fetch_next_token t = ··· 922 1012 | Some ',' -> fetch_flow_entry t 923 1013 | Some '-' when t.flow_level = 0 && check_block_entry t -> 924 1014 fetch_block_entry t 925 - | Some '?' when t.flow_level = 0 && check_key t -> 1015 + | Some '?' when check_key t -> 926 1016 fetch_key t 927 1017 | Some ':' when check_value t -> 928 1018 fetch_value t ··· 1004 1094 t.allow_simple_key <- false; 1005 1095 let start = Input.mark t.input in 1006 1096 ignore (Input.next t.input); 1097 + (* Allow adjacent values after flow collection ends *) 1098 + if t.flow_level > 0 then 1099 + t.adjacent_value_allowed_at <- Some (Input.position t.input); 1007 1100 let span = Span.make ~start ~stop:(Input.mark t.input) in 1008 1101 emit t span token_type 1009 1102 ··· 1023 1116 1024 1117 and fetch_block_entry t = 1025 1118 if t.flow_level = 0 then begin 1026 - if not t.allow_simple_key then 1027 - Error.raise_at (Input.mark t.input) Expected_block_entry; 1119 + (* Block entries don't require allow_simple_key to be true, because: 1120 + 1. They're not simple keys themselves 1121 + 2. They can appear after : on the same line (e.g., ": - a") 1122 + So we only check allow_simple_key in contexts where it's truly required. 1123 + For now, we allow block entries in block context. *) 1028 1124 let col = column t in 1029 1125 if roll_indent t col ~sequence:true then begin 1030 1126 let span = Span.point (Input.mark t.input) in ··· 1055 1151 emit t span Token.Block_entry 1056 1152 1057 1153 and check_key t = 1058 - (* ? followed by whitespace in block, any in flow *) 1059 - if t.flow_level > 0 then true 1060 - else match Input.peek_nth t.input 1 with 1154 + (* ? followed by whitespace or flow indicator in both block and flow *) 1155 + match Input.peek_nth t.input 1 with 1061 1156 | None -> true 1062 - | Some c -> Input.is_whitespace c 1157 + | Some c -> 1158 + Input.is_whitespace c || 1159 + (t.flow_level > 0 && Input.is_flow_indicator c) 1063 1160 1064 1161 and fetch_key t = 1065 1162 if t.flow_level = 0 then begin ··· 1085 1182 end; 1086 1183 1087 1184 let span = Span.make ~start ~stop:(Input.mark t.input) in 1088 - emit t span Token.Key 1185 + emit t span Token.Key; 1186 + t.pending_value <- true (* We've emitted a KEY, now waiting for VALUE *) 1089 1187 1090 1188 and check_value t = 1091 - (* : followed by whitespace in block, or flow indicator in flow *) 1092 - if t.flow_level > 0 then true 1093 - else match Input.peek_nth t.input 1 with 1094 - | None -> true 1095 - | Some c -> Input.is_whitespace c 1189 + (* : followed by whitespace in block, or whitespace/flow indicator in flow, or adjacent value *) 1190 + match Input.peek_nth t.input 1 with 1191 + | None -> true 1192 + | Some c -> 1193 + Input.is_whitespace c || 1194 + (t.flow_level > 0 && Input.is_flow_indicator c) || 1195 + (* Allow adjacent values in flow context at designated positions *) 1196 + (t.flow_level > 0 && 1197 + match t.adjacent_value_allowed_at with 1198 + | Some pos -> pos.Position.line = (Input.position t.input).Position.line && 1199 + pos.Position.column = (Input.position t.input).Position.column 1200 + | None -> false) 1096 1201 1097 1202 and fetch_value t = 1098 1203 (* Check for simple key *) ··· 1112 1217 if insert_pos >= Array.length tokens then 1113 1218 Queue.add key_token t.tokens; 1114 1219 t.token_number <- t.token_number + 1; 1220 + t.pending_value <- true; (* We've inserted a KEY token, now waiting for VALUE *) 1115 1221 (* Roll indent for implicit block mapping *) 1116 1222 if t.flow_level = 0 then begin 1117 1223 let col = sk.sk_position.column in ··· 1132 1238 end; 1133 1239 t.simple_keys <- None :: (List.tl t.simple_keys) 1134 1240 | _ -> 1135 - (* No simple key - this is a complex value *) 1241 + (* No simple key - this is a complex value (or empty key) *) 1136 1242 if t.flow_level = 0 then begin 1137 1243 if not t.allow_simple_key then 1138 1244 Error.raise_at (Input.mark t.input) Expected_key; ··· 1140 1246 if roll_indent t col ~sequence:false then begin 1141 1247 let span = Span.point (Input.mark t.input) in 1142 1248 emit t span Token.Block_mapping_start 1249 + end; 1250 + (* Emit KEY token for empty key case (e.g., ": value") only if we don't already have a pending KEY *) 1251 + if not t.pending_value then begin 1252 + let span = Span.point (Input.mark t.input) in 1253 + emit t span Token.Key; 1254 + t.pending_value <- true 1143 1255 end 1144 1256 end); 1145 1257 remove_simple_key t; ··· 1161 1273 | _ -> () 1162 1274 end; 1163 1275 1276 + (* Skip any comment that may follow the colon and whitespace *) 1277 + skip_whitespace_and_comment t; 1278 + 1164 1279 let span = Span.make ~start ~stop:(Input.mark t.input) in 1165 - emit t span Token.Value 1280 + emit t span Token.Value; 1281 + t.pending_value <- false (* We've emitted a VALUE, no longer pending *) 1166 1282 1167 1283 and fetch_alias t = 1168 1284 save_simple_key t; ··· 1203 1319 t.allow_simple_key <- false; 1204 1320 t.document_has_content <- true; 1205 1321 let value, span = scan_single_quoted t in 1322 + (* Allow adjacent values after quoted scalars in flow context (for JSON compatibility) *) 1323 + skip_to_next_token t; 1324 + if t.flow_level > 0 then 1325 + t.adjacent_value_allowed_at <- Some (Input.position t.input); 1206 1326 emit t span (Token.Scalar { style = Scalar_style.Single_quoted; value }) 1207 1327 1208 1328 and fetch_double_quoted t = ··· 1210 1330 t.allow_simple_key <- false; 1211 1331 t.document_has_content <- true; 1212 1332 let value, span = scan_double_quoted t in 1333 + (* Allow adjacent values after quoted scalars in flow context (for JSON compatibility) *) 1334 + skip_to_next_token t; 1335 + if t.flow_level > 0 then 1336 + t.adjacent_value_allowed_at <- Some (Input.position t.input); 1213 1337 emit t span (Token.Scalar { style = Scalar_style.Double_quoted; value }) 1214 1338 1215 1339 and can_start_plain t =
+42 -41
yaml/ocaml-yamle/tests/dune
··· 3 3 (modules test_yamle) 4 4 (libraries yamle alcotest)) 5 5 6 - ; Shared library for test suite support modules 7 - (library 8 - (name test_suite_lib) 9 - (modules tree_format test_suite_loader) 10 - (libraries yamle)) 11 - 12 - ; yaml-test-suite compliance tests 13 - ; Run with: dune exec tests/test_suite.exe 14 - ; Or: YAML_TEST_SUITE=/path/to/yaml-test-suite dune exec tests/test_suite.exe 15 6 (executable 16 - (name test_suite) 17 - (modules test_suite) 18 - (libraries yamle alcotest test_suite_lib)) 7 + (name run_all_tests) 8 + (modules run_all_tests) 9 + (libraries yamle test_suite_lib)) 19 10 20 11 (executable 21 - (name test_analyze) 22 - (modules test_analyze) 12 + (name categorize_failures) 13 + (modules categorize_failures) 23 14 (libraries yamle test_suite_lib)) 24 15 25 16 (executable 26 - (name run_all_tests) 27 - (modules run_all_tests) 28 - (libraries yamle test_suite_lib)) 17 + (name debug_empty_key) 18 + (modules debug_empty_key) 19 + (libraries yamle)) 20 + 21 + (executable 22 + (name debug_5we3_6m2f) 23 + (modules debug_5we3_6m2f) 24 + (libraries yamle)) 25 + 26 + (executable 27 + (name test_6vjk_only) 28 + (modules test_6vjk_only) 29 + (libraries yamle)) 29 30 30 31 (executable 31 - (name analyze_failures) 32 - (modules analyze_failures) 33 - (libraries yamle test_suite_lib)) 32 + (name test_565n_debug) 33 + (modules test_565n_debug) 34 + (libraries yamle)) 34 35 35 36 (executable 36 - (name test_tabs) 37 - (modules test_tabs) 37 + (name debug_flow) 38 + (modules debug_flow) 38 39 (libraries yamle)) 39 40 40 41 (executable 41 - (name test_tabs_extended) 42 - (modules test_tabs_extended) 42 + (name debug_flow2) 43 + (modules debug_flow2) 43 44 (libraries yamle)) 44 45 45 46 (executable 46 - (name test_tabs_y79y) 47 - (modules test_tabs_y79y) 47 + (name debug_flow3) 48 + (modules debug_flow3) 48 49 (libraries yamle)) 49 50 50 51 (executable 51 - (name test_quick) 52 - (modules test_quick) 52 + (name debug_flow4) 53 + (modules debug_flow4) 53 54 (libraries yamle)) 54 55 55 56 (executable 56 - (name list_y79y) 57 - (modules list_y79y) 58 - (libraries test_suite_lib)) 57 + (name debug_flow5) 58 + (modules debug_flow5) 59 + (libraries yamle)) 59 60 60 61 (executable 61 - (name debug_y79y) 62 - (modules debug_y79y) 62 + (name debug_flow6) 63 + (modules debug_flow6) 63 64 (libraries yamle)) 64 65 65 66 (executable 66 - (name debug_y79y_events) 67 - (modules debug_y79y_events) 67 + (name debug_flow7) 68 + (modules debug_flow7) 68 69 (libraries yamle)) 69 70 70 71 (executable 71 - (name debug_y79y_array) 72 - (modules debug_y79y_array) 72 + (name test_87e4) 73 + (modules test_87e4) 73 74 (libraries yamle)) 74 75 75 76 (executable 76 - (name debug_seq) 77 - (modules debug_seq) 77 + (name test_tokens2) 78 + (modules test_tokens2) 78 79 (libraries yamle)) 79 80 80 81 (executable 81 - (name debug_seq_events) 82 - (modules debug_seq_events) 82 + (name test_remaining) 83 + (modules test_remaining) 83 84 (libraries yamle))