<> <> <> <<>> DIRECTORY TextLooks, AMBridge, AMTypes, IO, PrintTV, Rope, SafeStorage; LookPrettyImpl: CEDAR PROGRAM IMPORTS AMBridge, AMTypes, IO, PrintTV = BEGIN TV: TYPE ~ AMTypes.TV; recursive: BOOL _ FALSE; TVPrint: PrintTV.TVPrintProc ~ TRUSTED { cc: CHAR _ TextLooks.Look.FIRST; true: TV ~ AMBridge.TVForReferent[NEW[BOOL_TRUE]]; false: TV ~ AMBridge.TVForReferent[NEW[BOOL_FALSE]]; IF AMBridge.IsRemote[tv] THEN RETURN [useOld: TRUE]; IF recursive THEN RETURN [useOld: TRUE]; recursive _ TRUE; IO.PutRope[stream, "LOOKS["]; FOR c: TV _ AMTypes.First[AMTypes.Domain[looksType]], AMTypes.Next[c] UNTIL c = NIL DO b: TV _ AMTypes.Apply[tv, c]; IF AMTypes.TVEqual[b, true] THEN IO.PutChar[stream, cc] ELSE IF AMTypes.TVEqual[b, false] THEN NULL ELSE ERROR; IF cc # TextLooks.Look.LAST THEN cc _ cc.SUCC; ENDLOOP; IO.PutRope[stream, "]"]; recursive _ FALSE; RETURN [useOld: FALSE]; }; looksType: SafeStorage.Type _ [CODE[TextLooks.Looks]]; try: TextLooks.Looks _ TextLooks.noLooks; try['d] _ TRUE; try['e] _ TRUE; try['f] _ TRUE; try['i] _ TRUE; try['n] _ TRUE; PrintTV.RegisterTVPrintProc[looksType, TVPrint]; END.