print.marker: Print method for an object of class marker
Description
An object of class marker is an empty list created by the function
fail(). To indicate that this object differs from simply list() its
print method prints [].
Usage
# S3 method for marker
print(x, ...)
Value
The printed marker object is returned invisibly.
Arguments
x
an object used to select a method.
...
further arguments passed to or from other methods.
Details
The marker class is used internally to mark the largest index number of
the element (i.e. line) of the input character vector at which the parser
failed. This number is stored in the attribute n of a marker and only
correctly corresponds to that index number if the parser is wrapped in a
reporter() call.
d <- (literal("A") %then% literal("B"))(c("A","A"))
# prints the icon [] for failed parsingd
# Reveal the modest content of the marker objectunclass(d)