View source: R/parsers_basic.R
literal | R Documentation |
literal
tests whether a supplied string literally equals a desired value.
literal(string)
string |
string, a single-element character vector, or an object that can be coerced to a character vector. |
A parser.
literal(a)(x): satisfy(F(y): y==a)(x)
where F
is equivalent to the function
declarator in R. So, we have an
anonymous function in the argument of satisfy
.
literal("ab") (c("ab", "cdef")) # success
literal("ab") (c("abc", "cdef")) # failure
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.