@@ -128,7 +128,8 @@ namespaceOf _ = Nothing
129instance SExpable OutputAnnotation where
129instance SExpable OutputAnnotation where
130 toSExp (AnnName n ty d t) = toSExp $ [(SymbolAtom "name", StringAtom (show n)),
130 toSExp (AnnName n ty d t) = toSExp $ [(SymbolAtom "name", StringAtom (show n)),
131− (SymbolAtom "implicit", BoolAtom False)] ++
131+ (SymbolAtom "implicit", BoolAtom False),
132+ (SymbolAtom "key", StringAtom (encodeName n))] ++
132 maybeProps [("decor", ty)] ++
133 maybeProps [("decor", ty)] ++
133 maybeProps [("doc-overview", d), ("type", t)] ++
134 maybeProps [("doc-overview", d), ("type", t)] ++
134 maybeProps [("namespace", namespaceOf n)]
135 maybeProps [("namespace", namespaceOf n)]
@@ -172,6 +173,12 @@ instance SExpable OutputAnnotation where
172 toSExp AnnQuasiquote = toSExp [(SymbolAtom "quasiquotation", True)]
173 toSExp AnnQuasiquote = toSExp [(SymbolAtom "quasiquotation", True)]
173 toSExp AnnAntiquote = toSExp [(SymbolAtom "antiquotation", True)]
174 toSExp AnnAntiquote = toSExp [(SymbolAtom "antiquotation", True)]
176+encodeName :: Name -> String
177+encodeName n = UTF8.toString . Base64.encode . Lazy.toStrict . Binary.encode $ n
179+decodeName :: String -> Name
180+decodeName = Binary.decode . Lazy.fromStrict . Base64.decodeLenient . UTF8.fromString
175encodeTerm :: [(Name, Bool)] -> Term -> String
182encodeTerm :: [(Name, Bool)] -> Term -> String
176encodeTerm bnd tm = UTF8.toString . Base64.encode . Lazy.toStrict . Binary.encode $
183encodeTerm bnd tm = UTF8.toString . Base64.encode . Lazy.toStrict . Binary.encode $
177 (bnd, tm)
184 (bnd, tm)