printer.js 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. var _buffer = require("./buffer");
  7. var n = require("./node");
  8. var _t = require("@babel/types");
  9. var generatorFunctions = require("./generators");
  10. const {
  11. isFunction,
  12. isStatement,
  13. isClassBody,
  14. isTSInterfaceBody,
  15. isTSEnumDeclaration
  16. } = _t;
  17. const SCIENTIFIC_NOTATION = /e/i;
  18. const ZERO_DECIMAL_INTEGER = /\.0+$/;
  19. const NON_DECIMAL_LITERAL = /^0[box]/;
  20. const PURE_ANNOTATION_RE = /^\s*[@#]__PURE__\s*$/;
  21. const HAS_NEWLINE = /[\n\r\u2028\u2029]/;
  22. const HAS_BlOCK_COMMENT_END = /\*\//;
  23. const {
  24. needsParens
  25. } = n;
  26. class Printer {
  27. constructor(format, map) {
  28. this.inForStatementInitCounter = 0;
  29. this._printStack = [];
  30. this._indent = 0;
  31. this._indentChar = 0;
  32. this._indentRepeat = 0;
  33. this._insideAux = false;
  34. this._parenPushNewlineState = null;
  35. this._noLineTerminator = false;
  36. this._printAuxAfterOnNextUserNode = false;
  37. this._printedComments = new Set();
  38. this._endsWithInteger = false;
  39. this._endsWithWord = false;
  40. this._lastCommentLine = 0;
  41. this._endsWithInnerRaw = false;
  42. this._indentInnerComments = true;
  43. this.format = format;
  44. this._buf = new _buffer.default(map);
  45. this._indentChar = format.indent.style.charCodeAt(0);
  46. this._indentRepeat = format.indent.style.length;
  47. }
  48. generate(ast) {
  49. this.print(ast);
  50. this._maybeAddAuxComment();
  51. return this._buf.get();
  52. }
  53. indent() {
  54. if (this.format.compact || this.format.concise) return;
  55. this._indent++;
  56. }
  57. dedent() {
  58. if (this.format.compact || this.format.concise) return;
  59. this._indent--;
  60. }
  61. semicolon(force = false) {
  62. this._maybeAddAuxComment();
  63. if (force) {
  64. this._appendChar(59);
  65. } else {
  66. this._queue(59);
  67. }
  68. this._noLineTerminator = false;
  69. }
  70. rightBrace() {
  71. if (this.format.minified) {
  72. this._buf.removeLastSemicolon();
  73. }
  74. this.tokenChar(125);
  75. }
  76. space(force = false) {
  77. if (this.format.compact) return;
  78. if (force) {
  79. this._space();
  80. } else if (this._buf.hasContent()) {
  81. const lastCp = this.getLastChar();
  82. if (lastCp !== 32 && lastCp !== 10) {
  83. this._space();
  84. }
  85. }
  86. }
  87. word(str, noLineTerminatorAfter = false) {
  88. this._maybePrintInnerComments();
  89. if (this._endsWithWord || str.charCodeAt(0) === 47 && this.endsWith(47)) {
  90. this._space();
  91. }
  92. this._maybeAddAuxComment();
  93. this._append(str, false);
  94. this._endsWithWord = true;
  95. this._noLineTerminator = noLineTerminatorAfter;
  96. }
  97. number(str) {
  98. this.word(str);
  99. this._endsWithInteger = Number.isInteger(+str) && !NON_DECIMAL_LITERAL.test(str) && !SCIENTIFIC_NOTATION.test(str) && !ZERO_DECIMAL_INTEGER.test(str) && str.charCodeAt(str.length - 1) !== 46;
  100. }
  101. token(str, maybeNewline = false) {
  102. this._maybePrintInnerComments();
  103. const lastChar = this.getLastChar();
  104. const strFirst = str.charCodeAt(0);
  105. if (lastChar === 33 && str === "--" || strFirst === 43 && lastChar === 43 || strFirst === 45 && lastChar === 45 || strFirst === 46 && this._endsWithInteger) {
  106. this._space();
  107. }
  108. this._maybeAddAuxComment();
  109. this._append(str, maybeNewline);
  110. this._noLineTerminator = false;
  111. }
  112. tokenChar(char) {
  113. this._maybePrintInnerComments();
  114. const lastChar = this.getLastChar();
  115. if (char === 43 && lastChar === 43 || char === 45 && lastChar === 45 || char === 46 && this._endsWithInteger) {
  116. this._space();
  117. }
  118. this._maybeAddAuxComment();
  119. this._appendChar(char);
  120. this._noLineTerminator = false;
  121. }
  122. newline(i = 1, force) {
  123. if (i <= 0) return;
  124. if (!force) {
  125. if (this.format.retainLines || this.format.compact) return;
  126. if (this.format.concise) {
  127. this.space();
  128. return;
  129. }
  130. }
  131. if (i > 2) i = 2;
  132. i -= this._buf.getNewlineCount();
  133. for (let j = 0; j < i; j++) {
  134. this._newline();
  135. }
  136. return;
  137. }
  138. endsWith(char) {
  139. return this.getLastChar() === char;
  140. }
  141. getLastChar() {
  142. return this._buf.getLastChar();
  143. }
  144. endsWithCharAndNewline() {
  145. return this._buf.endsWithCharAndNewline();
  146. }
  147. removeTrailingNewline() {
  148. this._buf.removeTrailingNewline();
  149. }
  150. exactSource(loc, cb) {
  151. if (!loc) return cb();
  152. this._catchUp("start", loc);
  153. this._buf.exactSource(loc, cb);
  154. }
  155. source(prop, loc) {
  156. if (!loc) return;
  157. this._catchUp(prop, loc);
  158. this._buf.source(prop, loc);
  159. }
  160. sourceWithOffset(prop, loc, lineOffset, columnOffset) {
  161. if (!loc) return;
  162. this._catchUp(prop, loc);
  163. this._buf.sourceWithOffset(prop, loc, lineOffset, columnOffset);
  164. }
  165. withSource(prop, loc, cb) {
  166. if (!loc) return cb();
  167. this._catchUp(prop, loc);
  168. this._buf.withSource(prop, loc, cb);
  169. }
  170. _space() {
  171. this._queue(32);
  172. }
  173. _newline() {
  174. this._queue(10);
  175. }
  176. _append(str, maybeNewline) {
  177. this._maybeAddParen(str);
  178. this._maybeIndent(str.charCodeAt(0));
  179. this._buf.append(str, maybeNewline);
  180. this._endsWithWord = false;
  181. this._endsWithInteger = false;
  182. }
  183. _appendChar(char) {
  184. this._maybeAddParenChar(char);
  185. this._maybeIndent(char);
  186. this._buf.appendChar(char);
  187. this._endsWithWord = false;
  188. this._endsWithInteger = false;
  189. }
  190. _queue(char) {
  191. this._maybeAddParenChar(char);
  192. this._maybeIndent(char);
  193. this._buf.queue(char);
  194. this._endsWithWord = false;
  195. this._endsWithInteger = false;
  196. }
  197. _maybeIndent(firstChar) {
  198. if (this._indent && firstChar !== 10 && this.endsWith(10)) {
  199. this._buf.queueIndentation(this._indentChar, this._getIndent());
  200. }
  201. }
  202. _shouldIndent(firstChar) {
  203. if (this._indent && firstChar !== 10 && this.endsWith(10)) {
  204. return true;
  205. }
  206. }
  207. _maybeAddParenChar(char) {
  208. const parenPushNewlineState = this._parenPushNewlineState;
  209. if (!parenPushNewlineState) return;
  210. if (char === 32) {
  211. return;
  212. }
  213. if (char !== 10) {
  214. this._parenPushNewlineState = null;
  215. return;
  216. }
  217. this.tokenChar(40);
  218. this.indent();
  219. parenPushNewlineState.printed = true;
  220. }
  221. _maybeAddParen(str) {
  222. const parenPushNewlineState = this._parenPushNewlineState;
  223. if (!parenPushNewlineState) return;
  224. const len = str.length;
  225. let i;
  226. for (i = 0; i < len && str.charCodeAt(i) === 32; i++) continue;
  227. if (i === len) {
  228. return;
  229. }
  230. const cha = str.charCodeAt(i);
  231. if (cha !== 10) {
  232. if (cha !== 47 || i + 1 === len) {
  233. this._parenPushNewlineState = null;
  234. return;
  235. }
  236. const chaPost = str.charCodeAt(i + 1);
  237. if (chaPost === 42) {
  238. if (PURE_ANNOTATION_RE.test(str.slice(i + 2, len - 2))) {
  239. return;
  240. }
  241. } else if (chaPost !== 47) {
  242. this._parenPushNewlineState = null;
  243. return;
  244. }
  245. }
  246. this.tokenChar(40);
  247. this.indent();
  248. parenPushNewlineState.printed = true;
  249. }
  250. catchUp(line) {
  251. if (!this.format.retainLines) return;
  252. const count = line - this._buf.getCurrentLine();
  253. for (let i = 0; i < count; i++) {
  254. this._newline();
  255. }
  256. }
  257. _catchUp(prop, loc) {
  258. if (!this.format.retainLines) return;
  259. const pos = loc ? loc[prop] : null;
  260. if ((pos == null ? void 0 : pos.line) != null) {
  261. const count = pos.line - this._buf.getCurrentLine();
  262. for (let i = 0; i < count; i++) {
  263. this._newline();
  264. }
  265. }
  266. }
  267. _getIndent() {
  268. return this._indentRepeat * this._indent;
  269. }
  270. printTerminatorless(node, parent, isLabel) {
  271. if (isLabel) {
  272. this._noLineTerminator = true;
  273. this.print(node, parent);
  274. } else {
  275. const terminatorState = {
  276. printed: false
  277. };
  278. this._parenPushNewlineState = terminatorState;
  279. this.print(node, parent);
  280. if (terminatorState.printed) {
  281. this.dedent();
  282. this.newline();
  283. this.tokenChar(41);
  284. }
  285. }
  286. }
  287. print(node, parent, noLineTerminatorAfter, trailingCommentsLineOffset, forceParens) {
  288. if (!node) return;
  289. this._endsWithInnerRaw = false;
  290. const nodeType = node.type;
  291. const format = this.format;
  292. const oldConcise = format.concise;
  293. if (node._compact) {
  294. format.concise = true;
  295. }
  296. const printMethod = this[nodeType];
  297. if (printMethod === undefined) {
  298. throw new ReferenceError(`unknown node of type ${JSON.stringify(nodeType)} with constructor ${JSON.stringify(node.constructor.name)}`);
  299. }
  300. this._printStack.push(node);
  301. const oldInAux = this._insideAux;
  302. this._insideAux = node.loc == undefined;
  303. this._maybeAddAuxComment(this._insideAux && !oldInAux);
  304. let shouldPrintParens = false;
  305. if (forceParens) {
  306. shouldPrintParens = true;
  307. } else if (format.retainFunctionParens && nodeType === "FunctionExpression" && node.extra && node.extra.parenthesized) {
  308. shouldPrintParens = true;
  309. } else {
  310. shouldPrintParens = needsParens(node, parent, this._printStack);
  311. }
  312. if (shouldPrintParens) {
  313. this.tokenChar(40);
  314. this._endsWithInnerRaw = false;
  315. }
  316. this._lastCommentLine = 0;
  317. this._printLeadingComments(node, parent);
  318. const loc = nodeType === "Program" || nodeType === "File" ? null : node.loc;
  319. this.exactSource(loc, printMethod.bind(this, node, parent));
  320. if (shouldPrintParens) {
  321. this._printTrailingComments(node, parent);
  322. this.tokenChar(41);
  323. this._noLineTerminator = noLineTerminatorAfter;
  324. } else if (noLineTerminatorAfter && !this._noLineTerminator) {
  325. this._noLineTerminator = true;
  326. this._printTrailingComments(node, parent);
  327. } else {
  328. this._printTrailingComments(node, parent, trailingCommentsLineOffset);
  329. }
  330. this._printStack.pop();
  331. format.concise = oldConcise;
  332. this._insideAux = oldInAux;
  333. this._endsWithInnerRaw = false;
  334. }
  335. _maybeAddAuxComment(enteredPositionlessNode) {
  336. if (enteredPositionlessNode) this._printAuxBeforeComment();
  337. if (!this._insideAux) this._printAuxAfterComment();
  338. }
  339. _printAuxBeforeComment() {
  340. if (this._printAuxAfterOnNextUserNode) return;
  341. this._printAuxAfterOnNextUserNode = true;
  342. const comment = this.format.auxiliaryCommentBefore;
  343. if (comment) {
  344. this._printComment({
  345. type: "CommentBlock",
  346. value: comment
  347. }, 0);
  348. }
  349. }
  350. _printAuxAfterComment() {
  351. if (!this._printAuxAfterOnNextUserNode) return;
  352. this._printAuxAfterOnNextUserNode = false;
  353. const comment = this.format.auxiliaryCommentAfter;
  354. if (comment) {
  355. this._printComment({
  356. type: "CommentBlock",
  357. value: comment
  358. }, 0);
  359. }
  360. }
  361. getPossibleRaw(node) {
  362. const extra = node.extra;
  363. if (extra && extra.raw != null && extra.rawValue != null && node.value === extra.rawValue) {
  364. return extra.raw;
  365. }
  366. }
  367. printJoin(nodes, parent, opts = {}) {
  368. if (!(nodes != null && nodes.length)) return;
  369. if (opts.indent) this.indent();
  370. const newlineOpts = {
  371. addNewlines: opts.addNewlines,
  372. nextNodeStartLine: 0
  373. };
  374. const separator = opts.separator ? opts.separator.bind(this) : null;
  375. const len = nodes.length;
  376. for (let i = 0; i < len; i++) {
  377. const node = nodes[i];
  378. if (!node) continue;
  379. if (opts.statement) this._printNewline(i === 0, newlineOpts);
  380. this.print(node, parent, undefined, opts.trailingCommentsLineOffset || 0);
  381. opts.iterator == null ? void 0 : opts.iterator(node, i);
  382. if (i < len - 1) separator == null ? void 0 : separator();
  383. if (opts.statement) {
  384. if (i + 1 === len) {
  385. this.newline(1);
  386. } else {
  387. var _nextNode$loc;
  388. const nextNode = nodes[i + 1];
  389. newlineOpts.nextNodeStartLine = ((_nextNode$loc = nextNode.loc) == null ? void 0 : _nextNode$loc.start.line) || 0;
  390. this._printNewline(true, newlineOpts);
  391. }
  392. }
  393. }
  394. if (opts.indent) this.dedent();
  395. }
  396. printAndIndentOnComments(node, parent) {
  397. const indent = node.leadingComments && node.leadingComments.length > 0;
  398. if (indent) this.indent();
  399. this.print(node, parent);
  400. if (indent) this.dedent();
  401. }
  402. printBlock(parent) {
  403. const node = parent.body;
  404. if (node.type !== "EmptyStatement") {
  405. this.space();
  406. }
  407. this.print(node, parent);
  408. }
  409. _printTrailingComments(node, parent, lineOffset) {
  410. const {
  411. innerComments,
  412. trailingComments
  413. } = node;
  414. if (innerComments != null && innerComments.length) {
  415. this._printComments(2, innerComments, node, parent, lineOffset);
  416. }
  417. if (trailingComments != null && trailingComments.length) {
  418. this._printComments(2, trailingComments, node, parent, lineOffset);
  419. }
  420. }
  421. _printLeadingComments(node, parent) {
  422. const comments = node.leadingComments;
  423. if (!(comments != null && comments.length)) return;
  424. this._printComments(0, comments, node, parent);
  425. }
  426. _maybePrintInnerComments() {
  427. if (this._endsWithInnerRaw) this.printInnerComments();
  428. this._endsWithInnerRaw = true;
  429. this._indentInnerComments = true;
  430. }
  431. printInnerComments() {
  432. const node = this._printStack[this._printStack.length - 1];
  433. const comments = node.innerComments;
  434. if (!(comments != null && comments.length)) return;
  435. const hasSpace = this.endsWith(32);
  436. const indent = this._indentInnerComments;
  437. const printedCommentsCount = this._printedComments.size;
  438. if (indent) this.indent();
  439. this._printComments(1, comments, node);
  440. if (hasSpace && printedCommentsCount !== this._printedComments.size) {
  441. this.space();
  442. }
  443. if (indent) this.dedent();
  444. }
  445. noIndentInnerCommentsHere() {
  446. this._indentInnerComments = false;
  447. }
  448. printSequence(nodes, parent, opts = {}) {
  449. opts.statement = true;
  450. return this.printJoin(nodes, parent, opts);
  451. }
  452. printList(items, parent, opts = {}) {
  453. if (opts.separator == null) {
  454. opts.separator = commaSeparator;
  455. }
  456. return this.printJoin(items, parent, opts);
  457. }
  458. _printNewline(newLine, opts) {
  459. if (this.format.retainLines || this.format.compact) return;
  460. if (this.format.concise) {
  461. this.space();
  462. return;
  463. }
  464. if (!newLine) {
  465. return;
  466. }
  467. const startLine = opts.nextNodeStartLine;
  468. const lastCommentLine = this._lastCommentLine;
  469. if (startLine > 0 && lastCommentLine > 0) {
  470. const offset = startLine - lastCommentLine;
  471. if (offset >= 0) {
  472. this.newline(offset || 1);
  473. return;
  474. }
  475. }
  476. if (this._buf.hasContent()) {
  477. this.newline(1);
  478. }
  479. }
  480. _shouldPrintComment(comment) {
  481. if (comment.ignore) return 0;
  482. if (this._printedComments.has(comment)) return 0;
  483. if (this._noLineTerminator && (HAS_NEWLINE.test(comment.value) || HAS_BlOCK_COMMENT_END.test(comment.value))) {
  484. return 2;
  485. }
  486. this._printedComments.add(comment);
  487. if (!this.format.shouldPrintComment(comment.value)) {
  488. return 0;
  489. }
  490. return 1;
  491. }
  492. _printComment(comment, skipNewLines) {
  493. const noLineTerminator = this._noLineTerminator;
  494. const isBlockComment = comment.type === "CommentBlock";
  495. const printNewLines = isBlockComment && skipNewLines !== 1 && !this._noLineTerminator;
  496. if (printNewLines && this._buf.hasContent() && skipNewLines !== 2) {
  497. this.newline(1);
  498. }
  499. const lastCharCode = this.getLastChar();
  500. if (lastCharCode !== 91 && lastCharCode !== 123) {
  501. this.space();
  502. }
  503. let val;
  504. if (isBlockComment) {
  505. val = `/*${comment.value}*/`;
  506. if (this.format.indent.adjustMultilineComment) {
  507. var _comment$loc;
  508. const offset = (_comment$loc = comment.loc) == null ? void 0 : _comment$loc.start.column;
  509. if (offset) {
  510. const newlineRegex = new RegExp("\\n\\s{1," + offset + "}", "g");
  511. val = val.replace(newlineRegex, "\n");
  512. }
  513. let indentSize = this.format.retainLines ? 0 : this._buf.getCurrentColumn();
  514. if (this._shouldIndent(47) || this.format.retainLines) {
  515. indentSize += this._getIndent();
  516. }
  517. val = val.replace(/\n(?!$)/g, `\n${" ".repeat(indentSize)}`);
  518. }
  519. } else if (!noLineTerminator) {
  520. val = `//${comment.value}`;
  521. } else {
  522. val = `/*${comment.value}*/`;
  523. }
  524. if (this.endsWith(47)) this._space();
  525. this.source("start", comment.loc);
  526. this._append(val, isBlockComment);
  527. if (!isBlockComment && !noLineTerminator) {
  528. this.newline(1, true);
  529. }
  530. if (printNewLines && skipNewLines !== 3) {
  531. this.newline(1);
  532. }
  533. }
  534. _printComments(type, comments, node, parent, lineOffset = 0) {
  535. const nodeLoc = node.loc;
  536. const len = comments.length;
  537. let hasLoc = !!nodeLoc;
  538. const nodeStartLine = hasLoc ? nodeLoc.start.line : 0;
  539. const nodeEndLine = hasLoc ? nodeLoc.end.line : 0;
  540. let lastLine = 0;
  541. let leadingCommentNewline = 0;
  542. const maybeNewline = this._noLineTerminator ? function () {} : this.newline.bind(this);
  543. for (let i = 0; i < len; i++) {
  544. const comment = comments[i];
  545. const shouldPrint = this._shouldPrintComment(comment);
  546. if (shouldPrint === 2) {
  547. hasLoc = false;
  548. break;
  549. }
  550. if (hasLoc && comment.loc && shouldPrint === 1) {
  551. const commentStartLine = comment.loc.start.line;
  552. const commentEndLine = comment.loc.end.line;
  553. if (type === 0) {
  554. let offset = 0;
  555. if (i === 0) {
  556. if (this._buf.hasContent() && (comment.type === "CommentLine" || commentStartLine != commentEndLine)) {
  557. offset = leadingCommentNewline = 1;
  558. }
  559. } else {
  560. offset = commentStartLine - lastLine;
  561. }
  562. lastLine = commentEndLine;
  563. maybeNewline(offset);
  564. this._printComment(comment, 1);
  565. if (i + 1 === len) {
  566. maybeNewline(Math.max(nodeStartLine - lastLine, leadingCommentNewline));
  567. lastLine = nodeStartLine;
  568. }
  569. } else if (type === 1) {
  570. const offset = commentStartLine - (i === 0 ? nodeStartLine : lastLine);
  571. lastLine = commentEndLine;
  572. maybeNewline(offset);
  573. this._printComment(comment, 1);
  574. if (i + 1 === len) {
  575. maybeNewline(Math.min(1, nodeEndLine - lastLine));
  576. lastLine = nodeEndLine;
  577. }
  578. } else {
  579. const offset = commentStartLine - (i === 0 ? nodeEndLine - lineOffset : lastLine);
  580. lastLine = commentEndLine;
  581. maybeNewline(offset);
  582. this._printComment(comment, 1);
  583. }
  584. } else {
  585. hasLoc = false;
  586. if (shouldPrint !== 1) {
  587. continue;
  588. }
  589. if (len === 1) {
  590. const singleLine = comment.loc ? comment.loc.start.line === comment.loc.end.line : !HAS_NEWLINE.test(comment.value);
  591. const shouldSkipNewline = singleLine && !isStatement(node) && !isClassBody(parent) && !isTSInterfaceBody(parent) && !isTSEnumDeclaration(parent);
  592. if (type === 0) {
  593. this._printComment(comment, shouldSkipNewline && node.type !== "ObjectExpression" || singleLine && isFunction(parent, {
  594. body: node
  595. }) ? 1 : 0);
  596. } else if (shouldSkipNewline && type === 2) {
  597. this._printComment(comment, 1);
  598. } else {
  599. this._printComment(comment, 0);
  600. }
  601. } else if (type === 1 && !(node.type === "ObjectExpression" && node.properties.length > 1) && node.type !== "ClassBody" && node.type !== "TSInterfaceBody") {
  602. this._printComment(comment, i === 0 ? 2 : i === len - 1 ? 3 : 0);
  603. } else {
  604. this._printComment(comment, 0);
  605. }
  606. }
  607. }
  608. if (type === 2 && hasLoc && lastLine) {
  609. this._lastCommentLine = lastLine;
  610. }
  611. }
  612. }
  613. Object.assign(Printer.prototype, generatorFunctions);
  614. {
  615. Printer.prototype.Noop = function Noop() {};
  616. }
  617. var _default = Printer;
  618. exports.default = _default;
  619. function commaSeparator() {
  620. this.tokenChar(44);
  621. this.space();
  622. }
  623. //# sourceMappingURL=printer.js.map