diff options
| author | hallgren <hallgren@chalmers.se> | 2011-10-04 10:04:01 +0000 |
|---|---|---|
| committer | hallgren <hallgren@chalmers.se> | 2011-10-04 10:04:01 +0000 |
| commit | 5f0d4079685610208216cc9d7f192e290df2b8e1 (patch) | |
| tree | 236644bd4d125f3ea651f32779b639f4d445d2ef /src | |
| parent | 4af079006bfc9f09548332bba08428c1155f9729 (diff) | |
example-based grammar writing: avoid a problem by returning Nothing instead of calling error
Diffstat (limited to 'src')
| -rw-r--r-- | src/example-based/ExampleDemo.hs | 2 |
1 files changed, 1 insertions, 1 deletions
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 |
