Changeset 15165 for src/Pugs/Parser

Show
Ignore:
Timestamp:
02/02/07 04:10:20 (22 months ago)
Author:
audreyt
Message:

* Filetest operators are now removed; use smartmatch against Pairs instead:

-e 'README'

!-e 'README'

becomes:

'README':e
'README'
:!e

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Parser/Operator.hs

    r14933 r15165  
    5252    : (optOps (r_opt tights)        -- Named Unary (user-definable) 
    5353      ++ preOps (r_named tights Set.\\ opWords " true not ") 
    54       ++ fileTestOps 
    5554      ) 
    5655    : staticLevels 
     
    103102    , preOps (opWords " true not ")                              -- Loose unary 
    104103    ] 
    105  
    106 fileTestOps :: [RuleOperator Exp] 
    107 fileTestOps = optSymOps (Set.fromAscList (map (MkOpName . cast . (\x -> ['-', x])) fileTestOperatorNames)) 
    108104 
    109105infixAssignmentOps :: Set OpName 
     
    304300            = sig == SArray || sig == SArrayMulti 
    305301matchSlurpy _ = False 
    306  
    307 fileTestOperatorNames :: String 
    308 fileTestOperatorNames = "ABCMORSTWXbcdefgkloprstuwxz" 
    309302 
    310303circumOps, rightSyn, chainOps, matchOps, nonSyn, listSyn, preSyn, optPreSyn, preOps, preSymOps, optSymOps, postOps, optOps, leftOps, rightOps, nonOps, listOps :: Set OpName -> [RuleOperator Exp] 
     
    348341    where 
    349342    lookAheadLiterals 
    350         | "-" <- name = 
    351             -- Horrible, horrible kluge to make "-e" etc work across prec levels. 
    352             (try parseFileTestOp >>= makeFileTestOp) 
    353                 <|> conOp fullName 
    354343        | isWordAny (last name) = choice autoquoters 
    355344        | otherwise = conOp fullName 
     
    359348        , conOp fullName 
    360349        ] 
    361     parseFileTestOp = do 
    362         rv <- oneOf fileTestOperatorNames 
    363         lookAhead (satisfy (not . isWordAny)) 
    364         whiteSpace 
    365         return rv 
    366350    fullName 
    367351        | isAlpha (head name)