mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-24 03:52:50 -06:00
example-based grammar writing: avoid a problem by returning Nothing instead of calling error
This commit is contained in:
@@ -158,7 +158,7 @@ embedInStart fss cs =
|
|||||||
nextmap = Map.union cs nextset
|
nextmap = Map.union cs nextset
|
||||||
maybeExpr = Map.lookup startCateg nextset
|
maybeExpr = Map.lookup startCateg nextset
|
||||||
in if isNothing maybeExpr then
|
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 embedInStart fss nextmap
|
||||||
else return $ fromJust maybeExpr
|
else return $ fromJust maybeExpr
|
||||||
where
|
where
|
||||||
|
|||||||
Reference in New Issue
Block a user