Changeset 3701

Show
Ignore:
Timestamp:
05/23/05 02:13:17 (4 years ago)
Author:
autrijus
svk:copy_cache_prev:
5201
Message:

* Normalise all Shell commands to begin with : and

reorganise Help message for :h a bit.

Location:
src/Pugs
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Help.hs

    r3516 r3701  
    2424        putStrLn ":h              = show this help message" 
    2525        putStrLn ":q              = quit" 
    26         putStrLn ". <exp>         = show the syntax tree of an expression" 
    27         putStrLn "? <exp>         = evaluate an expression in small steps" 
    28         putStrLn "! <exp>         = same, but in the interactive environment" 
    29         putStrLn "<exp>           = run a command" 
    30         putStrLn ":i <exp>        = run a command, and ugly-print the result" 
    3126        putStrLn ":r              = reset the evaluation environment" 
    3227        putStrLn ":l <filename>   = load a pugs file" 
     28        putStrLn ":d <exp>        = show syntax tree of an expression" 
     29        putStrLn ":D <exp>        = show raw syntax tree of an expression" 
     30        putStrLn ":e <exp>        = run a command, and ugly-print the result" 
     31        putStrLn ":E <exp>        = same, but evaluate in small steps" 
     32        putStrLn "<exp>           = run a command" 
    3333 
    3434{- FIXME: Somebody with more UI skillz should make this nicer -} 
  • src/Pugs/Shell.hs

    r3636 r3701  
    4949 
    5050parseCommandLine :: String -> Command  
    51 parseCommandLine ('?':str)      = CmdRun (RunOpts True True  True) str 
    52 parseCommandLine ('!':str)      = CmdRun (RunOpts True False True) str 
    53 parseCommandLine ('.':'.':str)  = CmdParseRaw str 
    54 parseCommandLine ('.':str)      = CmdParse str 
     51parseCommandLine (':':'e':str)  = CmdRun (RunOpts False True False) str 
     52parseCommandLine (':':'E':str)  = CmdRun (RunOpts True True False) str 
     53parseCommandLine (':':'d':str)  = CmdParse str 
     54parseCommandLine (':':'D':str)  = CmdParseRaw str 
    5555parseCommandLine (':':'q':_)    = CmdQuit 
    5656parseCommandLine (':':'h':_)    = CmdHelp 
    5757parseCommandLine (':':'r':_)    = CmdReset 
    58 parseCommandLine (':':'i':str)  = CmdRun (RunOpts False False False) str 
    5958parseCommandLine (':':'l':str)  = CmdLoad $ unwords (words str) 
    6059parseCommandLine str            = CmdRun (RunOpts False False True) str