summaryrefslogtreecommitdiff
path: root/src/GF/Canon/CMacros.hs
diff options
context:
space:
mode:
authorbringert <unknown>2005-03-08 14:31:22 +0000
committerbringert <unknown>2005-03-08 14:31:22 +0000
commit7194efcea85e6a1d16b35fd2ad268dfc675a1b24 (patch)
tree4394b0668240b8e4d92d62d2d4a80313015033b8 /src/GF/Canon/CMacros.hs
parenta4b8921544c5e809f4f664d2fa19bb8257fa77bf (diff)
Finished UTF8 identifier conversion. Will probably redo it at string level, i.e. after pretty-printing instead
Diffstat (limited to 'src/GF/Canon/CMacros.hs')
-rw-r--r--src/GF/Canon/CMacros.hs42
1 files changed, 2 insertions, 40 deletions
diff --git a/src/GF/Canon/CMacros.hs b/src/GF/Canon/CMacros.hs
index ea4513a02..a097c4926 100644
--- a/src/GF/Canon/CMacros.hs
+++ b/src/GF/Canon/CMacros.hs
@@ -5,9 +5,9 @@
-- Stability : (stable)
-- Portability : (portable)
--
--- > CVS $Date: 2005/03/07 17:50:00 $
+-- > CVS $Date: 2005/03/08 15:31:22 $
-- > CVS $Author: bringert $
--- > CVS $Revision: 1.22 $
+-- > CVS $Revision: 1.23 $
--
-- Macros for building and analysing terms in GFC concrete syntax.
--
@@ -246,44 +246,6 @@ onTokens f t = case t of
K (KP ss vs) -> K (KP (map f ss) [Var (map f x) (map f y) | Var x y <- vs])
_ -> composSafeOp (onTokens f) t
--- | Apply some function to all identifiers in a GFC term
-onTermIdents :: (Ident -> Ident) -> Term -> Term
-onTermIdents f t = case t of
- Arg av -> Arg $ case av of
- A i x -> A (f i) x
- AB i x y -> AB (f i) x y
- I ci -> I (fc ci)
- Con ci ts -> Con (fc ci) (map (onTermIdents f) ts)
- LI i -> LI (f i)
- R as -> R [Ass (fl l) (onTermIdents f t) | Ass l t <- as]
- P t l -> P (onTermIdents f t) (fl l)
- T ct cs -> T (fct ct) [Cas (map fp ps) (onTermIdents f t) | Cas ps t <- cs]
- V ct ts -> V (fct ct) (map (onTermIdents f) ts)
- S t1 t2 -> S (onTermIdents f t1) (onTermIdents f t2)
- C t1 t2 -> C (onTermIdents f t1) (onTermIdents f t2)
- FV ts -> FV (map (onTermIdents f) ts)
- _ -> t
- where
- fc :: CIdent -> CIdent
- fc (CIQ i1 i2) = CIQ (f i1) (f i2)
- fl :: Label -> Label
- fl l = case l of
- L i -> L (f i)
- _ -> l
- fct :: CType -> CType
- fct ct = case ct of
- RecType ls -> RecType [ Lbg (fl l) (fct ct) | Lbg l ct <- ls ]
- Table t1 t2 -> Table (fct t1) (fct t2)
- Cn ci -> Cn (fc ci)
- _ -> ct
- fp :: Patt -> Patt
- fp p = case p of
- PC ci ps -> PC (fc ci) (map fp ps)
- PV i -> PV (f i)
- PR ps -> PR [PAss (fl l) (fp p) | PAss l p <- ps]
- _ -> p
-
-
-- | to define compositional term functions
composSafeOp :: (Term -> Term) -> Term -> Term
composSafeOp op trm = case composOp (mkMonadic op) trm of