Changeset 5444

Show
Ignore:
Timestamp:
07/11/05 21:48:20 (3 years ago)
Author:
bsmith
svk:copy_cache_prev:
7349
Message:

* Moved version variables from Pugs.Help to Pugs.Version.
* Pugs.Help now import Pugs.CodeGen? so that it can produce a correct list of
backends in the -h message.
* Fixed script/pugscc to use the Ghc backend rather than the Haskell backend
for --haskell and --ghc.

Files:
1 added
4 modified

Legend:

Unmodified
Added
Removed
  • script/pugscc

    r5354 r5444  
    2929 
    3030my $backend = 'Pugs'; 
    31 if ($ARGV[0] =~ /^(?:-H|--haskell)$/) { 
    32     $backend = 'Haskell'; 
     31if ($ARGV[0] =~ /^(?:-H|--haskell|--ghc)$/) { 
     32    $backend = 'Ghc'; 
    3333    shift @ARGV; 
    3434} 
  • src/Pugs/Help.hs

    r4811 r5444  
    1010-} 
    1111 
    12 #define PUGS_VERSION "6" 
    13 #define PUGS_DATE "" 
    1412#include "pugs_config.h" 
    15 #include "pugs_version.h" 
    1613 
    1714module Pugs.Help (printInteractiveHelp, printCommandLineHelp, 
    1815             banner, versnum, version, revnum, 
    1916             copyright, disclaimer, intro) where 
     17import Pugs.Version 
     18import Pugs.CodeGen (backends) 
    2019 
    2120printInteractiveHelp :: IO () 
     
    4342        putStrLn "-Bbackend        execute using the compiler backend" 
    4443        putStrLn "-Cbackend        compile using the compiler backend" 
    45         putStrLn "                 (valid backends are: Pugs, Parrot, PIR, Haskell)" 
     44        putStrLn ("                 (valid backends are: " ++ backendsStr ++ ")") 
    4645        putStrLn "-Mmodule         execute 'use module' before executing the program" 
    4746        putStrLn "-h or --help     give this message" 
     
    5150        putStrLn "-l -d and -w are ignored for compatability with Perl 5" 
    5251        putStrLn "See documentation of pugs::run for more help." 
    53  
    54 name :: String 
    55 name       = "Perl6 User's Golfing System" 
    56 versnum :: String 
    57 versnum    = PUGS_VERSION 
    58 date :: String 
    59 date       = PUGS_DATE 
    60 version :: String 
    61 version    = name ++ ", version " ++ versnum ++ ", " ++ date ++ revision 
    62 copyright :: String 
    63 copyright  = "Copyright 2005 by Autrijus Tang" 
    64 revnum :: String 
    65 revnum     = show(PUGS_SVN_REVISION :: Integer) 
    66 revision :: String 
    67 revision 
    68     | rev <- revnum 
    69     , rev /= "0" 
    70     = " (r" ++ rev ++ ")" 
    71     | otherwise 
    72     = "" 
    73 disclaimer :: String 
    74 disclaimer = 
    75     "This software is distributed under the terms of the " ++ 
    76     "GNU Public Licence.\n" ++ 
    77     "NO WARRANTY WHATSOEVER IS PROVIDED. " ++ 
    78     "See the details in the documentation." 
     52    where 
     53    backendsStr = foldr1 addComma backends 
     54    addComma w s = w ++ (',':' ':s) 
    7955 
    8056versionFill :: Int -> String 
  • src/Pugs/Parser.hs

    r5443 r5444  
    2020import Pugs.Types 
    2121import Pugs.Context 
    22 import Pugs.Help 
     22import Pugs.Version (versnum) 
    2323import Pugs.Lexer 
    2424import Pugs.Rule 
  • util/PugsConfig.pm

    r5253 r5444  
    136136 
    137137import qualified Data.Map as Map 
    138 import qualified Pugs.Help 
     138import qualified Pugs.Version 
    139139 
    140140config :: Map.Map String String 
    141141config = Map.fromList 
    142142    [#all_definitions# 
    143     ,("pugs_versnum", Pugs.Help.versnum) 
    144     ,("pugs_version", Pugs.Help.version) 
    145     ,("pugs_revision", Pugs.Help.revnum) 
     143    ,("pugs_versnum", Pugs.Version.versnum) 
     144    ,("pugs_version", Pugs.Version.version) 
     145    ,("pugs_revision", Pugs.Version.revnum) 
    146146    ] 
    147147