Show
Ignore:
Timestamp:
05/18/05 02:43:25 (4 years ago)
Author:
theorbtwo
svk:copy_cache_prev:
4945
Message:

More signatures, a few more haddocks.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Compile/Parrot.hs

    r3352 r3372  
    4545    compile = return 
    4646 
     47padSort :: (Var, [(TVar Bool, TVar VRef)]) -> (String, [(a, b)]) -> Ordering 
    4748padSort ((a::[Char]), [(_, _)]) ((b::[Char]), [(_, _)]) 
    4849    | (head a == ':' && head b == '&') = LT 
     
    9798    compile prm = return $ text ".param pmc" <+> varText (paramName prm) 
    9899 
     100varText :: String -> Doc 
    99101varText ('$':name)  = text $ "s__" ++ name 
    100102varText ('@':name)  = text $ "a__" ++ name 
     
    102104varText x           = error $ "invalid name: " ++ x 
    103105 
     106varInit :: String -> Doc 
    104107varInit ('$':_) = text $ "PerlUndef" 
    105108varInit ('@':_) = text $ "PerlArray" 
     
    122125    return $ map ((tmp <> text "_" <>) . text) strs 
    123126 
     127incCounter :: String -> (String -> String) -> Eval Doc 
    124128incCounter key f = do 
    125129    Just ioRef <- asks envDebug 
     
    139143 
    140144 
     145label :: Doc -> Doc 
    141146label doc = doc <> text ":" 
    142147 
     148compileCond :: Compile a => String -> [a] -> Eval Doc 
    143149compileCond neg [cond, bodyIf, bodyElse] = do 
    144150    [alt, end]  <- tempLabels ["else", "endif"] 
     
    324330    return $ vcat [ argC, f tmp ] 
    325331 
     332currentStash :: Eval Doc 
    326333currentStash = fmap text $ asks envStash 
     334 
     335constPMC :: Doc -> Eval Doc 
    327336constPMC doc = do 
    328337    tmp  <- currentStash 
     
    332341        ] 
    333342 
     343compileArg :: Compile a => a -> Eval (Doc, Doc) 
    334344compileArg exp = do 
    335345    tmp  <- tempPMC