%using% | R Documentation |
The %using%
combinator allows us to manipulate results from a parser. The
parser (p %using% f)
has the same behavior as the parser p
, except that
the function f
is applied to its result value.
p %using% f
p |
a parser. |
f |
a function to be applied to the result of a successful |
A parser.
(p %using% f)(x): if p1(x)==[] then fail()(x) else succeed(f(p1(x)$L))(x[-1])
(literal('ab') %using% toupper) (c("ab","cdef")) # success
(literal('ab') %using% toupper) (c("bb","cdef")) # failure
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.