From e53da5822f145eec5ba6c6ff03be471d5d27e715 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Fri, 10 Apr 2009 16:06:49 +0000 Subject: [PATCH] Fixed a problem where operators with % in the name were screwing up an error message --- common/ShowCode.hs | 3 +++ frontends/OccamTypes.hs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/common/ShowCode.hs b/common/ShowCode.hs index 7ca83d6..0ffca02 100644 --- a/common/ShowCode.hs +++ b/common/ShowCode.hs @@ -693,6 +693,9 @@ instance ShowRain A.Replicator where instance Data a => ShowRain a where showRainM = tell . singleton . gshow +instance ShowOccam String where + showOccamM s = tell [s] + instance ShowOccam a => ShowOccam [a] where showOccamM xs = tell ["["] >> sequence (intersperse (tell [", "]) $ map showOccamM xs) >> tell ["]"] diff --git a/frontends/OccamTypes.hs b/frontends/OccamTypes.hs index 79ef1a8..330dd2f 100644 --- a/frontends/OccamTypes.hs +++ b/frontends/OccamTypes.hs @@ -742,7 +742,7 @@ inferTypes = occamOnlyPass "Infer types" , ts `typesEqForOp` tes ] case possibles of - [] -> diePC m $ formatCode ("No matching " ++ opDescrip ++ " operator definition found for types: %") tes + [] -> diePC m $ formatCode "No matching % operator definition found for types: %" opDescrip tes [poss] -> return $ fst poss posss -> dieP m $ "Ambigious " ++ opDescrip ++ " operator, matches definitions: " ++ show (map (transformPair (A.nameMeta . fst) showOccam) posss)