X-Git-Url: http://git.nguyen.vg/gitweb/?p=tatoo.git;a=blobdiff_plain;f=src%2Fhtml.ml;h=236ee39cc5e57692f6df68173e17070aa4c0991b;hp=f049195515f4bdcf626e2a3186dd49c2c748c0e9;hb=4b5e86cc5fa3e62a1cb7d29acf79ffb314194efa;hpb=524e7cad6802c1c32160d69728889cfe734753a4 diff --git a/src/html.ml b/src/html.ml index f049195..236ee39 100644 --- a/src/html.ml +++ b/src/html.ml @@ -87,8 +87,13 @@ let gen_trace (type s) = fun auto t tree -> in let pc = if !max_round == 0 then 1. else float_of_int last_round /. float_of_int !max_round in let scolor, tcolor = - let { sat ; todo; _ } = List.hd(M.find last_round m) in - let c = (last_round, sat, todo) in color c, text_color c + let { sat ; todo; _ } = + match M.find last_round m with + [] -> { sat = StateSet.empty; todo= StateSet.empty; msg = "ERROR" } + | [ e ] -> e + | l -> List.hd (List.tl (List.rev l)) + in + let c = (last_round, StateSet.union sat todo, StateSet.empty) in color c, text_color c in let tag = QName.to_string (T.tag tree node) in let lbox = (String.length tag + 2) * 10 in