Changeset 7867

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:
7 modified

Legend:

Unmodified
Added
Removed
  • perl5/PIL-Run/lib/PIL/Run/EvalX.pm

    r7153 r7867  
    289289    } 
    290290    my $extra_args = $main::pugs_args ? $main::pugs_args : ""; #XXX- kludge 
    291     my $cmd = "$pugs $extra_args $dir -CPerl5 $fn"; 
     291    my $cmd = "$pugs $extra_args $dir -CPIL1-Perl5 $fn"; 
    292292    my $pil = `$cmd`; #die if $!; 
    293293    unlink $fn or die "Couldn't remove \"$fn\": $!\n"; 
     
    306306    my($pil)=@_; 
    307307    my $pilc = eval($pil); 
    308     die "Eval of -CPerl5 code failed. $@" if $@; 
     308    die "Eval of -CPIL1-Perl5 code failed. $@" if $@; 
    309309    $pilc; 
    310310} 
  • perl5/PIL2JS/README

    r7663 r7867  
    66 
    77C<pil2js.pl> is a Perl 5 program which takes PIL as input (as given by C<pugs 
    8 -CPerl5>) and outputs JavaScript. 
     8-CPIL1-Perl5>) and outputs JavaScript. 
    99 
    1010=head1 USAGE 
     
    4949  |   |-- PIL.pm          Main compiler modules, uses all other PIL:: modules 
    5050  |   |-- PIL 
    51   |   |   |-- Parser.pm   PIL::Parser (parses the output of -CPerl5) 
     51  |   |   |-- Parser.pm   PIL::Parser (parses the output of -CPIL1-Perl5) 
    5252  |   |   `-- <PIL nodetype>.pm 
    5353  |   |                   Backend compiler modules 
     
    440440 
    441441  # Compile the Perl 6 to PIL 
    442   $ pugs -CPerl5 -we ' 
     442  $ pugs -CPIL1-Perl5 -we ' 
    443443      $*JS::JSAN.addRepository("/tmp/jsanlibs"); 
    444444      use jsan:Number.Roman <to_roman>; 
     
    568568=item * 
    569569 
    570 Don't call all subs in list context -- but to fix this reliably, C<-CPerl5> has 
     570Don't call all subs in list context -- but to fix this reliably, C<-CPIL1-Perl5> has 
    571571to give better context information. 
    572572 
  • perl5/PIL2JS/lib/PIL/Parser.pm

    r7624 r7867  
    11package PIL::Parser; 
    2 # This module takes the output of pugs -CPerl5, eval()s it, and reblesses most 
     2# This module takes the output of pugs -CPIL1-Perl5, eval()s it, and reblesses most 
    33# objects (we want PIL::PVal, not PVal). 
    44 
     
    2020 
    2121  my $struct = eval $str; 
    22   die "Couldn't parse -CPerl5 output: $@\n" if $@; 
     22  die "Couldn't parse -CPIL1-Perl5 output: $@\n" if $@; 
    2323  Class::Rebless->custom($struct, "PIL", { editor => sub { 
    2424    my ($obj, $namespace) = @_; 
  • perl5/PIL2JS/lib/PIL2JS.pm

    r7601 r7867  
    6666  preludepc_check(); 
    6767 
    68   my $pil  = run_pugs("-CPerl5", @_); 
     68  my $pil  = run_pugs("-CPIL1-Perl5", @_); 
    6969  die "Error: Couldn't compile to PIL!\n" if not defined $pil; 
    7070  my $mini = run_pil2js(\$pil); 
     
    7575 
    7676sub compile_perl6_to_mini_js { 
    77   my $pil = run_pugs("-CPerl5", @_); 
     77  my $pil = run_pugs("-CPIL1-Perl5", @_); 
    7878  die "Error: Couldn't compile to PIL!\n" if not defined $pil; 
    7979 
     
    9595 
    9696sub precomp_module_to_mini_js { 
    97   my $pil = eval { run_pugs("-CPerl5", @_, "-e", "''") }; 
     97  my $pil = eval { run_pugs("-CPIL1-Perl5", @_, "-e", "''") }; 
    9898  die $@ if $@; 
    9999  my $js  = eval { run_pil2js("-v", \$pil) }; 
     
    103103 
    104104sub compile_perl6_to_pil { 
    105   my $pil = run_pugs("-CPerl5", @_); 
     105  my $pil = run_pugs("-CPIL1-Perl5", @_); 
    106106  die "Error: Couldn't compile to PIL!\n" if not defined $pil; 
    107107  return $pil; 
  • perl5/PIL2JS/pil2js.pl

    r7446 r7867  
    5656 
    5757  my $pil  = $input[0] =~ /\.(?:pl|p6|pm|p6m|t)$/i 
    58     ? decode "utf-8", run_pugs("-CPerl5", $input[0]) 
     58    ? decode "utf-8", run_pugs("-CPIL1-Perl5", $input[0]) 
    5959    : slurp $input[0]; 
    6060  my $tree = PIL::Parser->parse($pil); 
  • src/Pugs.hs

    r7479 r7867  
    7878run ("-c":file:_)               = readFile file >>= doCheck file 
    7979 
    80 -- -CPerl5 outputs PIL formatted as Perl 5, PIL-Run is not involved. 
    81 -- Should we rename -CPerl5, -CJSON etc. to -CPIL.Perl5, -CPIL.JSON etc.? 
     80-- -CPIL1.Perl5 outputs PIL formatted as Perl 5. 
    8281run ("-C":backend:args) | map toUpper backend == "JS" = do 
    8382    exec <- getArg0 
  • 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