summaryrefslogtreecommitdiff
path: root/src/GF/Grammar
diff options
context:
space:
mode:
authoraarne <unknown>2005-06-03 20:51:58 +0000
committeraarne <unknown>2005-06-03 20:51:58 +0000
commite8aa32d746df7b8554eda1bde0ca1fc513f07b58 (patch)
tree158d477f1d0d53423538798be03953044464901f /src/GF/Grammar
parent4b281ab7d637f5c91e3bdaf0b054bf0b2b6f273d (diff)
example substitutions
Diffstat (limited to 'src/GF/Grammar')
-rw-r--r--src/GF/Grammar/Macros.hs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/GF/Grammar/Macros.hs b/src/GF/Grammar/Macros.hs
index 89866c6bd..746526c85 100644
--- a/src/GF/Grammar/Macros.hs
+++ b/src/GF/Grammar/Macros.hs
@@ -5,9 +5,9 @@
-- Stability : (stable)
-- Portability : (portable)
--
--- > CVS $Date: 2005/05/09 15:45:00 $
+-- > CVS $Date: 2005/06/03 21:51:58 $
-- > CVS $Author: aarne $
--- > CVS $Revision: 1.21 $
+-- > CVS $Revision: 1.22 $
--
-- Macros for constructing and analysing source code terms.
--
@@ -280,6 +280,11 @@ mkRecTypeN int lab typs = RecType [ (lab i, t) | (i,t) <- zip [int..] typs]
mkRecType :: (Int -> Label) -> [Type] -> Type
mkRecType = mkRecTypeN 0
+record2subst :: Term -> Err Substitution
+record2subst t = case t of
+ R fs -> return [(zIdent x, t) | (LIdent x,(_,t)) <- fs]
+ _ -> prtBad "record expected, found" t
+
typeType, typePType, typeStr, typeTok, typeStrs :: Term
typeType = srt "Type"