1
0
forked from GitHub/gf-core

removed the Str/Tok distinction in CheckGrammar - obsolete anyway.

This commit is contained in:
aarne
2007-05-03 13:55:34 +00:00
parent 94d4ec728c
commit 5f2121e181

View File

@@ -348,6 +348,7 @@ computeLType gr t = do
let fs' = sortBy (\x y -> compare (fst x) (fst y)) fs let fs' = sortBy (\x y -> compare (fst x) (fst y)) fs
liftM RecType $ mapPairsM comp fs' liftM RecType $ mapPairsM comp fs'
_ | ty == typeTok -> return typeStr
_ | isPredefConstant ty -> return ty _ | isPredefConstant ty -> return ty
_ -> composOp comp ty _ -> composOp comp ty
@@ -460,13 +461,13 @@ inferLType gr trm = case trm of
then checkWarn ("Warning: space in token \"" ++ s ++ then checkWarn ("Warning: space in token \"" ++ s ++
"\". Lexical analysis may fail.") "\". Lexical analysis may fail.")
else return () else return ()
return (trm, typeTok) return (trm, typeStr)
EInt i -> return (trm, typeInt) EInt i -> return (trm, typeInt)
EFloat i -> return (trm, typeFloat) EFloat i -> return (trm, typeFloat)
Empty -> return (trm, typeTok) Empty -> return (trm, typeStr)
C s1 s2 -> C s1 s2 ->
check2 (flip justCheck typeStr) C s1 s2 typeStr check2 (flip justCheck typeStr) C s1 s2 typeStr
@@ -571,8 +572,8 @@ inferLType gr trm = case trm of
PAs _ p -> inferPatt p PAs _ p -> inferPatt p
PNeg p -> inferPatt p PNeg p -> inferPatt p
PAlt p q -> checks [inferPatt p, inferPatt q] PAlt p q -> checks [inferPatt p, inferPatt q]
PSeq _ _ -> return $ typeTok PSeq _ _ -> return $ typeStr
PRep _ -> return $ typeTok PRep _ -> return $ typeStr
_ -> infer (patt2term p) >>= return . snd _ -> infer (patt2term p) >>= return . snd