diff options
| author | aarne <unknown> | 2004-03-31 12:30:34 +0000 |
|---|---|---|
| committer | aarne <unknown> | 2004-03-31 12:30:34 +0000 |
| commit | 3f9b4e7855cf4594708a9fbad194c89540d2cf1e (patch) | |
| tree | 33dcbbd6d2e6e5f6290a25f65b4b9f90253fd34b /src/GF/Compile/CheckGrammar.hs | |
| parent | 6719aedde34c3a4f0ccb78931968c6fe490b3282 (diff) | |
Added support for cf and ebnf formats
Diffstat (limited to 'src/GF/Compile/CheckGrammar.hs')
| -rw-r--r-- | src/GF/Compile/CheckGrammar.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/GF/Compile/CheckGrammar.hs b/src/GF/Compile/CheckGrammar.hs index 3a1b480ff..f7df7102d 100644 --- a/src/GF/Compile/CheckGrammar.hs +++ b/src/GF/Compile/CheckGrammar.hs @@ -269,6 +269,8 @@ inferLType gr trm = case trm of prtFail "cannot infer type of constant" trm ] + QC m ident | m==cPredef -> termWith trm $ checkErr (typPredefined ident) + QC m ident -> checks [ termWith trm $ checkErr (lookupResType gr m ident) , @@ -426,7 +428,7 @@ inferLType gr trm = case trm of _ -> False inferPatt p = case p of - PP q c ps -> checkErr $ lookupResType gr q c >>= valTypeCnc + PP q c ps | q /= cPredef -> checkErr $ lookupResType gr q c >>= valTypeCnc _ -> infer (patt2term p) >>= return . snd checkLType :: SourceGrammar -> Term -> Type -> Check (Term, Type) @@ -560,7 +562,7 @@ checkLType env trm typ0 = do pattContext :: LTEnv -> Type -> Patt -> Check Context pattContext env typ p = case p of PV x -> return [(x,typ)] - PP q c ps -> do + PP q c ps | q /= cPredef -> do t <- checkErr $ lookupResType cnc q c (cont,v) <- checkErr $ typeFormCnc t checkCond ("wrong number of arguments for constructor in" +++ prt p) |
