From abea46022ef35df493a8d78f56f5e9211150c54b Mon Sep 17 00:00:00 2001 From: "kr.angelov" Date: Thu, 5 Jun 2008 12:00:51 +0000 Subject: [PATCH] fix the error checking in the word completion --- src-3.0/GFI.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src-3.0/GFI.hs b/src-3.0/GFI.hs index 74ebaf90b..ba26eb667 100644 --- a/src-3.0/GFI.hs +++ b/src-3.0/GFI.hs @@ -114,7 +114,7 @@ emptyGFEnv :: GFEnv emptyGFEnv = GFEnv emptyGrammar (mkCommandEnv emptyPGF) [] 0 -wordCompletion cmdEnv line prefix p = do +wordCompletion cmdEnv line prefix p = case wc_type (take p line) of CmplCmd pref -> ret ' ' [name | name <- Map.keys (commands cmdEnv), isPrefixOf pref name] @@ -134,7 +134,10 @@ wordCompletion cmdEnv line prefix p = do (flg_compls++opt_compls) Nothing -> ret ' ' [] CmplIdent _ pref - -> ret ' ' [name | cid <- Map.keys (funs (abstract pgf)), let name = prCId cid, isPrefixOf pref name] + -> do mb_abs <- try (evaluate (abstract pgf)) + case mb_abs of + Right abs -> ret ' ' [name | cid <- Map.keys (funs abs), let name = prCId cid, isPrefixOf pref name] + Left _ -> ret ' ' [] _ -> ret ' ' [] where pgf = multigrammar cmdEnv