simple-parser-0.6.0: Simple parser combinators
Safe HaskellNone
LanguageHaskell2010

SimpleParser.LookAhead

Synopsis

Documentation

data MatchCase l s e m a Source #

Constructors

MatchCase 

Fields

type PureMatchCase l s e a = MatchCase l s e Identity a Source #

data DefaultCase l s e m a Source #

Constructors

DefaultCase 

Fields

data MatchBlock l s e m a Source #

Constructors

MatchBlock 

Fields

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).

data MatchPos l Source #

Constructors

MatchPos 

Fields

Instances

Instances details
Eq l => Eq (MatchPos l) Source # 
Instance details

Defined in SimpleParser.LookAhead

Methods

(==) :: MatchPos l -> MatchPos l -> Bool #

(/=) :: MatchPos l -> MatchPos l -> Bool #

Show l => Show (MatchPos l) Source # 
Instance details

Defined in SimpleParser.LookAhead

Methods

showsPrec :: Int -> MatchPos l -> ShowS #

show :: MatchPos l -> String #

showList :: [MatchPos 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.

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 Source #

Simple look-ahead that matches by chunk.