1
0
forked from GitHub/gf-core

example-based grammar writing: avoid a problem by returning Nothing instead of calling error

This commit is contained in:
hallgren
2011-10-04 10:04:01 +00:00
parent 64daed40df
commit 21a5e3c2cb

View File

@@ -158,7 +158,7 @@ embedInStart fss cs =
nextmap = Map.union cs nextset
maybeExpr = Map.lookup startCateg nextset
in if isNothing maybeExpr then
if Map.size nextmap == Map.size cs then error $ "could't build " ++ show startCateg ++ "with " ++ show fss
if Map.size nextmap == Map.size cs then Nothing --error $ "could't build " ++ show startCateg ++ "with " ++ show fss
else embedInStart fss nextmap
else return $ fromJust maybeExpr
where