Changeset 7867 for src/Pugs/CodeGen.hs

Show
Ignore:
Timestamp:
11/06/05 01:46:36 (3 years ago)
Author:
autrijus
Message:

* ./pugs -C Perl5 (and -C JSON, -C Binary) are deprecated.

Use "-C PIL1-Perl5" instead; it doesn't have to be a dash;
any nonalphanumerical character would do:

./pugs -CPIL1.Perl5 -e 'say 123'

This is because "-C Perl5" will be reserved to mean the
backend that actually compiles to Perl 5.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/CodeGen.hs

    r7866 r7867  
    2929generators = Map.fromList $ 
    3030    [ ("GHC",         genGHC) 
    31     , ("Parrot",      genPIR) 
    3231    , ("PIR",         genPIR) 
    3332    , ("PIL1",        genPIL1) 
     33    , ("PIL1-Perl5",  genPerl5) 
     34    , ("PIL1-Binary", genBinary) 
     35    , ("PIL1-JSON",   genJSON) 
    3436    , ("PIL2",        genPIL2) 
    3537    , ("PIL2-Perl5",  genPIL2Perl5) 
    3638    , ("PIL2-JSON",   genPIL2JSON) 
    3739    , ("PIL2-Binary", genPIL2Binary) 
    38     , ("Perl5",       genPerl5) 
    3940    , ("Pugs",        genPugs) 
    40     , ("Binary",      genBinary) 
    41     , ("JSON",        genJSON) 
    4241--  , ("XML",         genXML) 
    4342    ] 
     
    5049    where 
    5150    norm' "ghc"    = "GHC" 
    52     norm' "parrot" = "Parrot" 
     51    norm' "parrot" = "!PIR" 
    5352    norm' "pir"    = "PIR" 
    54     norm' "pil"    = "PIL1" -- XXX - this will change 
     53    norm' "pil"    = "!PIL1" 
    5554    norm' "pil1"   = "PIL1" 
    5655    norm' "pil2"   = "PIL2" 
    57     norm' "perl5"  = "Perl5" 
     56    norm' "perl5"  = "!PIL1-Perl5" 
     57    norm' "binary" = "!PIL1-Binary" 
     58    norm' "json"   = "!PIL1-JSON" 
     59    norm' "pil1perl5"  = "PIL1-Perl5" 
     60    norm' "pil1json"   = "PIL1-JSON" 
     61    norm' "pil1binary" = "PIL1-Binary" 
    5862    norm' "pil2perl5"  = "PIL2-Perl5" 
    5963    norm' "pil2json"   = "PIL2-JSON" 
    6064    norm' "pil2binary" = "PIL2-Binary" 
    6165    norm' "pugs"   = "Pugs" 
    62     norm' "binary" = "Binary" 
    63     norm' "json"   = "JSON" 
    6466    -- norm' "xml"    = "XML" 
    6567    norm' x        = x 
    6668 
    6769doLookup :: String -> IO Generator 
    68 doLookup s = Map.lookup (norm s) generators 
     70doLookup s = do 
     71    case norm s of 
     72        ('!':key) -> do 
     73            putStrLn $ "*** The backend '" ++ s ++ "' is deprecated." 
     74            putStrLn $ "    Please use '" ++ key ++ "' instead." 
     75            Map.lookup key generators 
     76        key -> Map.lookup key generators 
    6977 
    7078codeGen :: String -> Env -> IO String