this repo has no description
0
fork

Configure Feed

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

more

+29 -18
+24 -18
yaml/ocaml-yamle/lib/scanner.ml
··· 653 653 let buf = Buffer.create 256 in 654 654 let trailing_breaks = Buffer.create 16 in 655 655 656 - (* Skip to content indentation, skipping empty lines *) 656 + (* Skip to content indentation, skipping empty lines. 657 + Returns the number of spaces actually skipped (important for detecting dedentation). *) 657 658 let rec skip_to_content_indent () = 658 659 if !content_indent > 0 then begin 659 - (* Explicit indent - skip exactly content_indent spaces *) 660 + (* Explicit indent - skip up to content_indent spaces *) 660 661 let spaces_skipped = ref 0 in 661 662 while !spaces_skipped < !content_indent && Input.next_is (( = ) ' ') t.input do 662 663 incr spaces_skipped; ··· 669 670 Buffer.add_char trailing_breaks '\n'; 670 671 Input.consume_break t.input; 671 672 skip_to_content_indent () 673 + end else if !spaces_skipped < !content_indent then begin 674 + (* Line starts with fewer spaces than content_indent - dedented *) 675 + !spaces_skipped 672 676 end else if Input.next_is_blank t.input then begin 673 677 (* Line has spaces beyond content_indent - check if rest is only blanks *) 674 678 let idx = ref 0 in ··· 691 695 skip_to_content_indent () 692 696 | _ -> 693 697 (* Has content *) 694 - ()) 695 - end 698 + !content_indent) 699 + end else 700 + !content_indent 696 701 end else begin 697 702 (* Implicit indent - skip empty lines without consuming spaces *) 698 703 if Input.next_is_break t.input then begin ··· 716 721 Input.consume_break t.input; 717 722 skip_to_content_indent () 718 723 | _ -> 719 - (* Has content - don't consume anything *) 720 - () 721 - end 724 + (* Has content - don't consume anything, return 0 as we haven't skipped *) 725 + 0 726 + end else 727 + (* Not at break or blank - return 0 *) 728 + 0 722 729 end 723 730 in 724 731 725 732 (* Read content *) 726 733 let rec read_lines () = 727 - skip_to_content_indent (); 734 + let spaces_skipped = skip_to_content_indent () in 728 735 729 736 (* Check if we're at content *) 730 737 if Input.is_eof t.input then () 731 738 else if Input.at_document_boundary t.input then () 732 739 else begin 733 - (* Count leading spaces *) 734 - let line_indent = ref 0 in 740 + (* Count additional leading spaces beyond what was skipped *) 741 + let extra_spaces = ref 0 in 735 742 while Input.next_is (( = ) ' ') t.input do 736 - incr line_indent; 743 + incr extra_spaces; 737 744 ignore (Input.next t.input) 738 745 done; 739 746 740 - (* For explicit indent, line_indent is extra beyond content_indent *) 741 - if !content_indent > 0 then 742 - line_indent := !content_indent + !line_indent; 747 + (* Calculate actual line indentation *) 748 + let line_indent = spaces_skipped + !extra_spaces in 743 749 744 750 (* Determine content indent from first content line (implicit case) *) 745 751 if !content_indent = 0 then begin 746 - if !line_indent <= base_indent then begin 752 + if line_indent <= base_indent then begin 747 753 (* No content - restore position conceptually *) 748 754 () 749 755 end else 750 - content_indent := !line_indent 756 + content_indent := line_indent 751 757 end; 752 758 753 - if !line_indent < !content_indent then begin 759 + if line_indent < !content_indent then begin 754 760 (* Dedented - done with content *) 755 761 () 756 762 end else begin ··· 774 780 775 781 (* Add extra indentation for literal *) 776 782 if literal then begin 777 - for _ = !content_indent + 1 to !line_indent do 783 + for _ = !content_indent + 1 to line_indent do 778 784 Buffer.add_char buf ' ' 779 785 done 780 786 end;
+5
yaml/ocaml-yamle/tests/dune
··· 76 76 (name debug_seq) 77 77 (modules debug_seq) 78 78 (libraries yamle)) 79 + 80 + (executable 81 + (name debug_seq_events) 82 + (modules debug_seq_events) 83 + (libraries yamle))