Header menu logo XParsec

InfiniteLoopException<'State> Type

Raised by looping combinators (many, sepBy*, manyTill, chainl1, fold, foldUserState, manyChars, …) when the inner parser succeeds without advancing the reader. Carries the Position{S} at which the loop got stuck so the bug can be localised.

This is a programming error — the inner parser is malformed (e.g. it always succeeds with preturn). User code should fix the parser rather than catch the exception. ParserCE.While / For deliberately do not raise this; termination of CE loops is the user's responsibility.

Constructors

Constructor Description

InfiniteLoopException(pos)

Full Usage: InfiniteLoopException(pos)

Parameters:
Returns: InfiniteLoopException<'State>
pos : Position<'State>
Returns: InfiniteLoopException<'State>

InfiniteLoopException(pos, innerException)

Full Usage: InfiniteLoopException(pos, innerException)

Parameters:
    pos : Position<'State>
    innerException : exn

Returns: InfiniteLoopException<'State>
pos : Position<'State>
innerException : exn
Returns: InfiniteLoopException<'State>

Instance members

Instance member Description

this.Position

Full Usage: this.Position

Returns: Position<'State>

The reader position at which the looping combinator detected zero progress.

Returns: Position<'State>

Type something to start searching.