Changeset 2629

Show
Ignore:
Timestamp:
05/02/05 19:26:05 (4 years ago)
Author:
autrijus
svk:copy_cache_prev:
4152
Message:

* PGE is now part of Pugs; :P5 restriction lifted from rx// and s///.

Files:
7 added
4 modified

Legend:

Unmodified
Added
Removed
  • Makefile.PL

    r2622 r2629  
    9393    my $pcre_c = "src/pcre/pcre.c"; 
    9494    my @syck_c = glob("src/syck/*.c"); 
     95    my @pge_c = glob("src/pge/*.c"); 
    9596    my $pcre = "src/pcre/pcre.o"; 
    9697    my @syck = map { substr($_, 0, -1) . 'o' } @syck_c; 
     98    my @pge = map { substr($_, 0, -1) . 'o' } @pge_c; 
    9799    my $unicode = "src/UnicodeC.o"; 
    98100    my $unicode_c = "src/UnicodeC.c"; 
    99101 
    100     my @prereqs = ($config_h, $pcre, @syck, $unicode); 
    101     $ghc_output .= " $pcre @syck $unicode"; 
     102    my @prereqs = ($config_h, $pcre, @syck, @pge, $unicode); 
     103    $ghc_output .= " $pcre @syck @pge $unicode"; 
    102104 
    103105    my $config = get_pugs_config(); 
     
    126128        \$(NOOP) 
    127129 
    128 @{[join("\n", map {$emit->($_)} ($unicode_c, $pcre_c, @syck_c))]} 
     130@{[join("\n", map {$emit->($_)} ($unicode_c, $pcre_c, @syck_c, @pge_c))]} 
    129131 
    130132src/Pugs/Config.hs : util/PugsConfig.pm 
  • README

    r2621 r2629  
    1313 
    1414Pugs is Copyright 2005 by Autrijus Tang.  All Rights Reserved. 
     15 
     16The "PGE" subsystem is derived from PGE by Patrick Michaud, 
     17under the Perl license.  See src/pge/README. 
    1518 
    1619The "PCRE" subsystem is derived from PCRE 5.0 by Philip Hazel, 
  • inc/Module/Install/Pugs.pm

    r2621 r2629  
    163163. 
    164164    } 
    165     my $ghc_flags = "-H0 -L. -Lsrc -Lsrc/syck -Lsrc/pcre -I. -Isrc -Isrc/pcre -Isrc/syck"; 
    166     $ghc_flags .= " -i. -isrc -isrc/pcre -isrc/syck -static "; 
     165    my $ghc_flags = "-H0 -L. -Lsrc -Lsrc/syck -Lsrc/pge -Lsrc/pcre -I. -Isrc -Isrc/pcre -Isrc/syck -Isrc/pge"; 
     166    $ghc_flags .= " -i. -isrc -isrc/pcre -isrc/syck -isrc/pge -static "; 
    167167    $ghc_flags .= " -Wall -Werror " 
    168168      unless $self->is_extension_build; 
  • src/Pugs/Eval.hs

    r2615 r2629  
    3636        syms <- initSyms 
    3737        glob <- newTVar (combine (pad ++ syms) $ mkPad []) 
    38         return $ Env 
     38        return $ MkEnv 
    3939            { envContext = CxtVoid 
    4040            , envLexical = mkPad [] 
     
    508508        flag_i  <- fromAdverb hv ["i", "ignorecase"] 
    509509        when (not p5) $ do 
    510             fail "Perl 6 rules is not implemented yet, use :P5" 
     510            parsed <- liftIO $ parseRule ("(" ++ encodeUTF8 str ++ ")") 
     511            let banner = "\n*** Perl 6 rules support coming soon...\n" 
     512            error $ banner ++ parsed ++ banner 
    511513        retVal $ VRule $ MkRule 
    512514            { rxRegex  = mkRegexWithPCRE (encodeUTF8 str) $ 
     
    788790-- XXX - what about defaulting that depends on a junction? 
    789791doApply :: Env -> VCode -> [Exp] -> [Exp] -> Eval Val 
    790 doApply Env{ envClasses = cls } sub@MkCode{ subBody = fun, subType = typ } invs args = 
     792doApply env sub@MkCode{ subBody = fun, subType = typ } invs args = 
    791793    case bindParams sub invs args of 
    792794        Left errMsg -> fail errMsg 
     
    836838            v   <- eval 
    837839            typ <- evalValType v 
     840            let cls = envClasses env 
    838841            if isaType cls "Junction" typ then return v else do 
    839842            case (lv, rw) of 
     
    853856        return $ genericDrop n (concat elms :: [Val]) 
    854857    isCollapsed typ 
    855         | isaType cls "Bool" typ        = True 
    856         | isaType cls "Junction" typ    = True 
     858        | isaType (envClasses env) "Bool" typ        = True 
     859        | isaType (envClasses env) "Junction" typ    = True 
    857860        | otherwise                     = False 
    858861