# HG changeset patch # User Adam Chlipala # Date 1376930323 14400 # Node ID 5144e03ef603b1bf5d5b776df674b611c4f01d6f # Parent 1aa9629e3a4c534161abf603a2be8408853b8478 Potentially exponential search through where to head-normalize in [decompileCon] diff -r 1aa9629e3a4c -r 5144e03ef603 src/elaborate.sml --- a/src/elaborate.sml Mon Aug 19 12:25:32 2013 -0400 +++ b/src/elaborate.sml Mon Aug 19 12:38:43 2013 -0400 @@ -3553,11 +3553,16 @@ | L'.KFun _ => NONE fun maybeHnorm env c = - hnormCon env c - handle E.UnboundNamed _ => c - - fun decompileCon env (c as (_, loc)) = - case #1 (maybeHnorm env c) of + hnormCon env c + handle E.UnboundNamed _ => c + + fun decompileCon env c = + case decompileCon' env c of + SOME v => SOME v + | NONE => decompileCon' env (maybeHnorm env c) + + and decompileCon' env (c as (_, loc)) = + case #1 c of L'.CRel i => let val (s, _) = E.lookupCRel env i @@ -3619,6 +3624,10 @@ end | L'.CMap _ => SOME (L.CMap, loc) + | L'.TRecord c => + (case decompileCon env c of + NONE => NONE + | SOME c' => SOME (L.TRecord c', loc)) | c => (Print.preface ("WTF?", p_con env (c, loc)); NONE)