Changeset 15165 for src/Pugs/Parser
- Timestamp:
- 02/02/07 04:10:20 (22 months ago)
- Files:
-
- 1 modified
-
src/Pugs/Parser/Operator.hs (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Pugs/Parser/Operator.hs
r14933 r15165 52 52 : (optOps (r_opt tights) -- Named Unary (user-definable) 53 53 ++ preOps (r_named tights Set.\\ opWords " true not ") 54 ++ fileTestOps55 54 ) 56 55 : staticLevels … … 103 102 , preOps (opWords " true not ") -- Loose unary 104 103 ] 105 106 fileTestOps :: [RuleOperator Exp]107 fileTestOps = optSymOps (Set.fromAscList (map (MkOpName . cast . (\x -> ['-', x])) fileTestOperatorNames))108 104 109 105 infixAssignmentOps :: Set OpName … … 304 300 = sig == SArray || sig == SArrayMulti 305 301 matchSlurpy _ = False 306 307 fileTestOperatorNames :: String308 fileTestOperatorNames = "ABCMORSTWXbcdefgkloprstuwxz"309 302 310 303 circumOps, rightSyn, chainOps, matchOps, nonSyn, listSyn, preSyn, optPreSyn, preOps, preSymOps, optSymOps, postOps, optOps, leftOps, rightOps, nonOps, listOps :: Set OpName -> [RuleOperator Exp] … … 348 341 where 349 342 lookAheadLiterals 350 | "-" <- name =351 -- Horrible, horrible kluge to make "-e" etc work across prec levels.352 (try parseFileTestOp >>= makeFileTestOp)353 <|> conOp fullName354 343 | isWordAny (last name) = choice autoquoters 355 344 | otherwise = conOp fullName … … 359 348 , conOp fullName 360 349 ] 361 parseFileTestOp = do362 rv <- oneOf fileTestOperatorNames363 lookAhead (satisfy (not . isWordAny))364 whiteSpace365 return rv366 350 fullName 367 351 | isAlpha (head name)
