From 21a5e3c2cb0c57fa7db2646440f54491f38e4056 Mon Sep 17 00:00:00 2001 From: hallgren Date: Tue, 4 Oct 2011 10:04:01 +0000 Subject: [PATCH] example-based grammar writing: avoid a problem by returning Nothing instead of calling error --- src/example-based/ExampleDemo.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/example-based/ExampleDemo.hs b/src/example-based/ExampleDemo.hs index 49aa6d218..0c187219a 100644 --- a/src/example-based/ExampleDemo.hs +++ b/src/example-based/ExampleDemo.hs @@ -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