on master help sign in
Improve printing of foreign calls.
commitb5c7a14bfc05caec6fe580c9be56d2bf330592c7 authorMatus Tejiscak <ziman@functor.sk> dateMon 24 Feb 2014, 14:54 (13 years ago) parent898d604
1 file changed+9−2
src/IRTS/Lang.hs+9−2
src/IRTS/Lang.hs+9−2
@@ -231,8 +231,15 @@ instance Show LExp where
231231 show' env (LCase e alts) = "case " ++ show' env e ++ " of {\n\t" ++
232232 showSep "\n\t| " (map (showAlt env) alts)
233233 show' env (LConst c) = show c
234− show' env (LForeign lang ty n args)
235− = "foreign " ++ n ++ "(" ++ showSep ", " (map (show' env) (map snd args)) ++ ")"
234+ show' env (LForeign lang ty n args) = concat
235+ [ "foreign { "
236+ , n ++ "("
237+ , showSep ", " (map (\(ty,x) -> show' env x ++ " : " ++ show ty) args)
238+ , ") : "
239+ , show ty
240+ , " }"
241+ ]
242+
236243 show' env (LOp f args) = show f ++ "(" ++ showSep ", " (map (show' env) args) ++ ")"
237244 show' env (LError str) = "error " ++ show str
238245 show' env LNothing = "____"