a : 'a -> 'a list -> 'a * 'a list
Parser that requires a specific item.
The call a x gives a parser that parses a single item that is exactly x,
raising Noparse if the first item is something different.
- FAILURE CONDITIONS
The call a x never fails, though the resulting parser may raise Noparse.
This is one of a suite of combinators for manipulating ``parsers''. A parser is
simply a function whose OCaml type is some instance of
:('a)list -> 'b * ('a)list. The function should take a list of objects of
type :'a (e.g. characters or tokens), parse as much of it as possible from
left to right, and return a pair consisting of the object derived from parsing
(e.g. a term or a special syntax tree) and the list of elements that were not
- SEE ALSO
++, ||, >>, atleast, elistof, finished, fix, leftbin, listof, many, nothing,
possibly, rightbin, some.