ditt o datt

This commit is contained in:
aarne
2004-04-23 13:45:07 +00:00
parent 2e0c510285
commit 233d6910e4
5 changed files with 9 additions and 5 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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]

View File

@@ -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)

View File

@@ -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"