View source: R/parsers_derived.R
EmptyLine | R Documentation |
An empty line is a line that consists entirely of space-like characters.
EmptyLine
is a parser that recognizes one empty line, Spacer
recognizes
one or more empty lines and MaybeEmpty
recognizes zero or more empty
lines. EmptyLine
returns the empty line but Spacer
and MaybeEmpty
discard these.
EmptyLine()
Spacer()
MaybeEmpty()
A parser.
space_like_eraser(x): d = x in which all "\\s+" are replaced by "" if d=="" TRUE else FALSE Emptyline: satisfy(space_like_eraser) Spacer: one_or_more(EmptyLine()) %ret% null MaybeEmpty: zero_or_more(EmptyLine()) %ret% null
where null
is the empty vector.
EmptyLine() (" \t ") # success
EmptyLine() (" .") # failure
EmptyLine() ("") # success
Spacer() (c(" \t ", " ", "abc"))
Spacer() (c(" ", " ", "Important text"))
Spacer() (c("Important text")) # failure, missing empty line
MaybeEmpty() (c(" ", " ", "Important text")) # success, just as Spacer()
MaybeEmpty() (c("Important text")) # success, in contrast to Spacer()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.