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

SimpleParser.LookAhead

Synopsis

Documentation

data MatchCase l s e m a b Source #

Constructors

MatchCase 

Fields

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

data MatchBlock l s e m a b Source #

Constructors

MatchBlock 

Fields

type PureMatchBlock l s e a b = MatchBlock l s e Identity a b Source #

lookAheadMatch :: Monad m => MatchBlock l s e m a b -> ParserT l s e m b 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 b -> s -> m (LookAheadTestResult l) Source #

Test which branches match the look-ahead. Useful to assert that your parser makes exclusive choices.

lookAheadSimple :: (Monad m, Eq a) => ParserT l s e m a -> ParserT l s e m b -> [(a, ParserT l s e m b)] -> ParserT l s e m b Source #

Simple look-ahead that selects a parser based on first equal prefix.