From dea5158cbf1c11d45f2ed91d9975fbc77245e652 Mon Sep 17 00:00:00 2001 From: aarne Date: Fri, 2 Dec 2005 13:13:14 +0000 Subject: floats in GF and GFC (parsing user input still doesn't work) --- src/GF/UseGrammar/Generate.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/GF/UseGrammar/Generate.hs') diff --git a/src/GF/UseGrammar/Generate.hs b/src/GF/UseGrammar/Generate.hs index 941695f8b..f2482e8e8 100644 --- a/src/GF/UseGrammar/Generate.hs +++ b/src/GF/UseGrammar/Generate.hs @@ -85,6 +85,7 @@ tr2str (Tr (N (_,at,val,_,_),ts)) = case (at,val) of (AtM _, v) -> SMeta (catOf v) (AtL s, _) -> SString s (AtI i, _) -> SInt i + (AtF i, _) -> SFloat i _ -> SMeta "FAILED_TO_GENERATE" ---- err monad! where catOf v = case v of @@ -148,7 +149,8 @@ data STree = SApp (SFun,[STree]) | SMeta SCat | SString String - | SInt Int + | SInt Integer + | SFloat Double deriving (Show,Eq) depth :: STree -> Int @@ -164,6 +166,7 @@ prSTree t = case t of SMeta c -> '?':c SString s -> prQuotedString s SInt i -> show i + SFloat i -> show i where pr1 t@(SApp (_,ts)) = ' ' : (if null ts then id else prParenth) (prSTree t) pr1 t = prSTree t -- cgit v1.2.3