Changeset 8491 for src/Pugs.hs

Show
Ignore:
Timestamp:
12/27/05 18:41:39 (3 years ago)
Author:
audreyt
Message:

* Support for "./pugs -B JS-Perl5 -e ...".

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs.hs

    r8474 r8491  
    8484run ("-C":backend:file:_)                = readFile file >>= doCompileDump backend file 
    8585 
    86 run ("-B":backend:_) | (== map toLower backend) `any` ["js","perl5"] = do 
     86run ("-B":backend:_) | (== map toLower backend) `any` ["js","perl5","js-perl5"] = do 
    8787    exec <- getArg0 
    8888    args <- getArgs 
     
    232232                   else (doExecuteHelper "runjs.pl"   args) 
    233233        "perl5" ->       doExecuteHelper "pugs-p5.pl" args 
     234        "js-perl5" -> doExecuteHelper "runjs.pl" (jsPerl5Args ++ args) 
    234235        _       ->       fail ("unknown backend: " ++ backend) 
    235236    where 
    236237    args' = f args 
     238    jsPerl5Args = words "--run=jspm --perl5" 
    237239    f [] = [] 
    238     f (bjs:rest)      | map toUpper bjs == "-BJS"      = f rest 
    239     f ("-B":js:rest)  | map toUpper  js == "JS"        = f rest 
     240    f (bjs:rest)      | "-BJS" `isPrefixOf` map toUpper bjs = f rest 
     241    f ("-B":js:rest)  | "JS" `isPrefixOf` map toUpper  js = f rest 
    240242    f (pugspath:rest) | "--pugs=" `isPrefixOf` pugspath = f rest 
    241243    f (x:xs) = x:f xs