diagnostic error message in GrammarToHaskell

This commit is contained in:
aarne
2007-11-15 17:09:33 +00:00
parent 43eb40a688
commit 8852637997

View File

@@ -248,6 +248,7 @@ updateSkeleton cat skel rule =
case skel of
(cat0,rules):rr | cat0 == cat -> (cat0, rule:rules) : rr
(cat0,rules):rr -> (cat0, rules) : updateSkeleton cat rr rule
_ -> error $ cat ++ ": updating empty skeleton with" +++ show rule
isListCat :: (OIdent, [(OIdent, [OIdent])]) -> Bool
isListCat (cat,rules) = "List" `isPrefixOf` cat && length rules == 2
@@ -267,4 +268,4 @@ isConsFun f = "Cons" `isPrefixOf` f
baseSize :: (OIdent, [(OIdent, [OIdent])]) -> Int
baseSize (_,rules) = length bs
where Just (_,bs) = find (("Base" `isPrefixOf`) . fst) rules
where Just (_,bs) = find (("Base" `isPrefixOf`) . fst) rules