From 94326929b144913642121bef8f8ecc98feb992e7 Mon Sep 17 00:00:00 2001 From: aarne Date: Mon, 3 Nov 2003 16:27:55 +0000 Subject: Fixed several things, e.g. tokenizer. --- src/GF/CF/CFIdent.hs | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'src/GF/CF/CFIdent.hs') diff --git a/src/GF/CF/CFIdent.hs b/src/GF/CF/CFIdent.hs index ab86b8bd4..02343bfb7 100644 --- a/src/GF/CF/CFIdent.hs +++ b/src/GF/CF/CFIdent.hs @@ -56,23 +56,17 @@ type Profile = [([[Int]],[Int])] mkCFFun :: Atom -> CFFun mkCFFun t = CFFun (t,[]) -{- ---- -getCFLiteral :: String -> Maybe (CFCat, CFFun) -getCFLiteral s = case lookupLiteral' s of - Ok (c, lit) -> Just (cat2CFCat c, mkCFFun lit) - _ -> Nothing --} - varCFFun :: Ident -> CFFun varCFFun = mkCFFun . AV consCFFun :: CIdent -> CFFun consCFFun = mkCFFun . AC -{- ---- -string2CFFun :: String -> CFFun -string2CFFun = consCFFun . Ident --} +stringCFFun :: String -> CFFun +stringCFFun = mkCFFun . AS + +intCFFun :: Int -> CFFun +intCFFun = mkCFFun . AI . toInteger cfFun2String :: CFFun -> String cfFun2String (CFFun (f,_)) = prt f @@ -110,6 +104,11 @@ catVarCF = ident2CFCat (mkCIdent "_" "#Var") (identC "_") ---- cat2CFCat :: (Ident,Ident) -> CFCat cat2CFCat = uncurry idents2CFCat +---- literals +cfCatString = string2CFCat "Predef" "String" +cfCatInt = string2CFCat "Predef" "Int" + + {- ---- uCFCat :: CFCat -- cgit v1.2.3