mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 04:59:31 -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
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user