yi-core-0.19.4: Yi editor core library

Safe Haskell | None
Language | Haskell2010

Yi.IncrementalParse

Synopsis

- recoverWith :: Parser s a -> Parser s a
- symbol :: (s -> Bool) -> Parser s s
- eof :: Parser s ()
- lookNext :: Parser s (Maybe s)
- testNext :: (Maybe s -> Bool) -> Parser s ()
- type State st token result = (st, Process token result)
- type P s a = Parser s a
- data Parser s a where
  - Look :: forall s a. Parser s a -> (s -> Parser s a) -> Parser s a
  - Yuck :: forall s a. Parser s a -> Parser s a
  - Enter :: forall s a. String -> Parser s a -> Parser s a
- data AlexState lexerState = AlexState {
  - stLexer :: lexerState
  - lookedOffset :: !Point
  - stPosn :: !Posn
  }
- scanner :: forall st token result. Parser token result -> Scanner st token -> Scanner (State st token result) result

# Documentation

recoverWith :: Parser s a -> Parser s a Source #

Parse the same thing as the argument, but will be used only as backup. ie, it will be used only if disjuncted with a failing parser.

symbol :: (s -> Bool) -> Parser s s Source #

eof :: Parser s () Source #

lookNext :: Parser s (Maybe s) Source #

testNext :: (Maybe s -> Bool) -> Parser s () Source #

type State st token result = (st, Process token result) Source #

type P s a = Parser s a Source #

data Parser s a where Source #

Parser specification

Constructors

Look :: forall s a. Parser s a -> (s -> Parser s a) -> Parser s a |
Yuck :: forall s a. Parser s a -> Parser s a |
Enter :: forall s a. String -> Parser s a -> Parser s a |

#### Instances

Instances details

Alternative (Parser s) Source # |
Instance details Defined in Parser.Incremental Methods empty :: Parser s a Source # (<|>) :: Parser s a -> Parser s a -> Parser s a Source # some :: Parser s a -> Parser s [a] Source # many :: Parser s a -> Parser s [a] Source #
Applicative (Parser s) Source # |
Instance details Defined in Parser.Incremental Methods pure :: a -> Parser s a Source # (<*>) :: Parser s (a -> b) -> Parser s a -> Parser s b Source # liftA2 :: (a -> b -> c) -> Parser s a -> Parser s b -> Parser s c Source # (*>) :: Parser s a -> Parser s b -> Parser s b Source # (<*) :: Parser s a -> Parser s b -> Parser s a Source #
Functor (Parser s) Source # |
Instance details Defined in Parser.Incremental Methods fmap :: (a -> b) -> Parser s a -> Parser s b Source # (<$) :: a -> Parser s b -> Parser s a Source #
Monad (Parser s) Source # |
Instance details Defined in Parser.Incremental Methods (>>=) :: Parser s a -> (a -> Parser s b) -> Parser s b Source # (>>) :: Parser s a -> Parser s b -> Parser s b Source # return :: a -> Parser s a Source #
MonadFail (Parser s) Source # |
Instance details Defined in Parser.Incremental Methods fail :: String -> Parser s a Source #

data AlexState lexerState Source #

Lexer state

Constructors

AlexState |

Fields

- stLexer :: lexerState
- lookedOffset :: !Point
- stPosn :: !Posn

#### Instances

Instances details

Show lexerState => Show (AlexState lexerState) |
Instance details Defined in Yi.Lexer.Alex Methods showsPrec :: Int -> AlexState lexerState -> ShowS Source # show :: AlexState lexerState -> String Source # showList :: [AlexState lexerState] -> ShowS Source #

scanner :: forall st token result. Parser token result -> Scanner st token -> Scanner (State st token result) result Source #