print.marker {parcr}R Documentation

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 class 'marker'
print(x, ...)

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.

Value

The printed marker object is returned invisibly.

See Also

failed()

Examples

d <- (literal("A") %then% literal("B"))(c("A","A"))
# prints the icon [] for failed parsing
d
# Reveal the modest content of the marker object
unclass(d)

[Package parcr version 0.5.2 Index]