org.bitbucket.inkytonik.kiama.output
Continuation representation of documents.
Continuation representation of documents.
The operations provided by a pretty-printable document that don't depend on the document's representation type.
The operations provided by a pretty-printable document that don't depend on the document's representation type.
An entry in the final output stream.
An entry in the final output stream.
An output entry that indicates the finish of a document linked with n
.
An output entry that indicates the finish of a document linked with n
.
An output entry that indicates the finish of a document linked with n
.
An output entry that indicates the finish of a document linked with n
.
An output entry for a piece of the pretty-printed text.
An output entry for a piece of the pretty-printed text.
Return a document that renders d
with the nesting level set to the
current indentation column.
Return a document that renders d
with the nesting level set to the
current indentation column.
An ampersand document.
An ampersand document.
Return a document that encloses a given document between left and right angle brackets.
Return a document that encloses a given document between left and right angle brackets.
Generic pretty-printer document for any type of value.
Generic pretty-printer document for any type of value. If a
is a
Vector
, Map
, List
or Product
, print it in a prefix list style,
with the exception that Nil
prints as Nil
. Tuples are pretty-printed
using arrow notation. Strings are pretty-printed surrounded by double
quotes. If none of these cases apply, use value
on a
. null
prints
as null
.
Return a document that pretty-prints a sequence as a Scala argument list.
Return a document that pretty-prints a sequence as a Scala argument
list. The arguments are parenthesized and pretty-printed using
sepfn
(default: lsep
). Each element of the list is pretty-printed
using elemToDoc
(default: value
). The separator defaults to a
comma.
An asterisk document.
An asterisk document.
An at-sign document.
An at-sign document.
A backquote document.
A backquote document.
A backslash document.
A backslash document.
Return a document that encloses a given document between left and right braces.
Return a document that encloses a given document between left and right braces.
Return a document that encloses a given document between left and right square brackets.
Return a document that encloses a given document between left and right square brackets.
A caret document.
A caret document.
Return a document that concatenates the documents in the given sequence
either horizontally with <>
if they fit in the output medium width,
or if not, vertically with <@@>
.
Return a document that concatenates the documents in the given sequence
either horizontally with <>
if they fit in the output medium width,
or if not, vertically with <@@>
.
Convert a character to a document.
Convert a character to a document. The character can be a newline.
A colon document.
A colon document.
Return the document produced by f
when it is passed the column at which
rendering is currently placed.
Return the document produced by f
when it is passed the column at which
rendering is currently placed.
A comma document.
A comma document.
Default indentation is four spaces.
Default indentation is four spaces.
Default layout width is 75 characters.
Default layout width is 75 characters.
A dollar sign document.
A dollar sign document.
A dot (period) document.
A dot (period) document.
A double quote document.
A double quote document.
Return a document that encloses a given document between double quotes.
Return a document that encloses a given document between double quotes.
An empty document.
An empty document. This is a left and right unit for the concatenation
method. Called nil
in the paper.
Return a document that encloses a given document between left and right documents.
Return a document that encloses a given document between left and right documents.
An equal sign document.
An equal sign document.
An exclamation mark document.
An exclamation mark document.
Return a document that concatenates the documents in the given sequence
horizontally with <>
until they don't fit the output width, then
inserts a line break and continues to the end of the sequence.
Return a document that concatenates the documents in the given sequence
horizontally with <>
until they don't fit the output width, then
inserts a line break and continues to the end of the sequence.
Return a document that concatenates the documents in the given sequence
horizontally with <+>
as long as they fit the output width, then
inserts a line
and continues with the rest of the sequence.
Return a document that concatenates the documents in the given sequence
horizontally with <+>
as long as they fit the output width, then
inserts a line
and continues with the rest of the sequence. Separates
documents with the given separator before the <+>
.
Return a document that concatenates the documents in the given sequence
horizontally with <+>
as long as they fit the output width, then
inserts a line
and continues with the rest of the sequence.
Return a document that concatenates the documents in the given sequence
horizontally with <+>
as long as they fit the output width, then
inserts a line
and continues with the rest of the sequence.
Return a document that is the result of folding f
over the sequence
ds
.
Return a document that is the result of folding f
over the sequence
ds
. Returns the empty document is ds
is empty.
A forward slash document.
A forward slash document.
A document representing a choice among different ways to print a structure.
A document representing a choice among different ways to print a structure.
Return a document that is like d
but whose second and subsequent lines
have hanging indentation of i
spaces (defaults to the deafult indentation).
Return a document that is like d
but whose second and subsequent lines
have hanging indentation of i
spaces (defaults to the deafult indentation).
In other words, the first line is indented at the current nesting level
and the remaining lines are indented i
spaces more.
A hash mark document.
A hash mark document.
Return a document that concatenates the documents in the given sequence
horizontally with <>
.
Return a document that concatenates the documents in the given sequence
horizontally with <>
.
Return a document that concatenates the documents in the given sequence
horizontally with <+>
.
Return a document that concatenates the documents in the given sequence
horizontally with <+>
. Separates documents with the given separator
before the <+>
.
Return a document that concatenates the documents in the given sequence
horizontally with <+>
.
Return a document that concatenates the documents in the given sequence
horizontally with <+>
.
Return a document that is d
but with the first line indented by i
more spaces.
Return a document that is d
but with the first line indented by i
more spaces.
A left angle bracket document.
A left angle bracket document.
Pretty-print a document as per pretty
but just return the layout.
Pretty-print a document as per pretty
but just return the layout.
A left brace document.
A left brace document.
A left square bracket document.
A left square bracket document.
A document representing a potential line break.
A document representing a potential line break. Behaves like a space character if the break is omitted by a group.
A document representing a potential line break.
A document representing a potential line break. Behaves like the
string repl
if the break is omitted by a group.
A document representing a potential line break.
A document representing a potential line break. Behaves like an empty string if the break is omitted by a group.
Return a document that prints as d
but also records the fact that the
printed representation of d
is linked to n
.
Return a document that prints as d
but also records the fact that the
printed representation of d
is linked to n
. The positions of that
pretty-printed representation can be retrieved via the position
information in the Document
returned when this Doc
is pretty-printed.
Pretty-print a document as per pretty
but just return the links.
Pretty-print a document as per pretty
but just return the links.
Return a document that pretty-prints a list in Scala notation, inserting line breaks between elements as necessary.
Return a document that pretty-prints a list in Scala notation,
inserting line breaks between elements as necessary. The same
as calling seq
with a prefix of "List"
and passing all
other arguments through.
A left parenthesis document.
A left parenthesis document.
Return a pretty-printer document for a separated sequence.
Return a pretty-printer document for a separated sequence.
sep
is the separator. Line breaks are allowed before the sequence
and after the separators between the elements of the sequence. The
before line break turns into nothing if omitted. The internal line
breaks turn into space
if omitted.
Return a pretty-printer document for a separated sequence.
Return a pretty-printer document for a separated sequence.
sep
is the separator. Line breaks are allowed before the separators
between the elements of the sequence and at the end. A space
is
inserted after each separator. The internal line breaks turn into
space
if omitted. The end line break turns into nothing if omitted.
Return a pretty-printer document for a sequence where each element
is terminated by term
.
Return a pretty-printer document for a sequence where each element
is terminated by term
. Line breaks are allowed before the sequence
and after the terminator between the elements of the sequence. The
before line break turns into nothing if omitted. The internal line
breaks turn into space
if omitted.
An minus sign document.
An minus sign document.
Nest a document by an indentation increment on top of the current nesting.
Nest a document by an indentation increment on top of the current nesting. In the paper version, the indentation parameter comes first, but we put it second here so that it can be given a default value.
Return the document produced by f
when it is passed the nesting level
(indentation) of the current line.
Return the document produced by f
when it is passed the nesting level
(indentation) of the current line.
Return a document that pads d
out to a width of p
.
Return a document that pads d
out to a width of p
. If d
already has
a width greater than or equal to d
, don't add any padding. This combinator
is called fill
in the PPrint library.
As for padto
but if the document width is already greater than or equal
to p
, insert a possible line break and new nesting level instead of not
adding any padding.
As for padto
but if the document width is already greater than or equal
to p
, insert a possible line break and new nesting level instead of not
adding any padding. This combinator is called fillBreak
in the PPrint
library.
Return a document that encloses a given document between left and right parentheses.
Return a document that encloses a given document between left and right parentheses.
A percent sign document.
A percent sign document.
An plus sign document.
An plus sign document.
Pretty print a document assuming a given output medium width.
Pretty print a document assuming a given output medium width. In the paper the width is the first parameter, but here we put it second so we can provide a default value.
A question mark document.
A question mark document.
A right angle bracket document.
A right angle bracket document.
A right brace document.
A right brace document.
A right square bracket document.
A right square bracket document.
A right parenthesis document.
A right parenthesis document.
A semicolon document.
A semicolon document.
Return a document that concatenates the documents in the given sequence
either horizontally with <+>
if they fit in the output medium width,
or if not, vertically with <@>
.
Return a document that concatenates the documents in the given sequence
either horizontally with <+>
if they fit in the output medium width,
or if not, vertically with <@>
.
Return a document that pretty-prints a sequence in Scala notation, inserting line breaks between elements as necessary.
Return a document that pretty-prints a sequence in Scala notation,
inserting line breaks between elements as necessary. The same
as pretty-printing the prefix followed by a space, then using
arguments
to pretty-print the content of the sequence, passing
all other arguments through.
Return a document that behaves like empty
if the resulting output
fits the page, otherwise it behaves like line
.
Return a document that behaves like empty
if the resulting output
fits the page, otherwise it behaves like line
.
Return a document that behaves like space
if the resulting output
fits the page, otherwise it behaves like line
.
Return a document that behaves like space
if the resulting output
fits the page, otherwise it behaves like line
.
A space document.
A space document.
Return a document representing n
spaces if n
s greater than zero,
otherwise return an empty document.
Return a document representing n
spaces if n
s greater than zero,
otherwise return an empty document.
A single quote document.
A single quote document.
Return a document that encloses a given document between single quotes.
Return a document that encloses a given document between single quotes.
Return a document that concatenates the documents in the given sequence
and separates adjacent documents with sep
with no space around the
separator.
Return a document that concatenates the documents in the given sequence
and separates adjacent documents with sep
with no space around the
separator.
Return a document that concatenates the documents in the given sequence
and terminates each document with term
.
Return a document that concatenates the documents in the given sequence
and terminates each document with term
.
Convert a string to a document.
Convert a string to a document. The string is allowed to contain
newline characters. If no newlines are included, it is best to
use text
directly instead.
Return a document that encloses a given document d
between two
occurrences of another document b
.
Return a document that encloses a given document d
between two
occurrences of another document b
.
Convert a string to a document.
Convert a string to a document. The string should not contain any
newline characters. Use line
instead.
A tilde document.
A tilde document.
An underscore document.
An underscore document.
Return a document representing a value formatted using toString
and
the string
combinator.
Return a document representing a value formatted using toString
and
the string
combinator. As a special case, if the value is a null
reference it is formatted as null
.
Return a document that concatenates the documents in the given sequence
vertically with <@@>
.
Return a document that concatenates the documents in the given sequence
vertically with <@@>
.
A vertical bar document.
A vertical bar document.
Return a document that concatenates the documents in the given sequence
vertically with <@>
.
Return a document that concatenates the documents in the given sequence
vertically with <@>
. Separates documents with the given separator
before the <@>
.
Return a document that concatenates the documents in the given sequence
vertically with <@>
.
Return a document that concatenates the documents in the given sequence
vertically with <@>
.
Return a document that renders d
beside the document obtained by running
f
on the width of d
.
Return a document that renders d
beside the document obtained by running
f
on the width of d
.
Default pretty printer.