mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-16 06:32:51 -06:00
restored Int size and last ; added lib/prelude to be the last in any grammar path
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user