diff options
| author | aarne <unknown> | 2004-03-24 15:09:06 +0000 |
|---|---|---|
| committer | aarne <unknown> | 2004-03-24 15:09:06 +0000 |
| commit | dc71ffcf5bae1f2b91467de273c71e7c3294acb3 (patch) | |
| tree | a4e705bba717aa9f7421c000cfa5756d5eb8462b /src/GF/Compile/CheckGrammar.hs | |
| parent | 31836c0da9ba7a716ee0480e6219d771da4999fa (diff) | |
Restoring old functionality
Diffstat (limited to 'src/GF/Compile/CheckGrammar.hs')
| -rw-r--r-- | src/GF/Compile/CheckGrammar.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/GF/Compile/CheckGrammar.hs b/src/GF/Compile/CheckGrammar.hs index 6e8abc02d..3a1b480ff 100644 --- a/src/GF/Compile/CheckGrammar.hs +++ b/src/GF/Compile/CheckGrammar.hs @@ -13,6 +13,7 @@ import LookAbs import Macros import ReservedWords ---- import PatternMatch +import AppPredefined import Operations import CheckM @@ -207,6 +208,8 @@ computeLType gr t = do where comp ty = case ty of + Q m _ | m == cPredef -> return ty + Q m ident -> do ty' <- checkErr (lookupResDef gr m ident) if ty' == ty then return ty else comp ty' --- is this necessary to test? @@ -256,6 +259,8 @@ checkReservedId x = let c = prt x in inferLType :: SourceGrammar -> Term -> Check (Term, Type) inferLType gr trm = case trm of + Q m ident | m==cPredef -> termWith trm $ checkErr (typPredefined ident) + Q m ident -> checks [ termWith trm $ checkErr (lookupResType gr m ident) , @@ -616,6 +621,7 @@ checkEqLType env t u trm = do ---- this should be made in Rename (Q m a, Q n b) | a == b -> elem m (allExtendsPlus env n) || elem n (allExtendsPlus env m) + || m == n --- for Predef (QC m a, QC n b) | a == b -> elem m (allExtendsPlus env n) || elem n (allExtendsPlus env m) (QC m a, Q n b) | a == b -> elem m (allExtendsPlus env n) |
