mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-22 19:22:50 -06:00
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
|
md' <- case md of
|
||||||
Yes d -> do
|
Yes d -> do
|
||||||
let d' = elimTables d
|
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 $ Yes d'
|
||||||
_ -> return md
|
_ -> return md
|
||||||
return $ (c,AbsFun (Yes typ) md')
|
return $ (c,AbsFun (Yes typ) md')
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ mkCanon2gfcc :: Options -> String -> SourceGrammar -> (String,D.PGF)
|
|||||||
mkCanon2gfcc opts cnc gr =
|
mkCanon2gfcc opts cnc gr =
|
||||||
(prIdent abs, (canon2gfcc opts pars . reorder abs . canon2canon abs) gr)
|
(prIdent abs, (canon2gfcc opts pars . reorder abs . canon2canon abs) gr)
|
||||||
where
|
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
|
pars = mkParamLincat gr
|
||||||
|
|
||||||
-- Adds parsers for all concretes
|
-- Adds parsers for all concretes
|
||||||
|
|||||||
@@ -85,14 +85,12 @@ cont2val = type2val . cont2exp
|
|||||||
justTypeCheck :: Grammar -> Exp -> Val -> Err Constraints
|
justTypeCheck :: Grammar -> Exp -> Val -> Err Constraints
|
||||||
justTypeCheck gr e v = do
|
justTypeCheck gr e v = do
|
||||||
(_,constrs0) <- checkExp (grammar2theory gr) (initTCEnv []) e v
|
(_,constrs0) <- checkExp (grammar2theory gr) (initTCEnv []) e v
|
||||||
return $ filter notJustMeta constrs0
|
(constrs1,_) <- unifyVal constrs0
|
||||||
---- return $ fst $ splitConstraintsSrc gr constrs0
|
return $ filter notJustMeta constrs1
|
||||||
---- this change was to force proper tc of abstract modules.
|
|
||||||
---- May not be quite right. AR 13/9/2005
|
|
||||||
|
|
||||||
notJustMeta (c,k) = case (c,k) of
|
notJustMeta (c,k) = case (c,k) of
|
||||||
(VClos g1 (Meta m1), VClos g2 (Meta m2)) -> False
|
(VClos g1 (Meta m1), VClos g2 (Meta m2)) -> False
|
||||||
_ -> True
|
_ -> True
|
||||||
|
|
||||||
grammar2theory :: Grammar -> Theory
|
grammar2theory :: Grammar -> Theory
|
||||||
grammar2theory gr (m,f) = case lookupFunType gr m f of
|
grammar2theory gr (m,f) = case lookupFunType gr m f of
|
||||||
|
|||||||
Reference in New Issue
Block a user