If<T, U>(Parser<T>, Parser<U>, Parser<U>) ➜ Parser<U>

Applies the first parser and chooses one of two parsers to apply depending on whether or not it succeeded. The chosen parser will then be applied at the current offset.

IfFollowedBy<T>(Parser<T>, Parser<T>) ➜ Parser<T>

Succeeds if the scanner would match the first Parser<T> at its current offset, then match the second Parser<T>, only consuming the characters of the first parser.

IfNotFollowedBy<T>(Parser<T>, Parser<T>) ➜ Parser<T>

Succeeds if the scanner would match the first Parser<T> at its current offset, then fail to match the second Parser<T>.

IfPrecededBy<T>(Parser<T>, Parser<T>) ➜ Parser<T>

If the scanner would match the first Parser<T> at its current offset, it is then searched backwards for a match to the second Parser<T> that ends at one less than the where the first parser started. Succeeds if it finds one, only consuming the characters of the first parser.

IfNotPrecededBy<T>(Parser<T>, Parser<T>) ➜ Parser<T>

If the scanner would match the first Parser<T> at its current offset, it is then searched backwards for a match to the second Parser<T> that ends at one less than the where the first parser started. Succeeds if it fails to find one.

Satisfies<T>(Parser<T>, T ➜ bool) ➜ Parser<T>

Succeeds if the scanner would match the Parser<T> at its current offset, and the resulting value passes the given test. Also implemented as Where<T>.