From 233d6910e4716f078876541bfbd4ce6163ffd0c8 Mon Sep 17 00:00:00 2001 From: aarne Date: Fri, 23 Apr 2004 13:45:07 +0000 Subject: [PATCH] ditt o datt --- src/GF/CF/PPrCF.hs | 4 ++-- src/GF/Compile/PrOld.hs | 2 ++ src/GF/Source/PrintGF.hs | 2 +- src/GF/UseGrammar/Custom.hs | 4 +++- src/Today.hs | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/GF/CF/PPrCF.hs b/src/GF/CF/PPrCF.hs index a797daace..cdeab188b 100644 --- a/src/GF/CF/PPrCF.hs +++ b/src/GF/CF/PPrCF.hs @@ -30,12 +30,12 @@ prCFFun :: CFFun -> String prCFFun = prCFFun' True ---- False -- print profiles for debug prCFFun' :: Bool -> CFFun -> String -prCFFun' profs (CFFun (t, p)) = prt t ++ pp p where +prCFFun' profs (CFFun (t, p)) = prt_ t ++ pp p where pp p = if (not profs || normal p) then "" else "_" ++ concat (map show p) normal p = and [x==y && null b | ((b,x),y) <- zip p (map (:[]) [0..])] prCFCat :: CFCat -> String -prCFCat (CFCat (c,l)) = prt c ++ "-" ++ prt l ---- +prCFCat (CFCat (c,l)) = prt_ c ++ "-" ++ prt_ l ---- prCFItem (CFNonterm c) = prCFCat c prCFItem (CFTerm a) = prRegExp a diff --git a/src/GF/Compile/PrOld.hs b/src/GF/Compile/PrOld.hs index acce0ab67..4462fb95d 100644 --- a/src/GF/Compile/PrOld.hs +++ b/src/GF/Compile/PrOld.hs @@ -56,6 +56,8 @@ stripTerm t = case t of TComp ty -> TComp $ stripTerm ty TWild ty -> TWild $ stripTerm ty _ -> ti + R [] -> EInt 8 --- GF 1.2 parser doesn't accept empty records + RecType [] -> Cn "Int" --- _ -> composSafeOp stripTerm t stripPattern p = case p of diff --git a/src/GF/Source/PrintGF.hs b/src/GF/Source/PrintGF.hs index b06e09a1b..732cdb002 100644 --- a/src/GF/Source/PrintGF.hs +++ b/src/GF/Source/PrintGF.hs @@ -61,7 +61,7 @@ instance Print Char where prtList s = ["\"" ++ concatMap mkEsc s ++ "\""] mkEsc s = case s of - _ | elem s "\\\"'" -> '\\':[s] + _ | elem s "\\\"" -> '\\':[s] '\n' -> "\\n" '\t' -> "\\t" _ -> [s] diff --git a/src/GF/UseGrammar/Custom.hs b/src/GF/UseGrammar/Custom.hs index ac47a9758..8cde78c59 100644 --- a/src/GF/UseGrammar/Custom.hs +++ b/src/GF/UseGrammar/Custom.hs @@ -191,7 +191,9 @@ customTermCommand = (exp2termCommand gr (computeAbsTerm gr) t)) ,(strCI "paraphrase", \g t -> let gr = grammar g in exp2termlistCommand gr (mkParaphrases gr) t) ----- ,(strCI "typecheck", \g t -> err (const []) return (checkIfValidExp g t)) + ,(strCI "typecheck", \g t -> let gr = grammar g in + err (const []) (return . const t) + (checkIfValidExp gr (tree2exp t))) ,(strCI "solve", \g t -> err (const [t]) (return . loc2tree) (uniqueRefinements (grammar g) (tree2loc t))) ,(strCI "context", \g t -> err (const [t]) (return . loc2tree) diff --git a/src/Today.hs b/src/Today.hs index 8953c09f8..c3c1617c6 100644 --- a/src/Today.hs +++ b/src/Today.hs @@ -1 +1 @@ -module Today where today = "Mon Apr 19 17:59:02 CEST 2004" +module Today where today = "Wed Apr 21 17:20:17 CEST 2004"