Changeset 4 for src/Main.hs
- Timestamp:
- 02/06/05 20:01:10 (4 years ago)
- svk:copy_cache_prev:
- 1041
- Files:
-
- 1 modified
-
src/Main.hs (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Main.hs
r1 r4 15 15 16 16 module Main where 17 import IO 18 import System 17 import Internals 19 18 20 19 import AST … … 32 31 run (('-':'e':str@(_:_)):args) = doRun str args 33 32 run ("-e":str:args) = doRun str args 33 run ("-h":_) = printHelp 34 34 run (file:args) = readFile file >>= (`doRun` args) 35 35 run [] = do 36 36 hSetBuffering stdout NoBuffering 37 banner 38 repLoop () 37 isTTY <- hIsTerminalDevice stdin 38 if isTTY 39 then banner >> repLoop () 40 else do 41 str <- getContents 42 doRun str [] 39 43 40 44 repLoop :: State -> IO () … … 45 49 Load fn -> load fn 46 50 Eval str -> doEval str [] >> repLoop initState 47 Parse str-> parse str >> repLoop initState51 Parse str-> doParse str >> repLoop initState 48 52 Help -> printHelp >> repLoop state 49 53 … … 51 55 return () 52 56 53 parse str = runLex print parseOp str57 doParse str = runLex print parseOp str 54 58 55 59 eval str = doEval str []
