Commit 2326bc5e authored by Kim Nguyễn's avatar Kim Nguyễn

Properly print sequences whose tail containt top-level variables.

parent 51170310
...@@ -1834,6 +1834,20 @@ module Print = struct ...@@ -1834,6 +1834,20 @@ module Print = struct
in in
n >= 5 n >= 5
let proper_seq t =
let memo = DescrHash.create 17 in
let rec loop t =
DescrHash.mem memo t ||
begin
DescrHash.add memo t ();
not (has_tlv t) &&
List.for_all (fun (_, t2) ->
loop t2)
(Product.get ~kind:`Normal t)
end
in
loop t
let rec prepare d = let rec prepare d =
let d = lookup d in let d = lookup d in
try DescrHash.find memo d try DescrHash.find memo d
...@@ -2037,7 +2051,7 @@ module Print = struct ...@@ -2037,7 +2051,7 @@ module Print = struct
in in
let u_acc, tt = let u_acc, tt =
let tt_times = { empty with times = tt.times } in let tt_times = { empty with times = tt.times } in
if subtype tt_times seqs_descr && not (has_tlv tt_times) then if subtype tt_times seqs_descr && proper_seq tt_times then
let seq = cap tt seqs_descr in let seq = cap tt seqs_descr in
let seq_times = { empty with times = seq.times } in let seq_times = { empty with times = seq.times } in
if is_empty seq || (is_empty seq_times && not finite_atoms) then if is_empty seq || (is_empty seq_times && not finite_atoms) then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment