Changeset 10103 for src/Pugs/Lexer.hs
- Timestamp:
- 04/28/06 07:01:21 (3 years ago)
- Files:
-
- 1 modified
-
src/Pugs/Lexer.hs (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Pugs/Lexer.hs
r10092 r10103 217 217 218 218 stringList :: Int -> RuleParser [Exp] 219 stringList i = tryChoice219 stringList i = choice 220 220 [ do 221 221 parse <- interpolator … … 315 315 316 316 rule :: String -> RuleParser a -> RuleParser a 317 rule name action = (<?> name) $ lexeme $ action317 rule name = (<?> name) . lexeme 318 318 319 319 verbatimRule :: String -> RuleParser a -> RuleParser a 320 verbatimRule name action = (<?> name) $ action320 verbatimRule name = (<?> name) 321 321 322 322 literalRule :: String -> RuleParser a -> RuleParser a 323 literalRule name action = (<?> name) $ postSpace $ action323 literalRule name = (<?> name) . postSpace 324 324 325 325 tryRule :: String -> RuleParser a -> RuleParser a 326 tryRule name action = (<?> name) $ lexeme $ action326 tryRule name = (<?> name) . lexeme . try 327 327 328 328 tryVerbatimRule :: String -> RuleParser a -> RuleParser a 329 tryVerbatimRule name action = (<?> name) $ action329 tryVerbatimRule name = (<?> name) 330 330 331 331 ruleScope :: RuleParser Scope 332 ruleScope = tryRule "scope" $ do332 ruleScope = rule "scope" $ do 333 333 scope <- ruleScopeName 334 334 return $ readScope scope … … 397 397 tryChoice :: [RuleParser a] -- ^ List of candidate parsers 398 398 -> RuleParser a 399 tryChoice = choice 399 tryChoice = choice . map try 400 400 401 401 {-|
