summaryrefslogtreecommitdiff
path: root/src/GF/Compile/GrammarToCanon.hs
diff options
context:
space:
mode:
authoraarne <unknown>2004-09-23 14:41:42 +0000
committeraarne <unknown>2004-09-23 14:41:42 +0000
commit2c60a2d82a0d7b90924e7dbbcacf36afb8549d17 (patch)
tree0a04734e741c294cb9f58cfdcafa2ff2b55894dd /src/GF/Compile/GrammarToCanon.hs
parentd5b4230d6dbee8c03eedf8d181dfa2badf1a954b (diff)
Ints n
Diffstat (limited to 'src/GF/Compile/GrammarToCanon.hs')
-rw-r--r--src/GF/Compile/GrammarToCanon.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/GF/Compile/GrammarToCanon.hs b/src/GF/Compile/GrammarToCanon.hs
index ed145385c..12baa43f2 100644
--- a/src/GF/Compile/GrammarToCanon.hs
+++ b/src/GF/Compile/GrammarToCanon.hs
@@ -165,6 +165,9 @@ redCType t = case t of
Table p v -> liftM2 G.Table (redCType p) (redCType v)
Q m c -> liftM G.Cn $ redQIdent (m,c)
QC m c -> liftM G.Cn $ redQIdent (m,c)
+
+ App (Q (IC "Predef") (IC "Ints")) (EInt n) -> return $ G.TInts (toInteger n)
+
Sort "Str" -> return $ G.TStr
_ -> prtBad "cannot reduce to canonical the type" t
@@ -197,6 +200,7 @@ redCTerm t = case t of
return $ G.T ty' $ map (uncurry G.Cas) $ zip (map singleton ps') ts'
S u v -> liftM2 G.S (redCTerm u) (redCTerm v)
K s -> return $ G.K (G.KS s)
+ EInt i -> return $ G.EInt $ toInteger i
C u v -> liftM2 G.C (redCTerm u) (redCTerm v)
FV ts -> liftM G.FV $ mapM redCTerm ts
--- Ready ss -> return $ G.Ready [redStr ss] --- obsolete
@@ -224,6 +228,7 @@ redPatt p = case p of
ts <- mapM redPatt tts
return $ G.PR $ map (uncurry G.PAss) $ zip ls' ts
PT _ q -> redPatt q
+ PInt i -> return $ G.PI (toInteger i)
_ -> prtBad "cannot reduce pattern" p
redLabel :: Label -> G.Label