diff options
| author | aarne <aarne@cs.chalmers.se> | 2005-12-02 13:13:14 +0000 |
|---|---|---|
| committer | aarne <aarne@cs.chalmers.se> | 2005-12-02 13:13:14 +0000 |
| commit | dea5158cbf1c11d45f2ed91d9975fbc77245e652 (patch) | |
| tree | 751ef7bcaccf58c43354d5b1767d3b3d3d1ac34d /src/GF/UseGrammar/Generate.hs | |
| parent | 50ddb387f4495beb8bd8da2b9726a087a489df68 (diff) | |
floats in GF and GFC (parsing user input still doesn't work)
Diffstat (limited to 'src/GF/UseGrammar/Generate.hs')
| -rw-r--r-- | src/GF/UseGrammar/Generate.hs | 5 |
1 files changed, 4 insertions, 1 deletions
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 |
