Changeset 15425

Show
Ignore:
Timestamp:
03/03/07 16:37:34 (21 months ago)
Author:
audreyt
Message:

* Massive Haddoc-compatibility fix to make all modules

haddockable.

Files:
19 modified

Legend:

Unmodified
Added
Removed
  • Makefile.PL

    r15392 r15425  
    5757@srcdirs = grep {! m|\b_svn\b|} @srcdirs if $ENV{SVN_ASP_DOT_NET_HACK}; 
    5858 
    59 my @hsfiles  = map {glob "$_/*.hs"} @srcdirs; 
     59my @hsfiles  = map {glob "$_/[A-Z]*.hs"} @srcdirs; 
    6060push @hsfiles, qw<src/Pugs/Config.hs src/Pugs/CodeGen/PIR/Prelude.hs>; 
    6161my @hppfiles = map {my $x=$_; $x=~s/\.hs$/.hpp/; $x} @hsfiles; 
  • src/Prereqs.hs

    r13183 r15425  
    77-} 
    88 
     9module Prereqs where 
     10 
    911import Pugs.Compat () 
    1012import Pugs.Embed.Parrot () 
    1113import Pugs.Embed.Perl5 () 
     14import Pugs.Meta () 
    1215import Pugs.Run.Perl5 () 
    1316import Pugs.Parser.Charnames () 
  • src/Pugs.hs

    r15297 r15425  
    260260    suffixes = 
    261261        [ [] 
    262         , ["perl5", "PIL2JS"]      --  $sourcedir/perl5/PIL2JS/jspugs.pl 
    263         , ["perl5", "lib"]         --  $pugslibdir/perl5/lib/jspugs.pl 
    264         , ["misc", "pX", "Common", "redsix"] -- $sourcedir/misc/pX/Common/redsix/redsix 
     262        , ["perl5", "PIL2JS"]                -- sourcedir/perl5/PIL2JS/jspugs.pl 
     263        , ["perl5", "lib"]                   -- pugslibdir/perl5/lib/jspugs.pl 
     264        , ["misc", "pX", "Common", "redsix"] -- sourcedir/misc/pX/Common/redsix/redsix 
    265265        ] 
    266266    perl5 = getConfig "perl5path" 
  • src/Pugs/AST.hs

    r15417 r15425  
    352352 
    353353{-| 
    354 Symbols which are reserved for the current interpreter/compiler instance and 
    355 should not be set from the preamble or other sources.  See 
    356 @Pugs.AST.filterUserDefinedPad@. 
     354Symbols which are reserved for the current interpreter or compiler instance and 
     355should not be set from the preamble or other sources. See @filterUserDefinedPad@. 
    357356-} 
    358357_reserved :: Set Var 
  • src/Pugs/AST/CapInternals.hs

    r14934 r15425  
    115115    | VPure   ValPure            -- ^ Immutable (or "pure") values 
    116116    | VMut    ValMut             -- ^ Mutable variables (in STM monad) 
    117     | VIO     ValIO              -- ^ I/O handles (in IO monad) 
     117    | VIO     ValIO              -- ^ IO handles (in IO monad) 
    118118    deriving (Show, Eq, Ord, Data, Typeable) {-!derive: YAML_Pos, Perl6Class, MooseClass!-} 
    119119 
     
    129129    | NNum  !NativeNum     -- ^ 4.2 
    130130    | NCplx !NativeComplex -- ^ (45 - 9i) 
    131     | NBool !NativeBool    -- ^ True (same underlying storage as NBit + True/False) 
     131    | NBool !NativeBool    -- ^ True (same underlying storage as NBit + True|False) 
    132132    deriving (Show, Eq, Ord, Data, Typeable) {-!derive: YAML_Pos, Perl6Class, MooseClass!-} 
    133133 
     
    136136    = UUndef               -- ^ e.g., "my $x" with out further assignment 
    137137    | UWhatever            -- ^ e.g. the * in 1 .. * 
    138     | UFailure    !ObjId   -- ^ $! object 
     138    | UFailure    !ObjId   -- ^ the "$!" object 
    139139    deriving (Show, Eq, Ord, Data, Typeable) {-!derive: YAML_Pos, Perl6Class, MooseClass!-} 
    140140 
     
    534534    deriving (Show, Eq, Ord, Data, Typeable) {-!derive: YAML_Pos, Perl6Class, MooseClass!-} 
    535535 
    536 -- | Single parameter for a function/method, e.g.: 
     536-- | Single parameter for a function or method, e.g.: 
    537537--   Elk $m where { $m.antlers ~~ Velvet } 
    538538{-| 
     
    720720    = ObjInstance 
    721721        { o_id       :: !ObjId      -- ^ our unique id 
    722         , o_meta     :: !ObjClass   -- ^ id of our metaobj/type 
     722        , o_meta     :: !ObjClass   -- ^ id of our metaobj|type 
    723723        , o_slots    :: !ObjSlots   -- ^ storage for explicit fields 
    724724        } 
    725725    | MkForeign 
    726         { o_id       :: !ObjId   -- ^ our unique id 
    727         , o_meta     :: !ObjClass   -- ^ id of our metaobj/type 
     726        { o_id       :: !ObjId      -- ^ our unique id 
     727        , o_meta     :: !ObjClass   -- ^ id of our metaobj|type 
    728728        , o_payload  :: !ObjPayload -- ^ storage for opaque wrapped obj 
    729729        } 
    730730    | MkPrototype 
    731731        { o_id       :: !ObjId      -- ^ our unique id 
    732         , o_meta     :: !ObjClass   -- ^ id of our metaobj/type 
     732        , o_meta     :: !ObjClass   -- ^ id of our metaobj|type 
    733733        } 
    734734    deriving (Show, Eq, Ord, Data, Typeable) {-!derive: YAML_Pos, Perl6Class, MooseClass!-} 
     
    769769 
    770770data Magic 
    771     = MOS               -- ^ $?OS        Which os am I compiled for? 
    772     | MOSVer            -- ^ $?OSVER     Which os version am I compiled for? 
    773     | MPerlVer          -- ^ $?PERLVER   Which Perl version am I compiled for? 
    774     | MFile             -- ^ $?FILE      Which file am I in? 
    775     | MLine             -- ^ $?LINE      Which line am I at? 
    776     | MScalarPackage    -- ^ $?PACKAGE   Which package am I in? 
    777     | MArrayPackages    -- ^ @?PACKAGE   Which packages am I in? 
    778     | MScalarModule     -- ^ $?MODULE    Which module am I in? 
    779     | MArrayModules     -- ^ @?MODULE    Which modules am I in? 
    780     | MScalarClass      -- ^ $?CLASS     Which class am I in? (as variable) 
    781     | MArrayClasses     -- ^ @?CLASS     Which classes am I in? 
    782     | MScalarRole       -- ^ $?ROLE      Which role am I in? (as variable) 
    783     | MArrayRoles       -- ^ @?ROLE      Which roles am I in? 
    784     | MScalarGrammar    -- ^ $?GRAMMAR   Which grammar am I in? 
    785     | MArrayGrammars    -- ^ @?GRAMMAR   Which grammars am I in? 
    786     | MParser           -- ^ $?PARSER    Which Perl grammar was used to 
     771    = MOS               -- ^ \$?OS        Which os am I compiled for? 
     772    | MOSVer            -- ^ \$?OSVER     Which os version am I compiled for? 
     773    | MPerlVer          -- ^ \$?PERLVER   Which Perl version am I compiled for? 
     774    | MFile             -- ^ \$?FILE      Which file am I in? 
     775    | MLine             -- ^ \$?LINE      Which line am I at? 
     776    | MScalarPackage    -- ^ \$?PACKAGE   Which package am I in? 
     777    | MArrayPackages    -- ^ \@?PACKAGE   Which packages am I in? 
     778    | MScalarModule     -- ^ \$?MODULE    Which module am I in? 
     779    | MArrayModules     -- ^ \@?MODULE    Which modules am I in? 
     780    | MScalarClass      -- ^ \$?CLASS     Which class am I in? (as variable) 
     781    | MArrayClasses     -- ^ \@?CLASS     Which classes am I in? 
     782    | MScalarRole       -- ^ \$?ROLE      Which role am I in? (as variable) 
     783    | MArrayRoles       -- ^ \@?ROLE      Which roles am I in? 
     784    | MScalarGrammar    -- ^ \$?GRAMMAR   Which grammar am I in? 
     785    | MArrayGrammars    -- ^ \@?GRAMMAR   Which grammars am I in? 
     786    | MParser           -- ^ \$?PARSER    Which Perl grammar was used to 
    787787                        -- ^                   parse this statement? 
    788     | MScalarRoutine    -- ^ &?ROUTINE   Which routine am I in? 
    789     | MArrayRoutines    -- ^ @?ROUTINE   Which routines am I in? 
    790     | MScalarBlock      -- ^ &?BLOCK     Which block am I in? 
    791     | MArrayBlocks      -- ^ @?BLOCK     Which blocks am I in? 
     788    | MScalarRoutine    -- ^ \&?ROUTINE   Which routine am I in? 
     789    | MArrayRoutines    -- ^ \@?ROUTINE   Which routines am I in? 
     790    | MScalarBlock      -- ^ \&?BLOCK     Which block am I in? 
     791    | MArrayBlocks      -- ^ \@?BLOCK     Which blocks am I in? 
    792792    deriving (Show, Eq, Ord, Data, Typeable) {-!derive: YAML_Pos, Perl6Class, MooseClass!-} 
    793793 
  • src/Pugs/AST/Internals.hs

    r15396 r15425  
    224224    castV x = VOpaque (MkOpaque x) -- error $ "Cannot cast into Val" 
    225225 
     226#ifndef HADDOCK 
    226227data VOpaque where 
    227228    MkOpaque :: Value a => !a -> VOpaque 
     229#endif 
    228230 
    229231fromVal' :: (Value a) => Val -> Eval a 
  • src/Pugs/Class.hs

    r15424 r15425  
    5757    return $ MkInvocant x' (class_interface (classOf x')) 
    5858 
    59 mkBoxClass :: forall t (m :: * -> *) (m1 :: * -> *). 
     59mkBoxClass ::  
    6060    ( Method m1 (AnyMethod m1) 
    6161    , Codeable m1 (HsCode m) 
     
    7575    } 
    7676 
    77 -- variant of @mkBoxClass@ meant to be called with the fixed-point 
     77-- | Variant of @mkBoxClass@ meant to be called with the fixed-point 
    7878-- combinator, that adds the standard HOW and WHICH methods. E.g.: 
    7979--    _StrClass = fix $ mkBoxPureClass "Str" [Str methods] 
    80 mkBoxPureClass :: forall a1 (m :: * -> *) a (m1 :: * -> *). 
     80mkBoxPureClass :: 
    8181    ( Boxable m a1 
    8282    , Boxable m a 
     
    9696raiseWhatError = error 
    9797 
    98 mkBoxMethod :: forall t (m1 :: * -> *) (m :: * -> *). 
     98mkBoxMethod :: 
    9999    ( Method m (SimpleMethod m) 
    100100    , Codeable m (HsCode m1) 
     
    115115type PureClass = MI Eval 
    116116 
    117 instance Boxable Eval a => Boxable Eval [a] where 
     117instance Boxable Eval a => Boxable Eval [a] 
    118118instance Boxable Eval ID 
    119119instance Boxable Eval PureClass where 
  • src/Pugs/Class/C3.hs

    r15406 r15425  
    1 -- #prune 
    2  
    31-- | 
    42-- 
  • src/Pugs/Eval.hs

    r15421 r15425  
    289289                    else name 
    290290                | isGlobalVar var || pkg `notElem` [emptyPkg, callerPkg, outerPkg, contextPkg] -> do 
    291                     -- $Qualified::Var is not found.  Vivify at lvalue context. 
     291                    -- '$Qualified::Var' is not found.  Vivify at lvalue context. 
    292292                    lv <- asks envLValue 
    293293                    if lv then evalExp (Sym SGlobal var (Var var)) else retEmpty 
    294294                | otherwise -> do 
    295295                    s <- isStrict 
    296                     if s then retError "Undeclared variable" var 
     296                    if s then do retError "Undeclared variable" var 
    297297                         else do lv <- asks envLValue 
    298298                                 if lv then evalExp (Sym SGlobal var (Var var)) else retEmpty 
     
    659659                Just tvar -> return (tvar, ref) 
    660660                _ | isGlobalVar var || v_package var `notElem` [emptyPkg, callerPkg, outerPkg, contextPkg] -> do 
    661                     -- $Qualified::Var is not found.  Vivify at lvalue context. 
     661                    -- '$Qualified::Var' is not found.  Vivify at lvalue context. 
    662662                    evalExp (Sym SGlobal var Noop) 
    663663                    rv' <- findVarRef var 
  • src/Pugs/Internals/Cast.hs

    r15379 r15425  
    1 {-# OPTIONS_GHC -fglasgow-exts -fno-warn-orphans -fno-full-laziness -fno-cse -fno-warn-deprecations -fallow-undecidable-instances -fallow-overlapping-instances -funbox-strict-fields #-} 
     1{-# OPTIONS_GHC -fglasgow-exts -fno-warn-orphans -fno-full-laziness -fno-cse -fno-warn-deprecations -fallow-undecidable-instances -fallow-overlapping-instances -funbox-strict-fields -cpp #-} 
    22 
     3#ifndef HADDOCK 
    34module Pugs.Internals.Cast ( 
    45    (:>:)(..), 
     
    1920import qualified Data.Typeable as Typeable 
    2021import qualified UTF8 
     22 
    2123 
    2224-- 
     
    7981    castBack = UTF8.pack 
    8082 
     83#endif 
  • src/Pugs/Lexer.hs

    r15327 r15425  
    1 {-# OPTIONS_GHC -fglasgow-exts -fvia-C -optc-w #-} 
     1{-# OPTIONS_GHC -fglasgow-exts -fvia-C -optc-w -cpp #-} 
    22 
    33{-| 
     
    6767balancedDelim c = case c of 
    6868    '\x0028' -> '\x0029'; '\x003C' -> '\x003E'; '\x005B' -> '\x005D'; 
     69#ifndef HADDOCK 
    6970    '\x007B' -> '\x007D'; '\x00AB' -> '\x00BB'; '\x0F3A' -> '\x0F3B'; 
    7071    '\x0F3C' -> '\x0F3D'; '\x169B' -> '\x169C'; '\x2039' -> '\x203A'; 
     
    128129    '\xFF1C' -> '\xFF1E'; '\xFF3B' -> '\xFF3D'; '\xFF5B' -> '\xFF5D'; 
    129130    '\xFF5F' -> '\xFF60'; '\xFF62' -> '\xFF63'; other    -> other 
     131#endif 
    130132 
    131133-- balanced: parses an open/close delimited expression of any non-alphanumeric character 
     
    295297            -- "\08..." and "\09..." are treated as "\0" and then "8..." or "9...". 
    296298            ('0':xs@(x:_)) | x == '8' || x == '9' -> return (0:map (toInteger . ord) xs) 
    297             _   -> error ("Error: Invalid escape sequence \\" ++ ds ++ "; write as decimal \\d" ++ ds ++ " or octal \\o" ++ ds ++ " instead") -- $ return [read ds] 
     299            _   -> error ("Error: Invalid escape sequence \\" ++ ds ++ "; write as decimal \\d" ++ ds ++ " or octal \\o" ++ ds ++ " instead") -- return [read ds] 
    298300        , based 'o'  8 octDigit 
    299301        , based 'x' 16 hexDigit 
  • src/Pugs/Parser.hs

    r15422 r15425  
    17521752    return $ \x -> case name of 
    17531753        ('&':rest) -> case quant of 
    1754             Just q  -> Syn "CCallDyn" ((Val (castV [q])):Val (VStr rest):x:args)         -- $x.*meth 
    1755             _       -> App (_Var name) (Just x) args                                    -- $x.meth 
    1756         _       -> Syn "CCallDyn" (Val (castV (maybeToList quant)):_Var name:x:args)    -- $x.$meth 
     1754            Just q  -> Syn "CCallDyn" ((Val (castV [q])):Val (VStr rest):x:args)        -- '$x.*meth' 
     1755            _       -> App (_Var name) (Just x) args                                    -- '$x.meth' 
     1756        _       -> Syn "CCallDyn" (Val (castV (maybeToList quant)):_Var name:x:args)    -- '$x.$meth' 
    17571757 
    17581758ruleArraySubscript :: RuleParser (Exp -> Exp) 
  • src/Pugs/Parser/Operator.hs

    r15364 r15425  
    3333        = compare (Buf.length y) (Buf.length x) `mappend` compare b a 
    3434 
    35 -- Not yet transcribed into a full optable parser with dynamic precedence -- 
     35-- Not yet transcribed into a full optable parser with dynamic precedence 
    3636 
    3737tightOperators :: RuleParser (TightFunctions, RuleOperatorTable Exp) 
  • src/Pugs/Parser/Program.hs

    r15368 r15425  
    2323        | otherwise         = prog ++ "\n" 
    2424 
    25 -- Based on: http://hackage.haskell.org/trac/haskell-prime/wiki/SourceEncodingDetection 
     25-- Based on: <http://hackage.haskell.org/trac/haskell-prime/wiki/SourceEncodingDetection> 
    2626data EncodedSource 
    2727    = UTF8 !String 
    2828    | UTF16 !Endian !String 
    2929    | UTF32 !Endian !String 
    30  -- | UserDefined ... 
     30 -- ... | UserDefined ... 
    3131 
    3232data Endian = LittleEndian | BigEndian 
  • src/Pugs/Prim.hs

    r15422 r15425  
    15931593triggering the failure. Just zipping with [1 ..] may not be 
    15941594enough because our caller may not be passing through its own 
    1595 input args in the same order/position to us. 
     1595input args in the same order and position to us. 
    15961596 
    15971597-} 
  • src/Pugs/Prim/Match.hs

    r15324 r15425  
    161161    op2Match x (VType (mkType name)) 
    162162 
    163 -- $x ~~ tr/x/y/ ==> $x = ~$x.trans('x' => 'y') 
     163-- '$x ~~ tr/x/y/' ==> $x = ~$x.trans('x' => 'y') 
    164164op2Match x (VSubst (MkTrans from to)) = do 
    165165    str <- fromVal x 
  • src/Pugs/Types.hs

    r15297 r15425  
    3535 
    3636data Type 
    37     = MkType !ID         -- ^ A regular type 
    38     | TypeOr  !Type !Type -- ^ The disjunction (|) of two types 
    39     | TypeAnd !Type !Type -- ^ The conjunction (&) of two types 
     37    = MkType !ID            -- ^ A regular type 
     38    | TypeOr  !Type !Type   -- ^ The disjunction (|) of two types 
     39    | TypeAnd !Type !Type   -- ^ The conjunction (&) of two types 
    4040    deriving (Eq, Ord, Typeable, Data) 
    4141 
     
    429429        Just idx1 -> case Buf.findSubstring (__"::") str of 
    430430            Nothing  -> ([], (cast (Buf.take idx1 str), Buf.drop (succ idx1) str)) 
    431             Just 0   -> tokenPkg (Buf.drop 2 str) -- $::x is the same as $x 
     431            Just 0   -> tokenPkg (Buf.drop 2 str) -- '$::x' is the same as $x 
    432432            Just idx 
    433433                | idx == idx1 -> case cast (Buf.take idx1 str) of 
  • src/Pugs/Val/Code.hs

    r15412 r15425  
    9898type PureSig = Sig 
    9999 
    100 -- | Single parameter for a function/method, e.g.: 
     100-- | Single parameter for a function or method, e.g.: 
    101101--   Elk $m where { $m.antlers ~~ Velvet } 
    102102{-| 
  • util/munge_haddock.pl

    r15423 r15425  
    1010  s/^#(.*)/{- $1 -}/; 
    1111 
     12  # Recursive imports 
     13  s/import \{-# SOURCE #-\}.*//; 
     14 
     15  # Symbolic Classes 
     16  s/\(\(:>:\) (.+?)\) /CastTo $1 /; 
     17  s/(, )?\(:>:\) (\w+)//g; 
     18  s/(, )?\(:<:\) (\w+)//g; 
     19 
    1220  # Parallel arrays 
    1321  s/\[:/[/g;