Printer class

A simple printer that keeps track of offset locations and records source maps locations.

Constructors

Printer(String filename)

Properties

filename → String
final
hashCode → int
The hash code for this object.
no setterinherited
map → String
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
text → String
no setter

Methods

add(String str, {bool projectMarks = false}) → void
Add str contents to the output, tracking new lines to track correct positions for span locations. When projectMarks 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 a SourceLocation or a SourceSpan. When the mark is a SourceMapSpan with isIdentifier 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