Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data MatchCase l s e m a = MatchCase {
- matchCaseLabel :: !(Maybe l)
- matchCaseGuard :: !(ParserT l s e m ())
- matchCaseBody :: !(ParserT l s e m a)
- type PureMatchCase l s e a = MatchCase l s e Identity a
- data DefaultCase l s e m a = DefaultCase {
- defaultCaseLabel :: !(Maybe l)
- defaultCaseHandle :: !(Seq (MatchMiss l s e) -> ParserT l s e m a)
- type PureDefaultCase l s e a = DefaultCase l s e Identity a
- data MatchBlock l s e m a = MatchBlock {
- matchBlockDefault :: !(DefaultCase l s e m a)
- matchBlockElems :: ![MatchCase l s e m a]
- type PureMatchBlock l s e a = MatchBlock l s e Identity a
- lookAheadMatch :: Monad m => MatchBlock l s e m a -> ParserT l s e m a
- data MatchPos l = MatchPos {
- matchPosIndex :: !Int
- matchPosLabel :: !(Maybe l)
- data LookAheadTestResult l
- = LookAheadTestDefault !(Maybe l)
- | LookAheadTestMatches !(NESeq (MatchPos l))
- lookAheadTest :: Monad m => MatchBlock l s e m a -> s -> m (LookAheadTestResult l)
- pureLookAheadTest :: PureMatchBlock l s e a -> s -> LookAheadTestResult l
- lookAheadChunk :: (Stream s, Monad m, Eq (Chunk s)) => [(Chunk s, ParserT l s e m a)] -> ParserT l s e m a -> ParserT l s e m a
Documentation
data MatchCase l s e m a Source #
MatchCase | |
|
type PureMatchCase l s e a = MatchCase l s e Identity a Source #
data DefaultCase l s e m a Source #
DefaultCase | |
|
type PureDefaultCase l s e a = DefaultCase l s e Identity a Source #
data MatchBlock l s e m a Source #
MatchBlock | |
|
type PureMatchBlock l s e a = MatchBlock l s e Identity a Source #
lookAheadMatch :: Monad m => MatchBlock l s e m a -> ParserT l s e m a Source #
Parse with look-ahead for each case and follow the first that matches (or follow the default if none do).
MatchPos | |
|
data LookAheadTestResult l Source #
LookAheadTestDefault !(Maybe l) | |
LookAheadTestMatches !(NESeq (MatchPos l)) |
Instances
Eq l => Eq (LookAheadTestResult l) Source # | |
Defined in SimpleParser.LookAhead (==) :: LookAheadTestResult l -> LookAheadTestResult l -> Bool # (/=) :: LookAheadTestResult l -> LookAheadTestResult l -> Bool # | |
Show l => Show (LookAheadTestResult l) Source # | |
Defined in SimpleParser.LookAhead showsPrec :: Int -> LookAheadTestResult l -> ShowS # show :: LookAheadTestResult l -> String # showList :: [LookAheadTestResult l] -> ShowS # |
lookAheadTest :: Monad m => MatchBlock l s e m a -> s -> m (LookAheadTestResult l) Source #
Test which branches match the look-ahead. Useful to assert that your parser makes exclusive choices.
pureLookAheadTest :: PureMatchBlock l s e a -> s -> LookAheadTestResult l Source #