some : ('a -> bool) -> 'a list -> 'a * 'a list
- SYNOPSIS
-
Parses any single item satisfying a predicate.
- DESCRIPTION
-
If p is a predicate on input tokens of some kind, some p is a parser that
parses and returns any first token satisfying the predicate p, and raises
Noparse on a first token not satisfying p.
- FAILURE CONDITIONS
-
The call some p never fails.
- COMMENTS
-
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
processed.
- SEE ALSO
-
++, |||, >>, a, atleast, elistof, finished, fix, leftbin, listof, many, nothing,
possibly, rightbin.