restored Int size and last ; added lib/prelude to be the last in any grammar path

This commit is contained in:
aarne
2007-12-16 22:24:36 +00:00
parent 3f4bb6c40c
commit eb10ccbe7c
9 changed files with 30 additions and 29 deletions

View File

@@ -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"
linTypeInt :: Type
linTypeInt =
let ints k = App (Q (IC "Predef") (IC "Ints")) (EInt k) in
RecType [
(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"] =
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"] =
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