Changeset 2962

Show
Ignore:
Timestamp:
05/11/05 14:08:08 (4 years ago)
Author:
bsmith
svk:copy_cache_prev:
4536
Message:

Added export list of Pugs.Parser. Commented out quite a few functions that
appear to be unused.

Location:
src/Pugs
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/AST.hs

    r2957 r2962  
    111111charInc x   = chr $ 1 + ord x 
    112112 
     113-- |Evaluate the given expression, using the currently active evaluator 
     114-- (as given by the 'envEval' slot of the current 'Env'). 
     115evalExp :: Exp -> Eval Val 
     116evalExp exp = do 
     117    evl <- asks envEval 
     118    evl exp 
  • src/Pugs/AST/Internals.hs

    r2957 r2962  
    715715extract exp vs = (exp, vs) 
    716716 
     717-- can be factored 
    717718-- |Return the context implied by a particular primary sigil 
    718719-- (\$, \@, \% or \&). E.g. used to find what context to impose on 
     
    882883    return $ \(MkPad map) -> MkPad $ Map.insert name [(fresh, tvar)] map 
    883884 
    884 show' :: (Show a) => a -> String 
    885 show' x = "( " ++ show x ++ " )" 
    886  
    887885type Eval x = EvalT (ContT Val (ReaderT Env SIO)) x 
    888886type EvalMonad = EvalT (ContT Val (ReaderT Env SIO)) 
     
    997995retError :: (Show a) => VStr -> a -> Eval b 
    998996retError str a = fail $ str ++ ": " ++ show a 
    999  
    1000 -- |Evaluate the given expression, using the currently active evaluator 
    1001 -- (as given by the 'envEval' slot of the current 'Env'). 
    1002 evalExp :: Exp -> Eval Val 
    1003 evalExp exp = do 
    1004     evl <- asks envEval 
    1005     evl exp 
    1006997 
    1007998defined :: VScalar -> Bool 
     
    11191110    return $ f (hv :: VHash) 
    11201111 
     1112-- can be factored out 
    11211113doArray :: Val -> (forall a. ArrayClass a => a -> b) -> Eval b 
    11221114doArray (VRef (MkRef (IArray hv))) f = return $ f hv 
  • src/Pugs/Parser.hs

    r2956 r2962  
    1111-} 
    1212 
    13 module Pugs.Parser where 
     13module Pugs.Parser ( 
     14    runRule, 
     15    ruleProgram, 
     16) where 
    1417import Pugs.Internals 
    1518import Pugs.AST 
     
    193196    return () 
    194197 
     198{- unused 
    195199ruleQualifiedIdentifier :: RuleParser [String] 
    196200ruleQualifiedIdentifier = rule "qualified identifer" $ do 
    197201    identifier `sepBy1` (try $ string "::") 
     202-} 
    198203 
    199204-- Declarations ------------------------------------------------ 
     
    332337    } 
    333338 
     339{- unused 
    334340subNameWithPrefix :: String -> RuleParser String 
    335341subNameWithPrefix prefix = (<?> "subroutine name") $ lexeme $ try $ do 
     
    338344    cs      <- many wordAny 
    339345    return $ "&" ++ star ++ prefix ++ (c:cs) 
     346-} 
    340347 
    341348ruleSubName :: RuleParser String 
     
    533540        _           -> return $ Val val 
    534541 
     542{- unused 
    535543rulePackageDeclaration :: RuleParser a 
    536544rulePackageDeclaration = rule "package declaration" $ fail "" 
     545-} 
    537546 
    538547-- Constructs ------------------------------------------------ 
     
    849858    mapPair f (x, y) = (f x, f y) 
    850859 
     860{- unused 
    851861parseName :: String -> String 
    852862parseName str 
     
    855865    | otherwise 
    856866    = dropWhile (not . isAlpha) str 
    857  
     867-} 
     868 
     869{- unused 
    858870currentListFunctions :: RuleParser [a] 
    859871currentListFunctions = do 
    860872    return [] 
     873-} 
    861874{- 
    862875    funs <- currentFunctions 
     
    911924chainOps    :: String -> [Operator Char Env Exp] 
    912925chainOps    = leftOps 
     926{- unused 
    913927leftSyn     :: String -> [Operator Char Env Exp] 
    914928leftSyn     = ops $ makeOp2 AssocLeft "" Syn 
     929-} 
    915930rightSyn    :: String -> [Operator Char Env Exp] 
    916931rightSyn    = ops $ makeOp2 AssocRight "" Syn 
     
    919934listSyn     :: String -> [Operator Char Env Exp] 
    920935listSyn     = ops $ makeOp0 AssocList "" Syn 
     936{- unused 
    921937chainSyn    :: String -> [Operator Char Env Exp] 
    922938chainSyn    = leftSyn 
     939-} 
    923940 
    924941-- chainOps    = ops $ makeOpChained 
     
    11361153maybeParens :: CharParser Env a -> RuleParser a 
    11371154maybeParens p = choice [ parens p, p ] 
     1155{- unused 
    11381156maybeDotParens :: CharParser Env a -> RuleParser a 
    11391157maybeDotParens p = choice [ dotParens p, p ] 
     
    11421160        option ' ' $ char '.' 
    11431161        parens rule 
     1162-} 
    11441163 
    11451164parseVarName :: RuleParser String 
     
    15881607-} 
    15891608 
     1609{- unused 
    15901610op_methodPostfix    :: [a] 
    15911611op_methodPostfix    = [] 
    15921612op_namedUnary       :: [a] 
    15931613op_namedUnary       = [] 
     1614-} 
    15941615methOps             :: a -> [b] 
    15951616methOps _ = []