From 7551c70db6c76a796e93fa1cd4ebe7c850344b7e Mon Sep 17 00:00:00 2001 From: aarne Date: Sun, 16 Dec 2007 22:24:36 +0000 Subject: restored Int size and last ; added lib/prelude to be the last in any grammar path --- src/GF/Grammar/Lookup.hs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/GF/Grammar') diff --git a/src/GF/Grammar/Lookup.hs b/src/GF/Grammar/Lookup.hs index 2acfa5f26..481512751 100644 --- a/src/GF/Grammar/Lookup.hs +++ b/src/GF/Grammar/Lookup.hs @@ -28,7 +28,8 @@ module GF.Grammar.Lookup ( allParamValues, lookupAbsDef, lookupLincat, - opersForType + opersForType, + linTypeInt ) where import GF.Data.Operations @@ -229,16 +230,15 @@ lookupAbsDef gr m c = errIn ("looking up absdef of" +++ prt c) $ do _ -> return Nothing _ -> Bad $ prt m +++ "is not an abstract module" - -lookupLincat :: SourceGrammar -> Ident -> Ident -> Err Type -{- ---- -lookupLincat gr m c | elem c [zIdent "Int"] = +linTypeInt :: Type +linTypeInt = let ints k = App (Q (IC "Predef") (IC "Ints")) (EInt k) in - return $ RecType [ - (LIdent "last",ints 9),(LIdent "s", typeStr),(LIdent "size",ints 1)] --} -lookupLincat gr m c | elem c [zIdent "String", zIdent "Float", zIdent "Int"] = + (LIdent "last",ints 9),(LIdent "s", typeStr), (LIdent "size",ints 1)] + +lookupLincat :: SourceGrammar -> Ident -> Ident -> Err Type +lookupLincat gr m c | elem c [zIdent "Int"] = return linTypeInt +lookupLincat gr m c | elem c [zIdent "String", zIdent "Float"] = return defLinType --- ad hoc; not needed? lookupLincat gr m c = do -- cgit v1.2.3