summaryrefslogtreecommitdiff
path: root/src/runtime/haskell/PGF/Parse.hs
diff options
context:
space:
mode:
authorkrasimir <krasimir@chalmers.se>2010-06-30 07:40:22 +0000
committerkrasimir <krasimir@chalmers.se>2010-06-30 07:40:22 +0000
commiteb0bd54e68ac3c776750c88ce4eb3d03954777f2 (patch)
treeea7a4c2077ecf364bff9cf8743b7977b30678a9a /src/runtime/haskell/PGF/Parse.hs
parent4c576ebbc9d0e4f470a6a84d6e59a95873f9d67a (diff)
rename isLiteralFCat -> isPredefFId, fcat(String|Int|Float) -> fid(String|Int|Float)
Diffstat (limited to 'src/runtime/haskell/PGF/Parse.hs')
-rw-r--r--src/runtime/haskell/PGF/Parse.hs24
1 files changed, 12 insertions, 12 deletions
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
----------------------------------------------------------------