Description Usage Arguments Examples
#' High-order combinator #' Choice combinator #' @param list_of_parsers A list of parsers. #' @examples #' p5 <- choice(list(literal("A"), literal("B"), literal("C"))) #' p5("ABCDE") # success: list("A", "BCDE") #' p5("BBCDE") # success: list("B", "BCDE")) #' p5("CBCDE") # success: list("C", "BCDE")) #' p5("DBCDE") # fail : list()) #' @export choice <- function(list_of_parsers) Reduce(or_else, list_of_parsers) #' Sequence combinator #' @param list_of_parsers A list of parser. #' @examples #' p7 <- sequence(list(literal("A"), literal("B"), literal("C"))) #' p7("ABCDE") # success: list("ABC", "DE")) #' p7("BBCDE") # fail : list() #' @export sequence <- function(...) Reduce(' Between combinator
1 | between(p1, p2, p3)
|
p1 |
A parser. |
p2 |
A parser. |
p3 |
A parser. |
1 2 3 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.