summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2006-02-22 11:13:42 +0000
committeraarne <aarne@cs.chalmers.se>2006-02-22 11:13:42 +0000
commitc2636ea9688fd89df7a13f53970e699c99997fe3 (patch)
tree9ee830b86aa6270f12b4af36d3da94a0400f772a
parent13672549f8c1f998bf781d64cd9a91d112bb8497 (diff)
testing precompiled libraries
-rw-r--r--examples/tram/TramEng.gf3
-rw-r--r--examples/tram/TramI.gf4
-rw-r--r--examples/tram/TramSwe.gf4
-rw-r--r--src/GF/Compile/CheckGrammar.hs12
4 files changed, 13 insertions, 10 deletions
diff --git a/examples/tram/TramEng.gf b/examples/tram/TramEng.gf
index 04ddef750..a9dc1543f 100644
--- a/examples/tram/TramEng.gf
+++ b/examples/tram/TramEng.gf
@@ -1,4 +1,5 @@
---# -path=.:resource-1.0/abstract:resource-1.0/common:resource-1.0/multimodal:resource-1.0/english:prelude:resource-1.0/mathematical
+--# -path=.:compiled
+-- --# -path=.:resource-1.0/abstract:resource-1.0/common:resource-1.0/multimodal:resource-1.0/english:prelude:resource-1.0/mathematical
concrete TramEng of Tram = TramI with
(Multimodal = MultimodalEng),
diff --git a/examples/tram/TramI.gf b/examples/tram/TramI.gf
index 1d505fc58..90c5e5261 100644
--- a/examples/tram/TramI.gf
+++ b/examples/tram/TramI.gf
@@ -31,8 +31,8 @@ lin
DestClick = here7to_MAdv ;
DepHere = DemAdv here7from_Adv ;
DestHere = DemAdv here7to_Adv ;
- DepNamed s = MPrepNP from_Prep (DemNP (UsePN (SymbPN (MkSymb s)))) ;
- DestNamed s = MPrepNP to_Prep (DemNP (UsePN (SymbPN (MkSymb s)))) ;
+--- DepNamed s = MPrepNP from_Prep (DemNP (UsePN (SymbPN (MkSymb s)))) ;
+--- DestNamed s = MPrepNP to_Prep (DemNP (UsePN (SymbPN (MkSymb s)))) ;
CCoord x y = {point = "(" ++ x.s ++ "," ++ y.s ++ ")" ; lock_Point = <>} ;
diff --git a/examples/tram/TramSwe.gf b/examples/tram/TramSwe.gf
index e92e5d706..59d0ff7f0 100644
--- a/examples/tram/TramSwe.gf
+++ b/examples/tram/TramSwe.gf
@@ -1,4 +1,6 @@
---# -path=.:resource-1.0/abstract:resource-1.0/swedish:resource-1.0/common:resource-1.0/multimodal:resource-1.0/scandinavian:prelude:resource-1.0/mathematical
+--# -path=.:compiled
+
+-- --# -path=.:resource-1.0/abstract:resource-1.0/swedish:resource-1.0/common:resource-1.0/multimodal:resource-1.0/scandinavian:prelude:resource-1.0/mathematical
concrete TramSwe of Tram = TramI with
(Multimodal = MultimodalSwe),
diff --git a/src/GF/Compile/CheckGrammar.hs b/src/GF/Compile/CheckGrammar.hs
index 2e03b59ec..eaf9bc819 100644
--- a/src/GF/Compile/CheckGrammar.hs
+++ b/src/GF/Compile/CheckGrammar.hs
@@ -758,16 +758,16 @@ checkEqLType :: LTEnv -> Type -> Type -> Term -> Check Type
checkEqLType env t u trm = do
t' <- comp t
u' <- comp u
- case alpha [] t' u' of
+ case t' == u' || alpha [] t' u' of
True -> return t'
-- forgive missing lock fields by only generating a warning.
--- better: use a flag to forgive (AR 31/1/2006)
_ -> case missingLock [] t' u' of
- Just lo -> do
+ Ok lo -> do
checkWarn $ "missing lock field" +++ unwords (map prt lo)
return t'
- _ -> raise ("type of" +++ prt trm +++
- ": expected" +++ prt t' ++ ", inferred" +++ prt u')
+ Bad s -> raise (s ++ "type of" +++ prt trm +++
+ ": expected" ++++ prt t' ++++ "inferred" ++++ prt u')
where
-- t is a subtype of u
@@ -818,9 +818,9 @@ checkEqLType env t u trm = do
not (any (\ (k,b) -> alpha g a b && l == k) ts)]
(locks,others) = partition isLockLabel ls
in case others of
- _:_ -> Nothing
+ _:_ -> Bad $ "missing record fieds" +++ unwords (map prt others)
_ -> return locks
- _ -> Nothing
+ _ -> Bad ""
sTypes = [typeStr, typeTok, typeString]
comp = computeLType env