Changeset 4 for src/Main.hs

Show
Ignore:
Timestamp:
02/06/05 20:01:10 (4 years ago)
Author:
autrijus
svk:copy_cache_prev:
1041
Message:

* This be 6.0.0.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Main.hs

    r1 r4  
    1515 
    1616module Main where 
    17 import IO 
    18 import System 
     17import Internals 
    1918 
    2019import AST 
     
    3231run (('-':'e':str@(_:_)):args) = doRun str args 
    3332run ("-e":str:args) = doRun str args 
     33run ("-h":_)        = printHelp 
    3434run (file:args)     = readFile file >>= (`doRun` args) 
    3535run []              = do 
    3636    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 [] 
    3943 
    4044repLoop :: State -> IO () 
     
    4549           Load fn  -> load fn 
    4650           Eval str -> doEval str [] >> repLoop initState  
    47            Parse str-> parse str >> repLoop initState  
     51           Parse str-> doParse str >> repLoop initState  
    4852           Help     -> printHelp >> repLoop state  
    4953 
     
    5155    return () 
    5256 
    53 parse str = runLex print parseOp str 
     57doParse str = runLex print parseOp str 
    5458 
    5559eval str = doEval str []