From eb0bd54e68ac3c776750c88ce4eb3d03954777f2 Mon Sep 17 00:00:00 2001 From: krasimir Date: Wed, 30 Jun 2010 07:40:22 +0000 Subject: rename isLiteralFCat -> isPredefFId, fcat(String|Int|Float) -> fid(String|Int|Float) --- src/runtime/haskell/PGF/Parse.hs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/runtime/haskell/PGF/Parse.hs') diff --git a/src/runtime/haskell/PGF/Parse.hs b/src/runtime/haskell/PGF/Parse.hs index 073e2516a..7876e9749 100644 --- a/src/runtime/haskell/PGF/Parse.hs +++ b/src/runtime/haskell/PGF/Parse.hs @@ -138,10 +138,10 @@ feedLiteral (PState pgf cnc chart items) (ELit lit) = magic lit fid = case lit of - LStr s | fid == fcatString -> Just (cidString, ELit lit, words s) - LInt n | fid == fcatInt -> Just (cidInt, ELit lit, [show n]) - LFlt d | fid == fcatFloat -> Just (cidFloat, ELit lit, [show d]) - _ -> Nothing + LStr s | fid == fidString -> Just (cidString, ELit lit, words s) + LInt n | fid == fidInt -> Just (cidInt, ELit lit, [show n]) + LFlt d | fid == fidFloat -> Just (cidFloat, ELit lit, [show d]) + _ -> Nothing -- | If the next token is not known but only its prefix (possible empty prefix) -- then the 'getCompletions' function can be used to calculate the possible @@ -344,14 +344,14 @@ process mbt fn !seqs !funs (item@(Active j ppos funid seqid args key0):items) ac updateAt :: Int -> a -> [a] -> [a] updateAt nr x xs = [if i == nr then x else y | (i,y) <- zip [0..] xs] -litCatMatch (Just t) fcat - | fcat == fcatString = Just (cidString,ELit (LStr t),[t]) - | fcat == fcatInt = case reads t of {[(n,"")] -> Just (cidInt,ELit (LInt n),[t]); - _ -> Nothing } - | fcat == fcatFloat = case reads t of {[(d,"")] -> Just (cidFloat,ELit (LFlt d),[t]); - _ -> Nothing } - | fcat == fcatVar = Just (cidVar,EFun (mkCId t),[t]) -litCatMatch _ _ = Nothing +litCatMatch (Just t) fid + | fid == fidString = Just (cidString,ELit (LStr t),[t]) + | fid == fidInt = case reads t of {[(n,"")] -> Just (cidInt,ELit (LInt n),[t]); + _ -> Nothing } + | fid == fidFloat = case reads t of {[(d,"")] -> Just (cidFloat,ELit (LFlt d),[t]); + _ -> Nothing } + | fid == fidVar = Just (cidVar,EFun (mkCId t),[t]) +litCatMatch _ _ = Nothing ---------------------------------------------------------------- -- cgit v1.2.3