in initState report the error strictly. This allows to catch it easily

This commit is contained in:
kr.angelov
2008-06-05 11:26:48 +00:00
parent 1068fbc7cf
commit f5fd3aa603

View File

@@ -187,13 +187,13 @@ parseAll mgr cat = map snd . parseAllLang mgr cat
parseAllLang mgr cat s =
[(lang,ts) | lang <- languages mgr, let ts = parse mgr lang cat s, not (null ts)]
initState pgf lang cat = Incremental.initState pinfo catCId
initState pgf lang cat =
case lookParser pgf langCId of
Just pinfo -> Incremental.initState pinfo catCId
_ -> error ("Unknown language: " ++ lang)
where
langCId = mkCId lang
catCId = mkCId cat
pinfo = case lookParser pgf langCId of
Just pinfo -> pinfo
_ -> error ("Unknown language: " ++ lang)
extractExps state cat = Incremental.extractExps state (mkCId cat)