1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | var util_1 = require("./util");
|
4 | var CodePrinter = (function () {
|
5 | function CodePrinter(depth, printer) {
|
6 | this.depth = depth;
|
7 | this.printer = printer;
|
8 | this.indentation = util_1.generateIndent(1);
|
9 | }
|
10 | CodePrinter.prototype.indent = function () {
|
11 | this.depth++;
|
12 | return this;
|
13 | };
|
14 | CodePrinter.prototype.dedent = function () {
|
15 | this.depth--;
|
16 | return this;
|
17 | };
|
18 | CodePrinter.prototype.printLn = function (line) {
|
19 | this.printer.printLn(new Array(this.depth + 1).join(this.indentation) + line);
|
20 | return this;
|
21 | };
|
22 | CodePrinter.prototype.printEmptyLn = function () {
|
23 | this.printer.printEmptyLn();
|
24 | return this;
|
25 | };
|
26 | return CodePrinter;
|
27 | }());
|
28 | exports.CodePrinter = CodePrinter;
|
29 |
|
\ | No newline at end of file |