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
strcontents to the output, tracking new lines to track correct positions for span locations. WhenprojectMarksis 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
totalnumber 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
markin the source file, which can be either aSourceLocationor aSourceSpan. When the mark is a SourceMapSpan withisIdentifierset, 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