{ "version": 3, "names": [ "Buffer", "Loc", "n", "t", "RecordAndTuplePluginOptions", "PipelineOperatorPluginOptions", "Opts", "jsescOptions", "generatorFunctions", "SourceMap", "charCodes", "SCIENTIFIC_NOTATION", "ZERO_DECIMAL_INTEGER", "NON_DECIMAL_LITERAL", "PURE_ANNOTATION_RE", "needsParens", "needsWhitespaceAfter", "needsWhitespaceBefore", "Format", "shouldPrintComment", "comment", "retainLines", "retainFunctionParens", "comments", "auxiliaryCommentBefore", "auxiliaryCommentAfter", "compact", "minified", "concise", "indent", "adjustMultilineComment", "style", "recordAndTupleSyntaxType", "jsescOption", "jsonCompatibleStrings", "topicToken", "decoratorsBeforeExport", "AddNewlinesOptions", "addNewlines", "leading", "node", "Node", "PrintSequenceOptions", "Partial", "statement", "PrintListOptions", "separator", "this", "Printer", "PrintJoinOptions", "iterator", "index", "constructor", "format", "map", "_buf", "_indentChar", "charCodeAt", "_indentRepeat", "length", "inForStatementInitCounter", "_printStack", "Array", "_indent", "_insideAux", "_parenPushNewlineState", "printed", "_noLineTerminator", "_printAuxAfterOnNextUserNode", "_printedComments", "Set", "Comment", "_endsWithInteger", "_endsWithWord", "generate", "ast", "print", "_maybeAddAuxComment", "get", "dedent", "semicolon", "force", "_appendChar", "_queue", "rightBrace", "removeLastSemicolon", "token", "space", "_space", "hasContent", "lastCp", "getLastChar", "lineFeed", "word", "str", "slash", "endsWith", "_append", "number", "Number", "isInteger", "test", "dot", "maybeNewline", "lastChar", "strFirst", "exclamationMark", "plusSign", "dash", "tokenChar", "char", "newline", "i", "charBeforeNewline", "endsWithCharAndNewline", "leftCurlyBrace", "colon", "j", "_newline", "removeTrailingNewline", "exactSource", "loc", "cb", "_catchUp", "source", "prop", "sourceWithOffset", "lineOffset", "columnOffset", "withSource", "_maybeAddParen", "_maybeIndent", "append", "_maybeAddParenChar", "appendChar", "queue", "firstChar", "queueIndentation", "_getIndent", "parenPushNewlineState", "len", "cha", "chaPost", "asterisk", "slice", "pos", "line", "count", "getCurrentLine", "printTerminatorless", "parent", "isLabel", "terminatorState", "noLineTerminator", "nodeType", "type", "oldConcise", "_compact", "printMethod", "Exclude", "DeprecatedAliases", "undefined", "ReferenceError", "JSON", "stringify", "name", "push", "oldInAux", "shouldPrintParens", "extra", "parenthesized", "_printLeadingComments", "bind", "_printTrailingComments", "pop", "enteredPositionlessNode", "_printAuxBeforeComment", "_printAuxAfterComment", "_printComment", "value", "getPossibleRaw", "StringLiteral", "NumericLiteral", "BigIntLiteral", "DecimalLiteral", "DirectiveLiteral", "JSXText", "raw", "rawValue", "printJoin", "nodes", "opts", "newlineOpts", "_printNewline", "call", "printAndIndentOnComments", "leadingComments", "printBlock", "Extract", "body", "Statement", "_printComments", "_getComments", "printInnerComments", "innerComments", "printSequence", "printList", "items", "commaSeparator", "lines", "needs", "Math", "min", "trailingComments", "skipNewLines", "ignore", "has", "add", "isBlockComment", "printNewLines", "lastCharCode", "leftSquareBracket", "val", "offset", "start", "column", "newlineRegex", "RegExp", "replace", "indentSize", "max", "getCurrentColumn", "repeat", "inlinePureAnnotation", "printAssertions", "assertions", "ImportAttribute", "Object", "assign", "prototype", "process", "env", "BABEL_8_BREAKING", "Noop", "GeneratorFunctions" ], "sources": [ "fixtures/sourcemaps/real-world-babel-file2/input.ts" ], "sourcesContent": [ "// From packages\\babel-generator\\src\\printer.ts\n\nimport Buffer from \"./buffer\";\nimport type { Loc } from \"./buffer\";\nimport * as n from \"./node\";\nimport type * as t from \"@babel/types\";\nimport type {\n RecordAndTuplePluginOptions,\n PipelineOperatorPluginOptions,\n} from \"@babel/parser\";\nimport type { Opts as jsescOptions } from \"jsesc\";\n\nimport * as generatorFunctions from \"./generators\";\nimport type SourceMap from \"./source-map\";\nimport * as charCodes from \"charcodes\";\n\nconst SCIENTIFIC_NOTATION = /e/i;\nconst ZERO_DECIMAL_INTEGER = /\\.0+$/;\nconst NON_DECIMAL_LITERAL = /^0[box]/;\nconst PURE_ANNOTATION_RE = /^\\s*[@#]__PURE__\\s*$/;\n\nconst { needsParens, needsWhitespaceAfter, needsWhitespaceBefore } = n;\n\nexport type Format = {\n shouldPrintComment: (comment: string) => boolean;\n retainLines: boolean;\n retainFunctionParens: boolean;\n comments: boolean;\n auxiliaryCommentBefore: string;\n auxiliaryCommentAfter: string;\n compact: boolean | \"auto\";\n minified: boolean;\n concise: boolean;\n indent: {\n adjustMultilineComment: boolean;\n style: string;\n };\n recordAndTupleSyntaxType: RecordAndTuplePluginOptions[\"syntaxType\"];\n jsescOption: jsescOptions;\n jsonCompatibleStrings?: boolean;\n /**\n * For use with the Hack-style pipe operator.\n * Changes what token is used for pipe bodies’ topic references.\n */\n topicToken?: PipelineOperatorPluginOptions[\"topicToken\"];\n /**\n * @deprecated Removed in Babel 8\n */\n decoratorsBeforeExport?: boolean;\n};\n\ninterface AddNewlinesOptions {\n addNewlines(leading: boolean, node: t.Node): number;\n}\n\ninterface PrintSequenceOptions extends Partial {\n statement?: boolean;\n indent?: boolean;\n}\n\ninterface PrintListOptions {\n separator?: (this: Printer) => void;\n statement?: boolean;\n indent?: boolean;\n}\n\ntype PrintJoinOptions = PrintListOptions &\n PrintSequenceOptions & {\n iterator?: (node: t.Node, index: number) => void;\n };\nclass Printer {\n constructor(format: Format, map: SourceMap) {\n this.format = format;\n this._buf = new Buffer(map);\n\n this._indentChar = format.indent.style.charCodeAt(0);\n this._indentRepeat = format.indent.style.length;\n }\n\n declare format: Format;\n inForStatementInitCounter: number = 0;\n\n declare _buf: Buffer;\n _printStack: Array = [];\n _indent: number = 0;\n _indentChar: number = 0;\n _indentRepeat: number = 0;\n _insideAux: boolean = false;\n _parenPushNewlineState: { printed: boolean } | null = null;\n _noLineTerminator: boolean = false;\n _printAuxAfterOnNextUserNode: boolean = false;\n _printedComments = new Set();\n _endsWithInteger = false;\n _endsWithWord = false;\n\n generate(ast: t.Node) {\n this.print(ast);\n this._maybeAddAuxComment();\n\n return this._buf.get();\n }\n\n /**\n * Increment indent size.\n */\n\n indent(): void {\n if (this.format.compact || this.format.concise) return;\n\n this._indent++;\n }\n\n /**\n * Decrement indent size.\n */\n\n dedent(): void {\n if (this.format.compact || this.format.concise) return;\n\n this._indent--;\n }\n\n /**\n * Add a semicolon to the buffer.\n */\n\n semicolon(force: boolean = false): void {\n this._maybeAddAuxComment();\n if (force) {\n this._appendChar(charCodes.semicolon);\n } else {\n this._queue(charCodes.semicolon);\n }\n }\n\n /**\n * Add a right brace to the buffer.\n */\n\n rightBrace(): void {\n if (this.format.minified) {\n this._buf.removeLastSemicolon();\n }\n this.token(\"}\");\n }\n\n /**\n * Add a space to the buffer unless it is compact.\n */\n\n space(force: boolean = false): void {\n if (this.format.compact) return;\n\n if (force) {\n this._space();\n } else if (this._buf.hasContent()) {\n const lastCp = this.getLastChar();\n if (lastCp !== charCodes.space && lastCp !== charCodes.lineFeed) {\n this._space();\n }\n }\n }\n\n /**\n * Writes a token that can't be safely parsed without taking whitespace into account.\n */\n\n word(str: string): void {\n // prevent concatenating words and creating // comment out of division and regex\n if (\n this._endsWithWord ||\n (str.charCodeAt(0) === charCodes.slash && this.endsWith(charCodes.slash))\n ) {\n this._space();\n }\n\n this._maybeAddAuxComment();\n this._append(str, false);\n\n this._endsWithWord = true;\n }\n\n /**\n * Writes a number token so that we can validate if it is an integer.\n */\n\n number(str: string): void {\n this.word(str);\n\n // Integer tokens need special handling because they cannot have '.'s inserted\n // immediately after them.\n this._endsWithInteger =\n Number.isInteger(+str) &&\n !NON_DECIMAL_LITERAL.test(str) &&\n !SCIENTIFIC_NOTATION.test(str) &&\n !ZERO_DECIMAL_INTEGER.test(str) &&\n str.charCodeAt(str.length - 1) !== charCodes.dot;\n }\n\n /**\n * Writes a simple token.\n */\n\n token(str: string, maybeNewline = false): void {\n // space is mandatory to avoid outputting