darcs-2.14.1: a distributed, interactive, smart revision control system

Darcs.Patch.TokenReplace

Synopsis

# Documentation

tryTokReplace tokChars old new input tries to find the token old and replace it with the token new everywhere in the input, returning Just the modified input, unless the token new is already in the input in which case Nothing is returned. A token is a sequence of bytes that match the class defined by tokChars. This function is supposed to work efficiently with large inputs i.e. whole files.

forceTokReplace tokChars old new input replaces all occurrences of the old token with the new one, throughout the input.

Check if a token replace operation touches the given line.

Break a Bytestring into tokens, according to defaultToks, discarding non-tokens.