From 8ec059154dab3adbbb7adbe29f906624cd76935e Mon Sep 17 00:00:00 2001 From: sewardj Date: Thu, 7 Jun 2001 16:00:18 +0000 Subject: [PATCH] [project @ 2001-06-07 16:00:18 by sewardj] Allow underscores in module names presented to the :module command. --- ghc/compiler/ghci/InteractiveUI.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ghc/compiler/ghci/InteractiveUI.hs b/ghc/compiler/ghci/InteractiveUI.hs index 011bb86..d0bc03c 100644 --- a/ghc/compiler/ghci/InteractiveUI.hs +++ b/ghc/compiler/ghci/InteractiveUI.hs @@ -1,5 +1,5 @@ ----------------------------------------------------------------------------- --- $Id: InteractiveUI.hs,v 1.72 2001/06/06 14:33:13 sewardj Exp $ +-- $Id: InteractiveUI.hs,v 1.73 2001/06/07 16:00:18 sewardj Exp $ -- -- GHC Interactive User Interface -- @@ -363,8 +363,10 @@ addModule _ = throwDyn (InstallationError ":add not implemented") setContext :: String -> GHCi () setContext "" = throwDyn (CmdLineError "syntax: `:m '") -setContext m | not (isUpper (head m)) || not (all isAlphaNum (tail m)) +setContext m | not (isUpper (head m)) || not (all isAlphaNumEx (tail m)) = throwDyn (CmdLineError ("strange looking module name: `" ++ m ++ "'")) + where + isAlphaNumEx c = isAlphaNum c || c == '_' setContext str = do st <- getGHCiState new_cmstate <- io (cmSetContext (cmstate st) str) -- 1.7.10.4