diff options
| author | aarne <aarne@cs.chalmers.se> | 2005-12-11 17:48:55 +0000 |
|---|---|---|
| committer | aarne <aarne@cs.chalmers.se> | 2005-12-11 17:48:55 +0000 |
| commit | 9f867c4922cccb6e61b273a55103e2afaeac4bde (patch) | |
| tree | b31dba589c596b272d0e6ad0fec7079cd0d92ab5 /src/GF/Canon | |
| parent | 8ee11c0e7edaa32b606ac96ec24cc2f8d0bca2e3 (diff) | |
float parsing fixed
Diffstat (limited to 'src/GF/Canon')
| -rw-r--r-- | src/GF/Canon/CMacros.hs | 14 | ||||
| -rw-r--r-- | src/GF/Canon/MkGFC.hs | 6 |
2 files changed, 18 insertions, 2 deletions
diff --git a/src/GF/Canon/CMacros.hs b/src/GF/Canon/CMacros.hs index 2facd6e65..bb80fb0fa 100644 --- a/src/GF/Canon/CMacros.hs +++ b/src/GF/Canon/CMacros.hs @@ -227,6 +227,20 @@ allLinValues trm = do lts <- allLinFields trm mapM (mapPairsM (return . allCaseValues)) lts +-- | to gather all fields; does not assume s naming of fields; +-- used in Morpho only +allAllLinValues :: Term -> Err [[(Label,[([Patt],Term)])]] +allAllLinValues trm = do + lts <- allFields trm + mapM (mapPairsM (return . allCaseValues)) lts + where + allFields trm = case trm of + R rs -> return [[(l,t) | Ass l t <- rs]] + FV ts -> do + lts <- mapM allFields ts + return $ concat lts + _ -> prtBad "fields can only be sought in a record not in" trm + -- | to gather all linearizations, even from nested records; params ignored allLinBranches :: Term -> [([Label],Term)] allLinBranches trm = case trm of diff --git a/src/GF/Canon/MkGFC.hs b/src/GF/Canon/MkGFC.hs index 69ccc3034..8443354fc 100644 --- a/src/GF/Canon/MkGFC.hs +++ b/src/GF/Canon/MkGFC.hs @@ -112,12 +112,14 @@ trExp t = case t of AM i -> A.Meta $ A.MetaSymb $ fromInteger i AT s -> A.Sort $ prt s AS s -> A.K s - AI i -> A.EInt $ fromInteger i + AI i -> A.EInt $ i + AF i -> A.EFloat $ i trPt p = case p of APC mc ps -> let (m,c) = trQIdent mc in A.PP m c (map trPt ps) APV x -> A.PV x APS s -> A.PString s - API i -> A.PInt $ fromInteger i + API i -> A.PInt $ i + APF i -> A.PFloat $ i APW -> A.PW trQIdent (CIQ m c) = (m,c) |
