summaryrefslogtreecommitdiff
path: root/src/GF/Grammar
diff options
context:
space:
mode:
authoraarne <unknown>2005-10-06 13:21:33 +0000
committeraarne <unknown>2005-10-06 13:21:33 +0000
commitbf2fdeb22ef950f7f5f375a3f4cf5f90abf87fd8 (patch)
tree89b99ebe943973d9fc03eb8c14dc69533615d958 /src/GF/Grammar
parentc2aeb9ae16c344c354194ec2efac773bbb7ce5d1 (diff)
eqStr ; pipe to system
Diffstat (limited to 'src/GF/Grammar')
-rw-r--r--src/GF/Grammar/AppPredefined.hs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/GF/Grammar/AppPredefined.hs b/src/GF/Grammar/AppPredefined.hs
index da81c0d83..5a2450632 100644
--- a/src/GF/Grammar/AppPredefined.hs
+++ b/src/GF/Grammar/AppPredefined.hs
@@ -5,9 +5,9 @@
-- Stability : (stable)
-- Portability : (portable)
--
--- > CVS $Date: 2005/06/26 20:40:33 $
+-- > CVS $Date: 2005/10/06 14:21:34 $
-- > CVS $Author: aarne $
--- > CVS $Revision: 1.12 $
+-- > CVS $Revision: 1.13 $
--
-- Predefined function type signatures and definitions.
-----------------------------------------------------------------------------
@@ -71,7 +71,7 @@ appPredefined t = case t of
-- two-place functions
App (Q (IC "Predef") (IC f)) z0 -> do
(z,_) <- appPredefined z0
- case (f, z, x) of
+ case (f, norm z, norm x) of
("drop", EInt i, K s) -> retb $ K (drop i s)
("take", EInt i, K s) -> retb $ K (take i s)
("tk", EInt i, K s) -> retb $ K (take (max 0 (length s - i)) s)
@@ -102,6 +102,9 @@ appPredefined t = case t of
where
retb t = return (t,True) -- no further computing needed
retf t = return (t,False) -- must be computed further
+ norm t = case t of
+ Empty -> K []
+ _ -> t
-- read makes variables into constants