Skip to content

Printer

[Source]

Pretty-prints a parse tree as indented S-expressions. Each node is printed as (label ...) with children indented below it; tokens are printed as (label text) on a single line.

primitive val Printer

Constructors

create

[Source]

new val create()
: Printer val^

Returns


Public Functions

apply

[Source]

Print the parse tree rooted at p. Pass a String ref as s to append to an existing buffer; otherwise a new string is allocated.

fun box apply(
  p: (AST val | Token val | NotPresent val),
  depth: USize val = 0,
  indent: String val = "  ",
  s: String ref = reference)
: String ref

Parameters

Returns


eq

[Source]

fun box eq(
  that: Printer val)
: Bool val

Parameters

Returns


ne

[Source]

fun box ne(
  that: Printer val)
: Bool val

Parameters

Returns