From 418856d9bfe23944528ba3d41710be0dbfab8d27 Mon Sep 17 00:00:00 2001 From: krasimir Date: Sun, 19 Oct 2008 14:21:58 +0000 Subject: move the literal category names to PGF.Macros --- src/PGF/Generate.hs | 5 +++-- src/PGF/Macros.hs | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'src/PGF') diff --git a/src/PGF/Generate.hs b/src/PGF/Generate.hs index 64ca4d5f5..518c2c71b 100644 --- a/src/PGF/Generate.hs +++ b/src/PGF/Generate.hs @@ -36,8 +36,9 @@ genRandom gen pgf cat = genTrees (randomRs (0.0, 1.0 :: Double) gen) cat where (genTrees ds2 cat) -- else (drop k ds) genTree rs = gett rs where - gett ds cid | cid == mkCId "String" = (Lit (LStr "foo"), 1) - gett ds cid | cid == mkCId "Int" = (Lit (LInt 12345), 1) + gett ds cid | cid == cidString = (Lit (LStr "foo"), 1) + gett ds cid | cid == cidInt = (Lit (LInt 12345), 1) + gett ds cid | cid == cidFloat = (Lit (LFlt 12345), 1) gett [] _ = (Lit (LStr "TIMEOUT"), 1) ---- gett ds cat = case fns cat of [] -> (Meta 0,1) diff --git a/src/PGF/Macros.hs b/src/PGF/Macros.hs index 9b768cd5f..b3847d4a0 100644 --- a/src/PGF/Macros.hs +++ b/src/PGF/Macros.hs @@ -140,4 +140,8 @@ combinations t = case t of aa:uu -> [a:u | a <- aa, u <- combinations uu] isLiteralCat :: CId -> Bool -isLiteralCat = (`elem` [mkCId "String", mkCId "Float", mkCId "Int"]) +isLiteralCat = (`elem` [cidString, cidFloat, cidInt]) + +cidString = mkCId "String" +cidInt = mkCId "Int" +cidFloat = mkCId "Float" -- cgit v1.2.3