From 9de5012d76523e9f8647c970da5b2ffdca278c65 Mon Sep 17 00:00:00 2001 From: aarne Date: Thu, 12 Jun 2008 13:11:18 +0000 Subject: [PATCH] treating Int as PredefAbs.Int in lookup --- lib/resource/api/Constructors.gf | 2 ++ src-3.0/GF/Compile.hs | 1 - src-3.0/GF/Grammar/Lookup.hs | 6 ++++-- src-3.0/GF/Grammar/PrGrammar.hs | 6 +++++- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/resource/api/Constructors.gf b/lib/resource/api/Constructors.gf index ffc710166..8ede44d54 100644 --- a/lib/resource/api/Constructors.gf +++ b/lib/resource/api/Constructors.gf @@ -1083,6 +1083,8 @@ incomplete resource Constructors = open Grammar in { those_QuantPl : QuantPl = mkQuantPl that_Quant ; + mkiNum : Int -> Num -- 51 + = NumInt ; mkNum = overload { mkNum : Numeral -> Num = NumNumeral ; diff --git a/src-3.0/GF/Compile.hs b/src-3.0/GF/Compile.hs index 71eb35bb4..13c96930c 100644 --- a/src-3.0/GF/Compile.hs +++ b/src-3.0/GF/Compile.hs @@ -176,7 +176,6 @@ compileSourceModule opts env@(k,gr,_) mo@(i,mi) = do if null warnings then return () else putp warnings $ return () intermOut opts DumpTypeCheck (prModule mo3) - (k',mo3r:_) <- putpp " refreshing " $ ioeErr $ refreshModule (k,mos) mo3 intermOut opts DumpRefresh (prModule mo3r) diff --git a/src-3.0/GF/Grammar/Lookup.hs b/src-3.0/GF/Grammar/Lookup.hs index 6f4b5daa3..a4208b21b 100644 --- a/src-3.0/GF/Grammar/Lookup.hs +++ b/src-3.0/GF/Grammar/Lookup.hs @@ -50,12 +50,14 @@ lookupResDef gr m c = liftM fst $ lookupResDefKind gr m c -- 0 = oper, 1 = lin, 2 = canonical. v > 0 means: no need to be recomputed lookupResDefKind :: SourceGrammar -> Ident -> Ident -> Err (Term,Int) -lookupResDefKind gr m c = look True m c where +lookupResDefKind gr m c + | isPredefCat c = return (Q cPredefAbs c,2) --- need this in gf3 12/6/2008 + | otherwise = look True m c where look isTop m c = do mi <- lookupModule gr m case mi of ModMod mo -> do - info <- lookupIdentInfo mo c + info <- lookupIdentInfoIn mo m c case info of ResOper _ (Yes t) -> return (qualifAnnot m t, 0) ResOper _ Nope -> return (Q m c, 0) ---- if isTop then lookExt m c diff --git a/src-3.0/GF/Grammar/PrGrammar.hs b/src-3.0/GF/Grammar/PrGrammar.hs index 1b824da32..c1593dd63 100644 --- a/src-3.0/GF/Grammar/PrGrammar.hs +++ b/src-3.0/GF/Grammar/PrGrammar.hs @@ -30,7 +30,7 @@ module GF.Grammar.PrGrammar (Print(..), prConstrs, prConstraints, prMetaSubst, prEnv, prMSubst, prExp, prOperSignature, - lookupIdent, lookupIdentInfo, + lookupIdent, lookupIdentInfo, lookupIdentInfoIn, prTermTabular ) where @@ -255,6 +255,10 @@ lookupIdent c t = case lookupTree prt c t of lookupIdentInfo :: Module Ident a -> Ident -> Err a lookupIdentInfo mo i = lookupIdent i (jments mo) +lookupIdentInfoIn :: Module Ident a -> Ident -> Ident -> Err a +lookupIdentInfoIn mo m i = + err (\s -> Bad (s +++ "in module" +++ prt m)) return $ lookupIdentInfo mo i + --- printing cc command output AR 26/5/2008