From: sewardj Date: Thu, 7 Jun 2001 16:00:18 +0000 (+0000) Subject: [project @ 2001-06-07 16:00:18 by sewardj] X-Git-Tag: Approximately_9120_patches~1786 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=8ec059154dab3adbbb7adbe29f906624cd76935e;p=ghc-hetmet.git [project @ 2001-06-07 16:00:18 by sewardj] Allow underscores in module names presented to the :module command. --- 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)