diff options
| author | aarne <unknown> | 2004-09-23 14:41:42 +0000 |
|---|---|---|
| committer | aarne <unknown> | 2004-09-23 14:41:42 +0000 |
| commit | 2c60a2d82a0d7b90924e7dbbcacf36afb8549d17 (patch) | |
| tree | 0a04734e741c294cb9f58cfdcafa2ff2b55894dd /src/GF/Compile/CheckGrammar.hs | |
| parent | d5b4230d6dbee8c03eedf8d181dfa2badf1a954b (diff) | |
Ints n
Diffstat (limited to 'src/GF/Compile/CheckGrammar.hs')
| -rw-r--r-- | src/GF/Compile/CheckGrammar.hs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/GF/Compile/CheckGrammar.hs b/src/GF/Compile/CheckGrammar.hs index 3a4706f27..8f152ff17 100644 --- a/src/GF/Compile/CheckGrammar.hs +++ b/src/GF/Compile/CheckGrammar.hs @@ -233,6 +233,9 @@ computeLType gr t = do where comp ty = case ty of + App (Q (IC "Predef") (IC "Ints")) _ -> return ty ---- shouldn't be needed + Q (IC "Predef") (IC "Int") -> return ty ---- shouldn't be needed + Q m c | elem c [cPredef,cPredefAbs] -> return ty Q m ident -> checkIn ("Q" +++ show m) $ do @@ -664,6 +667,15 @@ checkEqLType env t u trm = do all (\ (l,a) -> any (\ (k,b) -> alpha g a b && l == k) ts) rs + -- the following say that Ints n is a subset of Int and of Ints m + (App (Q (IC "Predef") (IC "Ints")) (EInt n), + App (Q (IC "Predef") (IC "Ints")) (EInt m)) -> m >= n + (App (Q (IC "Predef") (IC "Ints")) (EInt n), + Q (IC "Predef") (IC "Int")) -> True ---- should check size + + (Q (IC "Predef") (IC "Int"), + App (Q (IC "Predef") (IC "Ints")) (EInt n)) -> True + (Table a b, Table c d) -> alpha g a c && alpha g b d (Vr x, Vr y) -> x == y || elem (x,y) g || elem (y,x) g _ -> t == u |
