mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-24 03:52:50 -06:00
diagnostic error message in GrammarToHaskell
This commit is contained in:
@@ -248,6 +248,7 @@ updateSkeleton cat skel rule =
|
|||||||
case skel of
|
case skel of
|
||||||
(cat0,rules):rr | cat0 == cat -> (cat0, rule:rules) : rr
|
(cat0,rules):rr | cat0 == cat -> (cat0, rule:rules) : rr
|
||||||
(cat0,rules):rr -> (cat0, rules) : updateSkeleton cat rr rule
|
(cat0,rules):rr -> (cat0, rules) : updateSkeleton cat rr rule
|
||||||
|
_ -> error $ cat ++ ": updating empty skeleton with" +++ show rule
|
||||||
|
|
||||||
isListCat :: (OIdent, [(OIdent, [OIdent])]) -> Bool
|
isListCat :: (OIdent, [(OIdent, [OIdent])]) -> Bool
|
||||||
isListCat (cat,rules) = "List" `isPrefixOf` cat && length rules == 2
|
isListCat (cat,rules) = "List" `isPrefixOf` cat && length rules == 2
|
||||||
@@ -267,4 +268,4 @@ isConsFun f = "Cons" `isPrefixOf` f
|
|||||||
|
|
||||||
baseSize :: (OIdent, [(OIdent, [OIdent])]) -> Int
|
baseSize :: (OIdent, [(OIdent, [OIdent])]) -> Int
|
||||||
baseSize (_,rules) = length bs
|
baseSize (_,rules) = length bs
|
||||||
where Just (_,bs) = find (("Base" `isPrefixOf`) . fst) rules
|
where Just (_,bs) = find (("Base" `isPrefixOf`) . fst) rules
|
||||||
|
|||||||
Reference in New Issue
Block a user