Printer class
A simple printer that keeps track of offset locations and records source maps locations.
Properties
Methods
-
add(
String str, {bool projectMarks = false}) → void -
Add
str
contents to the output, tracking new lines to track correct positions for span locations. WhenprojectMarks
is true, this method adds a source map location on each new line, projecting that every new line in the target file (printed here) corresponds to a new line in the source file. -
addSpaces(
int total) → void -
Append a
total
number of spaces in the target file. Typically used for formatting indentation. -
mark(
Object mark) → void -
Marks that the current point in the target file corresponds to the
mark
in the source file, which can be either aSourceLocation
or aSourceSpan
. When the mark is a SourceMapSpan withisIdentifier
set, this also records the name of the identifier in the source map information. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited