notFollowedBy

notFollowedBy :: (Stream s m t, Show a) => ParsecT s u m a -> ParsecT s u m ()
parsec Text.Parsec.Combinator, parsec Text.ParserCombinators.Parsec.Combinator
notFollowedBy p only succeeds when parser p fails. This parser does not consume any input. This parser can be used to implement the 'longest match' rule. For example, when recognizing keywords (for example let), we want to make sure that a keyword is not followed by a legal identifier character, in which case the keyword is actually an identifier (for example lets). We can program this behaviour as follows: > keywordLet = try (do{ string "let" > ; notFollowedBy alphaNum > })