Changeset 3629 for src/Main.hs

Show
Ignore:
Timestamp:
05/22/05 08:08:51 (4 years ago)
Author:
knew
svk:copy_cache_prev:
5201
Message:

* Made backend selection case-insensitive
* And updated t/pugsrun/09-dash-uppercase-c.t to test it

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Main.hs

    r3538 r3629  
    159159doCompileDump :: String -> FilePath -> String -> IO () 
    160160doCompileDump backend file prog = do 
    161     str <- doCompile backend file prog 
     161    str <- doCompile backend' file prog 
    162162    writeFile "dump.ast" str 
     163    where 
     164    backend' = capitalizeWord backend 
     165    capitalizeWord []     = [] 
     166    capitalizeWord (c:cs) = toUpper c:(map toLower cs) 
    163167 
    164168doCompileRun :: String -> FilePath -> String -> IO () 
    165169doCompileRun backend file prog = do 
    166     str <- doCompile backend file prog 
    167     evalEmbedded backend str 
     170    str <- doCompile backend' file prog 
     171    evalEmbedded backend' str 
     172    where 
     173    backend' = capitalizeWord backend 
     174    capitalizeWord []     = [] 
     175    capitalizeWord (c:cs) = toUpper c:(map toLower cs) 
    168176 
    169177doParseWith :: (Env -> FilePath -> IO a) -> FilePath -> String -> IO a