Recursively parses toplevel phrases (i.e., contiguous units of code separated by ;;) into "chunks", one chunk per %%expect statement.
For example if the mlt contents are:
let x = 1 + 1;;
printf "%d" x + 2;;
[%%expect {|
- : int: 4
|}];;
print_string "f" ^ "o" ^ "o";;
[%%expect {|
- : string: "foo"
|}];;
print_string 3 + 3 + 3;;
then you'd have two chunks, where the first has two phrases ("x = 1 + 1" and "printf "%d" x + 2") and an expectation.body of ": int 4". The second chunk would have just the one phrase.
"print_line 3 + 3 + 3" is not part of a chunk because there is no expectation following it, so instead it is returned as trailing_code, which is just a list of toplevel phrases with some position metadata.
"part" refers to @@@part "foo" statements, which are arbitrary section breaks. Each chunk, and the trailing code, belongs to a part (which is just the empty string "" if none has been specified).