Changeset 7146 for src/Main.hs
- Timestamp:
- 09/26/05 17:21:49 (3 years ago)
- Files:
-
- 1 modified
-
src/Main.hs (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Main.hs
r7139 r7146 79 79 run ("-c":file:_) = readFile file >>= doCheck file 80 80 81 run ("-C":backend:args) | map toUpper backend == "JS" = 82 doHelperRun "JS" ("--compile-only":args) 81 -- -CPerl5 outputs PIL formatted as Perl 5, PIL-Run is not involved. 82 -- Should we rename -CPerl5, -CJSON etc. to -CPIL.Perl5, -CPIL.JSON etc.? 83 run ("-C":backend:args) | map toUpper backend == "JS" = do 84 exec <- getArg0 85 doHelperRun "JS" ("--compile-only":("--pugs="++exec):args) 83 86 run ("-C":backend:"-e":prog:_) = doCompileDump backend "-e" prog 84 87 run ("-C":backend:file:_) = slurpFile file >>= doCompileDump backend file 85 88 86 run ("-B":backend:_) | (== map toLower backend) `any` ["js","perl5"] = 87 doHelperRun backend =<< getArgs 89 run ("-B":backend:_) | (== map toLower backend) `any` ["js","perl5"] = do 90 exec <- getArg0 91 args <- getArgs 92 doHelperRun backend (("--pugs="++exec):args) 88 93 run ("-B":backend:"-e":prog:_) = doCompileRun backend "-e" prog 89 94 run ("-B":backend:file:_) = slurpFile file >>= doCompileRun backend file … … 215 220 doHelperRun backend args = 216 221 case map toLower backend of 217 "js" -> if (args == [])222 "js" -> if (args' == []) 218 223 then (doExecuteHelper [ "perl5", "PIL2JS", "jspugs.pl" ] []) 219 224 else (doExecuteHelper [ "perl5", "PIL2JS", "runjs.pl" ] args) 220 225 "perl5" -> doExecuteHelper [ "perl5", "PIL-Run", "pugs-p5.pl" ] args 221 226 _ -> fail ("unknown backend: " ++ backend) 227 where 228 args' = f args 229 f [] = [] 230 f (bjs:rest) | map toUpper bjs == "-BJS" = f rest 231 f ("-B":js:rest) | map toUpper js == "JS" = f rest 232 f (pugspath:rest) | "--pugs=" `isPrefixOf` pugspath = f rest 233 f (x:xs) = x:f xs 222 234 223 235 doExecuteHelper :: [FilePath] -> [String] -> IO ()
