forked from GitHub/gf-core
forced checking def definitions; accept pgf with no concretes
This commit is contained in:
@@ -139,7 +139,8 @@ checkAbsInfo st m mo (c,info) = do
|
||||
md' <- case md of
|
||||
Yes d -> do
|
||||
let d' = elimTables d
|
||||
mkCheckWarn "definition of function" $ checkEquation st (m,c) d'
|
||||
---- mkCheckWarn "definition of function" $ checkEquation st (m,c) d'
|
||||
mkCheck "definition of function" $ checkEquation st (m,c) d'
|
||||
return $ Yes d'
|
||||
_ -> return md
|
||||
return $ (c,AbsFun (Yes typ) md')
|
||||
|
||||
@@ -47,7 +47,7 @@ mkCanon2gfcc :: Options -> String -> SourceGrammar -> (String,D.PGF)
|
||||
mkCanon2gfcc opts cnc gr =
|
||||
(prIdent abs, (canon2gfcc opts pars . reorder abs . canon2canon abs) gr)
|
||||
where
|
||||
abs = err error id $ M.abstractOfConcrete gr (identC (BS.pack cnc))
|
||||
abs = err (const c) id $ M.abstractOfConcrete gr c where c = identC (BS.pack cnc)
|
||||
pars = mkParamLincat gr
|
||||
|
||||
-- Adds parsers for all concretes
|
||||
|
||||
@@ -85,14 +85,12 @@ cont2val = type2val . cont2exp
|
||||
justTypeCheck :: Grammar -> Exp -> Val -> Err Constraints
|
||||
justTypeCheck gr e v = do
|
||||
(_,constrs0) <- checkExp (grammar2theory gr) (initTCEnv []) e v
|
||||
return $ filter notJustMeta constrs0
|
||||
---- return $ fst $ splitConstraintsSrc gr constrs0
|
||||
---- this change was to force proper tc of abstract modules.
|
||||
---- May not be quite right. AR 13/9/2005
|
||||
(constrs1,_) <- unifyVal constrs0
|
||||
return $ filter notJustMeta constrs1
|
||||
|
||||
notJustMeta (c,k) = case (c,k) of
|
||||
(VClos g1 (Meta m1), VClos g2 (Meta m2)) -> False
|
||||
_ -> True
|
||||
(VClos g1 (Meta m1), VClos g2 (Meta m2)) -> False
|
||||
_ -> True
|
||||
|
||||
grammar2theory :: Grammar -> Theory
|
||||
grammar2theory gr (m,f) = case lookupFunType gr m f of
|
||||
|
||||
Reference in New Issue
Block a user