From b267927c552b58e38c5718e2e894691f835f5e22 Mon Sep 17 00:00:00 2001 From: David Bonnet Date: Sat, 20 Jul 2019 12:54:55 +0200 Subject: [PATCH] fix(#74): correct exponentiation precedence Closes #74. --- docs/demo/astring.min.js | 2 +- docs/demo/astring.min.js.map | 2 +- src/astring.js | 23 ++++++++++++++--------- src/tests/fixtures/syntax/precedence.js | 2 ++ src/tests/index.js | 8 +++++++- 5 files changed, 25 insertions(+), 12 deletions(-) diff --git a/docs/demo/astring.min.js b/docs/demo/astring.min.js index 36e44990..ff6a6788 100644 --- a/docs/demo/astring.min.js +++ b/docs/demo/astring.min.js @@ -1,3 +1,3 @@ -(function(a,b){if("function"==typeof define&&define.amd)define(["exports"],b);else if("undefined"!=typeof exports)b(exports);else{var c={exports:{}};b(c.exports),a.astring=c.exports}})(this,function(a){"use strict";var m=String.prototype;function b(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function c(a,b){for(var c,d=0;d":9,"<=":9,">=":9,in:9,instanceof:9,"<<":10,">>":10,">>>":10,"+":11,"-":11,"*":12,"%":12,"/":12,"**":13},v=17,w={ArrayExpression:20,TaggedTemplateExpression:20,ThisExpression:20,Identifier:20,Literal:18,TemplateLiteral:20,Super:20,SequenceExpression:20,MemberExpression:19,CallExpression:19,NewExpression:19,ArrowFunctionExpression:v,ClassExpression:v,FunctionExpression:v,ObjectExpression:v,UpdateExpression:16,UnaryExpression:15,BinaryExpression:14,LogicalExpression:13,ConditionalExpression:4,AssignmentExpression:3,AwaitExpression:2,YieldExpression:2,RestElement:1},x={Program:function Program(a,b){var c=b.indent.repeat(b.indentLevel),d=b.lineEnd,e=b.writeComments;e&&null!=a.comments&&j(b,a.comments,c,d);for(var f,g=a.body,h=g.length,k=0;k "),"O"===a.body.type[0]?(b.write("("),this.ObjectExpression(a.body,b),b.write(")")):this[a.body.type](a.body,b)},ThisExpression:function ThisExpression(a,b){b.write("this",a)},Super:function Super(a,b){b.write("super",a)},RestElement:q=function(a,b){b.write("..."),this[a.argument.type](a.argument,b)},SpreadElement:q,YieldExpression:function YieldExpression(a,b){b.write(a.delegate?"yield*":"yield"),a.argument&&(b.write(" "),this[a.argument.type](a.argument,b))},AwaitExpression:function AwaitExpression(a,b){b.write("await "),a.argument&&this[a.argument.type](a.argument,b)},TemplateLiteral:function TemplateLiteral(a,b){var c=a.quasis,d=a.expressions;b.write("`");for(var e,f=d.length,g=0;gw.ConditionalExpression?this[a.test.type](a.test,b):(b.write("("),this[a.test.type](a.test,b),b.write(")")),b.write(" ? "),this[a.consequent.type](a.consequent,b),b.write(" : "),this[a.alternate.type](a.alternate,b)},NewExpression:function NewExpression(a,b){b.write("new "),w[a.callee.type]":9,"<=":9,">=":9,in:9,instanceof:9,"<<":10,">>":10,">>>":10,"+":11,"-":11,"*":12,"%":12,"/":12,"**":13},v=17,w={ArrayExpression:20,TaggedTemplateExpression:20,ThisExpression:20,Identifier:20,Literal:18,TemplateLiteral:20,Super:20,SequenceExpression:20,MemberExpression:19,CallExpression:19,NewExpression:19,ArrowFunctionExpression:v,ClassExpression:v,FunctionExpression:v,ObjectExpression:v,UpdateExpression:16,UnaryExpression:15,BinaryExpression:14,LogicalExpression:13,ConditionalExpression:4,AssignmentExpression:3,AwaitExpression:2,YieldExpression:2,RestElement:1},x={Program:function Program(a,b){var c=b.indent.repeat(b.indentLevel),d=b.lineEnd,e=b.writeComments;e&&null!=a.comments&&j(b,a.comments,c,d);for(var f,g=a.body,h=g.length,k=0;k "),"O"===a.body.type[0]?(b.write("("),this.ObjectExpression(a.body,b),b.write(")")):this[a.body.type](a.body,b)},ThisExpression:function ThisExpression(a,b){b.write("this",a)},Super:function Super(a,b){b.write("super",a)},RestElement:q=function(a,b){b.write("..."),this[a.argument.type](a.argument,b)},SpreadElement:q,YieldExpression:function YieldExpression(a,b){b.write(a.delegate?"yield*":"yield"),a.argument&&(b.write(" "),this[a.argument.type](a.argument,b))},AwaitExpression:function AwaitExpression(a,b){b.write("await "),a.argument&&this[a.argument.type](a.argument,b)},TemplateLiteral:function TemplateLiteral(a,b){var c=a.quasis,d=a.expressions;b.write("`");for(var e,f=d.length,g=0;gw.ConditionalExpression?this[a.test.type](a.test,b):(b.write("("),this[a.test.type](a.test,b),b.write(")")),b.write(" ? "),this[a.consequent.type](a.consequent,b),b.write(" : "),this[a.alternate.type](a.alternate,b)},NewExpression:function NewExpression(a,b){b.write("new "),w[a.callee.type]': 9,\n '<=': 9,\n '>=': 9,\n in: 9,\n instanceof: 9,\n '<<': 10,\n '>>': 10,\n '>>>': 10,\n '+': 11,\n '-': 11,\n '*': 12,\n '%': 12,\n '/': 12,\n '**': 13,\n}\n\n// Enables parenthesis regardless of precedence\nconst NEEDS_PARENTHESES = 17\n\nconst EXPRESSIONS_PRECEDENCE = {\n // Definitions\n ArrayExpression: 20,\n TaggedTemplateExpression: 20,\n ThisExpression: 20,\n Identifier: 20,\n Literal: 18,\n TemplateLiteral: 20,\n Super: 20,\n SequenceExpression: 20,\n // Operations\n MemberExpression: 19,\n CallExpression: 19,\n NewExpression: 19,\n // Other definitions\n ArrowFunctionExpression: NEEDS_PARENTHESES,\n ClassExpression: NEEDS_PARENTHESES,\n FunctionExpression: NEEDS_PARENTHESES,\n ObjectExpression: NEEDS_PARENTHESES,\n // Other operations\n UpdateExpression: 16,\n UnaryExpression: 15,\n BinaryExpression: 14,\n LogicalExpression: 13,\n ConditionalExpression: 4,\n AssignmentExpression: 3,\n AwaitExpression: 2,\n YieldExpression: 2,\n RestElement: 1,\n}\n\nfunction formatSequence(state, nodes) {\n /*\n Writes into `state` a sequence of `nodes`.\n */\n const { generator } = state\n state.write('(')\n if (nodes != null && nodes.length > 0) {\n generator[nodes[0].type](nodes[0], state)\n const { length } = nodes\n for (let i = 1; i < length; i++) {\n const param = nodes[i]\n state.write(', ')\n generator[param.type](param, state)\n }\n }\n state.write(')')\n}\n\nfunction expressionNeedsParenthesis(node, parentNode, isRightHand) {\n const nodePrecedence = EXPRESSIONS_PRECEDENCE[node.type]\n if (nodePrecedence === NEEDS_PARENTHESES) {\n return true\n }\n const parentNodePrecedence = EXPRESSIONS_PRECEDENCE[parentNode.type]\n if (nodePrecedence !== parentNodePrecedence) {\n // Different node types\n return nodePrecedence < parentNodePrecedence\n }\n if (nodePrecedence !== 13 && nodePrecedence !== 14) {\n // Not a `LogicalExpression` or `BinaryExpression`\n return false\n }\n if (node.operator === '**' && parentNode.operator === '**') {\n // Exponentiation operator has right-to-left associativity\n return !isRightHand\n }\n if (isRightHand) {\n // Parenthesis are used if both operators have the same precedence\n return (\n OPERATOR_PRECEDENCE[node.operator] <=\n OPERATOR_PRECEDENCE[parentNode.operator]\n )\n }\n return (\n OPERATOR_PRECEDENCE[node.operator] <\n OPERATOR_PRECEDENCE[parentNode.operator]\n )\n}\n\nfunction formatBinaryExpressionPart(state, node, parentNode, isRightHand) {\n /*\n Writes into `state` a left-hand or right-hand expression `node`\n from a binary expression applying the provided `operator`.\n The `isRightHand` parameter should be `true` if the `node` is a right-hand argument.\n */\n const { generator } = state\n if (expressionNeedsParenthesis(node, parentNode, isRightHand)) {\n state.write('(')\n generator[node.type](node, state)\n state.write(')')\n } else {\n generator[node.type](node, state)\n }\n}\n\nfunction reindent(state, text, indent, lineEnd) {\n /*\n Writes into `state` the `text` string reindented with the provided `indent`.\n */\n const lines = text.split('\\n')\n const end = lines.length - 1\n state.write(lines[0].trim())\n if (end > 0) {\n state.write(lineEnd)\n for (let i = 1; i < end; i++) {\n state.write(indent + lines[i].trim() + lineEnd)\n }\n state.write(indent + lines[end].trim())\n }\n}\n\nfunction formatComments(state, comments, indent, lineEnd) {\n /*\n Writes into `state` the provided list of `comments`, with the given `indent` and `lineEnd` strings.\n Line comments will end with `\"\\n\"` regardless of the value of `lineEnd`.\n Expects to start on a new unindented line.\n */\n const { length } = comments\n for (let i = 0; i < length; i++) {\n const comment = comments[i]\n state.write(indent)\n if (comment.type[0] === 'L') {\n // Line comment\n state.write('// ' + comment.value.trim() + '\\n')\n } else {\n // Block comment\n state.write('/*')\n reindent(state, comment.value, indent, lineEnd)\n state.write('*/' + lineEnd)\n }\n }\n}\n\nfunction hasCallExpression(node) {\n /*\n Returns `true` if the provided `node` contains a call expression and `false` otherwise.\n */\n let currentNode = node\n while (currentNode != null) {\n const { type } = currentNode\n if (type[0] === 'C' && type[1] === 'a') {\n // Is CallExpression\n return true\n } else if (type[0] === 'M' && type[1] === 'e' && type[2] === 'm') {\n // Is MemberExpression\n currentNode = currentNode.object\n } else {\n return false\n }\n }\n}\n\nfunction formatVariableDeclaration(state, node) {\n /*\n Writes into `state` a variable declaration.\n */\n const { generator } = state\n const { declarations } = node\n state.write(node.kind + ' ')\n const { length } = declarations\n if (length > 0) {\n generator.VariableDeclarator(declarations[0], state)\n for (let i = 1; i < length; i++) {\n state.write(', ')\n generator.VariableDeclarator(declarations[i], state)\n }\n }\n}\n\nlet ForInStatement,\n FunctionDeclaration,\n RestElement,\n BinaryExpression,\n ArrayExpression,\n BlockStatement\n\nexport const baseGenerator = {\n Program(node, state) {\n const indent = state.indent.repeat(state.indentLevel)\n const { lineEnd, writeComments } = state\n if (writeComments && node.comments != null) {\n formatComments(state, node.comments, indent, lineEnd)\n }\n const statements = node.body\n const { length } = statements\n for (let i = 0; i < length; i++) {\n const statement = statements[i]\n if (writeComments && statement.comments != null) {\n formatComments(state, statement.comments, indent, lineEnd)\n }\n state.write(indent)\n this[statement.type](statement, state)\n state.write(lineEnd)\n }\n if (writeComments && node.trailingComments != null) {\n formatComments(state, node.trailingComments, indent, lineEnd)\n }\n },\n BlockStatement: (BlockStatement = function(node, state) {\n const indent = state.indent.repeat(state.indentLevel++)\n const { lineEnd, writeComments } = state\n const statementIndent = indent + state.indent\n state.write('{')\n const statements = node.body\n if (statements != null && statements.length > 0) {\n state.write(lineEnd)\n if (writeComments && node.comments != null) {\n formatComments(state, node.comments, statementIndent, lineEnd)\n }\n const { length } = statements\n for (let i = 0; i < length; i++) {\n const statement = statements[i]\n if (writeComments && statement.comments != null) {\n formatComments(state, statement.comments, statementIndent, lineEnd)\n }\n state.write(statementIndent)\n this[statement.type](statement, state)\n state.write(lineEnd)\n }\n state.write(indent)\n } else {\n if (writeComments && node.comments != null) {\n state.write(lineEnd)\n formatComments(state, node.comments, statementIndent, lineEnd)\n state.write(indent)\n }\n }\n if (writeComments && node.trailingComments != null) {\n formatComments(state, node.trailingComments, statementIndent, lineEnd)\n }\n state.write('}')\n state.indentLevel--\n }),\n ClassBody: BlockStatement,\n EmptyStatement(node, state) {\n state.write(';')\n },\n ExpressionStatement(node, state) {\n const precedence = EXPRESSIONS_PRECEDENCE[node.expression.type]\n if (\n precedence === NEEDS_PARENTHESES ||\n (precedence === 3 && node.expression.left.type[0] === 'O')\n ) {\n // Should always have parentheses or is an AssignmentExpression to an ObjectPattern\n state.write('(')\n this[node.expression.type](node.expression, state)\n state.write(')')\n } else {\n this[node.expression.type](node.expression, state)\n }\n state.write(';')\n },\n IfStatement(node, state) {\n state.write('if (')\n this[node.test.type](node.test, state)\n state.write(') ')\n this[node.consequent.type](node.consequent, state)\n if (node.alternate != null) {\n state.write(' else ')\n this[node.alternate.type](node.alternate, state)\n }\n },\n LabeledStatement(node, state) {\n this[node.label.type](node.label, state)\n state.write(': ')\n this[node.body.type](node.body, state)\n },\n BreakStatement(node, state) {\n state.write('break')\n if (node.label != null) {\n state.write(' ')\n this[node.label.type](node.label, state)\n }\n state.write(';')\n },\n ContinueStatement(node, state) {\n state.write('continue')\n if (node.label != null) {\n state.write(' ')\n this[node.label.type](node.label, state)\n }\n state.write(';')\n },\n WithStatement(node, state) {\n state.write('with (')\n this[node.object.type](node.object, state)\n state.write(') ')\n this[node.body.type](node.body, state)\n },\n SwitchStatement(node, state) {\n const indent = state.indent.repeat(state.indentLevel++)\n const { lineEnd, writeComments } = state\n state.indentLevel++\n const caseIndent = indent + state.indent\n const statementIndent = caseIndent + state.indent\n state.write('switch (')\n this[node.discriminant.type](node.discriminant, state)\n state.write(') {' + lineEnd)\n const { cases: occurences } = node\n const { length: occurencesCount } = occurences\n for (let i = 0; i < occurencesCount; i++) {\n const occurence = occurences[i]\n if (writeComments && occurence.comments != null) {\n formatComments(state, occurence.comments, caseIndent, lineEnd)\n }\n if (occurence.test) {\n state.write(caseIndent + 'case ')\n this[occurence.test.type](occurence.test, state)\n state.write(':' + lineEnd)\n } else {\n state.write(caseIndent + 'default:' + lineEnd)\n }\n const { consequent } = occurence\n const { length: consequentCount } = consequent\n for (let i = 0; i < consequentCount; i++) {\n const statement = consequent[i]\n if (writeComments && statement.comments != null) {\n formatComments(state, statement.comments, statementIndent, lineEnd)\n }\n state.write(statementIndent)\n this[statement.type](statement, state)\n state.write(lineEnd)\n }\n }\n state.indentLevel -= 2\n state.write(indent + '}')\n },\n ReturnStatement(node, state) {\n state.write('return')\n if (node.argument) {\n state.write(' ')\n this[node.argument.type](node.argument, state)\n }\n state.write(';')\n },\n ThrowStatement(node, state) {\n state.write('throw ')\n this[node.argument.type](node.argument, state)\n state.write(';')\n },\n TryStatement(node, state) {\n state.write('try ')\n this[node.block.type](node.block, state)\n if (node.handler) {\n const { handler } = node\n if (handler.param == null) {\n state.write(' catch ')\n } else {\n state.write(' catch (')\n this[handler.param.type](handler.param, state)\n state.write(') ')\n }\n this[handler.body.type](handler.body, state)\n }\n if (node.finalizer) {\n state.write(' finally ')\n this[node.finalizer.type](node.finalizer, state)\n }\n },\n WhileStatement(node, state) {\n state.write('while (')\n this[node.test.type](node.test, state)\n state.write(') ')\n this[node.body.type](node.body, state)\n },\n DoWhileStatement(node, state) {\n state.write('do ')\n this[node.body.type](node.body, state)\n state.write(' while (')\n this[node.test.type](node.test, state)\n state.write(');')\n },\n ForStatement(node, state) {\n state.write('for (')\n if (node.init != null) {\n const { init } = node\n if (init.type[0] === 'V') {\n formatVariableDeclaration(state, init)\n } else {\n this[init.type](init, state)\n }\n }\n state.write('; ')\n if (node.test) {\n this[node.test.type](node.test, state)\n }\n state.write('; ')\n if (node.update) {\n this[node.update.type](node.update, state)\n }\n state.write(') ')\n this[node.body.type](node.body, state)\n },\n ForInStatement: (ForInStatement = function(node, state) {\n state.write(`for ${node.await ? 'await ' : ''}(`)\n const { left } = node\n if (left.type[0] === 'V') {\n formatVariableDeclaration(state, left)\n } else {\n this[left.type](left, state)\n }\n // Identifying whether node.type is `ForInStatement` or `ForOfStatement`\n state.write(node.type[3] === 'I' ? ' in ' : ' of ')\n this[node.right.type](node.right, state)\n state.write(') ')\n this[node.body.type](node.body, state)\n }),\n ForOfStatement: ForInStatement,\n DebuggerStatement(node, state) {\n state.write('debugger;' + state.lineEnd)\n },\n FunctionDeclaration: (FunctionDeclaration = function(node, state) {\n state.write(\n (node.async ? 'async ' : '') +\n (node.generator ? 'function* ' : 'function ') +\n (node.id ? node.id.name : ''),\n node,\n )\n formatSequence(state, node.params)\n state.write(' ')\n this[node.body.type](node.body, state)\n }),\n FunctionExpression: FunctionDeclaration,\n VariableDeclaration(node, state) {\n formatVariableDeclaration(state, node)\n state.write(';')\n },\n VariableDeclarator(node, state) {\n this[node.id.type](node.id, state)\n if (node.init != null) {\n state.write(' = ')\n this[node.init.type](node.init, state)\n }\n },\n ClassDeclaration(node, state) {\n state.write('class ' + (node.id ? `${node.id.name} ` : ''), node)\n if (node.superClass) {\n state.write('extends ')\n this[node.superClass.type](node.superClass, state)\n state.write(' ')\n }\n this.ClassBody(node.body, state)\n },\n ImportDeclaration(node, state) {\n state.write('import ')\n const { specifiers } = node\n const { length } = specifiers\n // NOTE: Once babili is fixed, put this after condition\n // https://github.com/babel/babili/issues/430\n let i = 0\n if (length > 0) {\n for (; i < length; ) {\n if (i > 0) {\n state.write(', ')\n }\n const specifier = specifiers[i]\n const type = specifier.type[6]\n if (type === 'D') {\n // ImportDefaultSpecifier\n state.write(specifier.local.name, specifier)\n i++\n } else if (type === 'N') {\n // ImportNamespaceSpecifier\n state.write('* as ' + specifier.local.name, specifier)\n i++\n } else {\n // ImportSpecifier\n break\n }\n }\n if (i < length) {\n state.write('{')\n for (;;) {\n const specifier = specifiers[i]\n const { name } = specifier.imported\n state.write(name, specifier)\n if (name !== specifier.local.name) {\n state.write(' as ' + specifier.local.name)\n }\n if (++i < length) {\n state.write(', ')\n } else {\n break\n }\n }\n state.write('}')\n }\n state.write(' from ')\n }\n this.Literal(node.source, state)\n state.write(';')\n },\n ExportDefaultDeclaration(node, state) {\n state.write('export default ')\n this[node.declaration.type](node.declaration, state)\n if (\n EXPRESSIONS_PRECEDENCE[node.declaration.type] &&\n node.declaration.type[0] !== 'F'\n ) {\n // All expression nodes except `FunctionExpression`\n state.write(';')\n }\n },\n ExportNamedDeclaration(node, state) {\n state.write('export ')\n if (node.declaration) {\n this[node.declaration.type](node.declaration, state)\n } else {\n state.write('{')\n const { specifiers } = node,\n { length } = specifiers\n if (length > 0) {\n for (let i = 0; ; ) {\n const specifier = specifiers[i]\n const { name } = specifier.local\n state.write(name, specifier)\n if (name !== specifier.exported.name) {\n state.write(' as ' + specifier.exported.name)\n }\n if (++i < length) {\n state.write(', ')\n } else {\n break\n }\n }\n }\n state.write('}')\n if (node.source) {\n state.write(' from ')\n this.Literal(node.source, state)\n }\n state.write(';')\n }\n },\n ExportAllDeclaration(node, state) {\n state.write('export * from ')\n this.Literal(node.source, state)\n state.write(';')\n },\n MethodDefinition(node, state) {\n if (node.static) {\n state.write('static ')\n }\n const kind = node.kind[0]\n if (kind === 'g' || kind === 's') {\n // Getter or setter\n state.write(node.kind + ' ')\n }\n if (node.value.async) {\n state.write('async ')\n }\n if (node.value.generator) {\n state.write('*')\n }\n if (node.computed) {\n state.write('[')\n this[node.key.type](node.key, state)\n state.write(']')\n } else {\n this[node.key.type](node.key, state)\n }\n formatSequence(state, node.value.params)\n state.write(' ')\n this[node.value.body.type](node.value.body, state)\n },\n ClassExpression(node, state) {\n this.ClassDeclaration(node, state)\n },\n ArrowFunctionExpression(node, state) {\n state.write(node.async ? 'async ' : '', node)\n const { params } = node\n if (params != null) {\n // Omit parenthesis if only one named parameter\n if (params.length === 1 && params[0].type[0] === 'I') {\n // If params[0].type[0] starts with 'I', it can't be `ImportDeclaration` nor `IfStatement` and thus is `Identifier`\n state.write(params[0].name, params[0])\n } else {\n formatSequence(state, node.params)\n }\n }\n state.write(' => ')\n if (node.body.type[0] === 'O') {\n // Body is an object expression\n state.write('(')\n this.ObjectExpression(node.body, state)\n state.write(')')\n } else {\n this[node.body.type](node.body, state)\n }\n },\n ThisExpression(node, state) {\n state.write('this', node)\n },\n Super(node, state) {\n state.write('super', node)\n },\n RestElement: (RestElement = function(node, state) {\n state.write('...')\n this[node.argument.type](node.argument, state)\n }),\n SpreadElement: RestElement,\n YieldExpression(node, state) {\n state.write(node.delegate ? 'yield*' : 'yield')\n if (node.argument) {\n state.write(' ')\n this[node.argument.type](node.argument, state)\n }\n },\n AwaitExpression(node, state) {\n state.write('await ')\n if (node.argument) {\n this[node.argument.type](node.argument, state)\n }\n },\n TemplateLiteral(node, state) {\n const { quasis, expressions } = node\n state.write('`')\n const { length } = expressions\n for (let i = 0; i < length; i++) {\n const expression = expressions[i]\n state.write(quasis[i].value.raw)\n state.write('${')\n this[expression.type](expression, state)\n state.write('}')\n }\n state.write(quasis[quasis.length - 1].value.raw)\n state.write('`')\n },\n TaggedTemplateExpression(node, state) {\n this[node.tag.type](node.tag, state)\n this[node.quasi.type](node.quasi, state)\n },\n ArrayExpression: (ArrayExpression = function(node, state) {\n state.write('[')\n if (node.elements.length > 0) {\n const { elements } = node,\n { length } = elements\n for (let i = 0; ; ) {\n const element = elements[i]\n if (element != null) {\n this[element.type](element, state)\n }\n if (++i < length) {\n state.write(', ')\n } else {\n if (element == null) {\n state.write(', ')\n }\n break\n }\n }\n }\n state.write(']')\n }),\n ArrayPattern: ArrayExpression,\n ObjectExpression(node, state) {\n const indent = state.indent.repeat(state.indentLevel++)\n const { lineEnd, writeComments } = state\n const propertyIndent = indent + state.indent\n state.write('{')\n if (node.properties.length > 0) {\n state.write(lineEnd)\n if (writeComments && node.comments != null) {\n formatComments(state, node.comments, propertyIndent, lineEnd)\n }\n const comma = ',' + lineEnd\n const { properties } = node,\n { length } = properties\n for (let i = 0; ; ) {\n const property = properties[i]\n if (writeComments && property.comments != null) {\n formatComments(state, property.comments, propertyIndent, lineEnd)\n }\n state.write(propertyIndent)\n this[property.type](property, state)\n if (++i < length) {\n state.write(comma)\n } else {\n break\n }\n }\n state.write(lineEnd)\n if (writeComments && node.trailingComments != null) {\n formatComments(state, node.trailingComments, propertyIndent, lineEnd)\n }\n state.write(indent + '}')\n } else if (writeComments) {\n if (node.comments != null) {\n state.write(lineEnd)\n formatComments(state, node.comments, propertyIndent, lineEnd)\n if (node.trailingComments != null) {\n formatComments(state, node.trailingComments, propertyIndent, lineEnd)\n }\n state.write(indent + '}')\n } else if (node.trailingComments != null) {\n state.write(lineEnd)\n formatComments(state, node.trailingComments, propertyIndent, lineEnd)\n state.write(indent + '}')\n } else {\n state.write('}')\n }\n } else {\n state.write('}')\n }\n state.indentLevel--\n },\n Property(node, state) {\n if (node.method || node.kind[0] !== 'i') {\n // Either a method or of kind `set` or `get` (not `init`)\n this.MethodDefinition(node, state)\n } else {\n if (!node.shorthand) {\n if (node.computed) {\n state.write('[')\n this[node.key.type](node.key, state)\n state.write(']')\n } else {\n this[node.key.type](node.key, state)\n }\n state.write(': ')\n }\n this[node.value.type](node.value, state)\n }\n },\n ObjectPattern(node, state) {\n state.write('{')\n if (node.properties.length > 0) {\n const { properties } = node,\n { length } = properties\n for (let i = 0; ; ) {\n this[properties[i].type](properties[i], state)\n if (++i < length) {\n state.write(', ')\n } else {\n break\n }\n }\n }\n state.write('}')\n },\n SequenceExpression(node, state) {\n formatSequence(state, node.expressions)\n },\n UnaryExpression(node, state) {\n if (node.prefix) {\n state.write(node.operator)\n if (node.operator.length > 1) {\n state.write(' ')\n }\n if (\n EXPRESSIONS_PRECEDENCE[node.argument.type] <\n EXPRESSIONS_PRECEDENCE.UnaryExpression\n ) {\n state.write('(')\n this[node.argument.type](node.argument, state)\n state.write(')')\n } else {\n this[node.argument.type](node.argument, state)\n }\n } else {\n // FIXME: This case never occurs\n this[node.argument.type](node.argument, state)\n state.write(node.operator)\n }\n },\n UpdateExpression(node, state) {\n // Always applied to identifiers or members, no parenthesis check needed\n if (node.prefix) {\n state.write(node.operator)\n this[node.argument.type](node.argument, state)\n } else {\n this[node.argument.type](node.argument, state)\n state.write(node.operator)\n }\n },\n AssignmentExpression(node, state) {\n this[node.left.type](node.left, state)\n state.write(' ' + node.operator + ' ')\n this[node.right.type](node.right, state)\n },\n AssignmentPattern(node, state) {\n this[node.left.type](node.left, state)\n state.write(' = ')\n this[node.right.type](node.right, state)\n },\n BinaryExpression: (BinaryExpression = function(node, state) {\n if (node.operator === 'in') {\n // Avoids confusion in `for` loops initializers\n state.write('(')\n formatBinaryExpressionPart(state, node.left, node, false)\n state.write(' ' + node.operator + ' ')\n formatBinaryExpressionPart(state, node.right, node, true)\n state.write(')')\n } else {\n formatBinaryExpressionPart(state, node.left, node, false)\n state.write(' ' + node.operator + ' ')\n formatBinaryExpressionPart(state, node.right, node, true)\n }\n }),\n LogicalExpression: BinaryExpression,\n ConditionalExpression(node, state) {\n if (\n EXPRESSIONS_PRECEDENCE[node.test.type] >\n EXPRESSIONS_PRECEDENCE.ConditionalExpression\n ) {\n this[node.test.type](node.test, state)\n } else {\n state.write('(')\n this[node.test.type](node.test, state)\n state.write(')')\n }\n state.write(' ? ')\n this[node.consequent.type](node.consequent, state)\n state.write(' : ')\n this[node.alternate.type](node.alternate, state)\n },\n NewExpression(node, state) {\n state.write('new ')\n if (\n EXPRESSIONS_PRECEDENCE[node.callee.type] <\n EXPRESSIONS_PRECEDENCE.CallExpression ||\n hasCallExpression(node.callee)\n ) {\n state.write('(')\n this[node.callee.type](node.callee, state)\n state.write(')')\n } else {\n this[node.callee.type](node.callee, state)\n }\n formatSequence(state, node['arguments'])\n },\n CallExpression(node, state) {\n if (\n EXPRESSIONS_PRECEDENCE[node.callee.type] <\n EXPRESSIONS_PRECEDENCE.CallExpression\n ) {\n state.write('(')\n this[node.callee.type](node.callee, state)\n state.write(')')\n } else {\n this[node.callee.type](node.callee, state)\n }\n formatSequence(state, node['arguments'])\n },\n MemberExpression(node, state) {\n if (\n EXPRESSIONS_PRECEDENCE[node.object.type] <\n EXPRESSIONS_PRECEDENCE.MemberExpression\n ) {\n state.write('(')\n this[node.object.type](node.object, state)\n state.write(')')\n } else {\n this[node.object.type](node.object, state)\n }\n if (node.computed) {\n state.write('[')\n this[node.property.type](node.property, state)\n state.write(']')\n } else {\n state.write('.')\n this[node.property.type](node.property, state)\n }\n },\n MetaProperty(node, state) {\n state.write(node.meta.name + '.' + node.property.name, node)\n },\n Identifier(node, state) {\n state.write(node.name, node)\n },\n Literal(node, state) {\n if (node.raw != null) {\n state.write(node.raw, node)\n } else if (node.regex != null) {\n this.RegExpLiteral(node, state)\n } else {\n state.write(stringify(node.value), node)\n }\n },\n RegExpLiteral(node, state) {\n const { regex } = node\n state.write(`/${regex.pattern}/${regex.flags}`, node)\n },\n}\n\nconst EMPTY_OBJECT = {}\n\nclass State {\n constructor(options) {\n const setup = options == null ? EMPTY_OBJECT : options\n this.output = ''\n // Functional options\n if (setup.output != null) {\n this.output = setup.output\n this.write = this.writeToStream\n } else {\n this.output = ''\n }\n this.generator = setup.generator != null ? setup.generator : baseGenerator\n // Formating setup\n this.indent = setup.indent != null ? setup.indent : ' '\n this.lineEnd = setup.lineEnd != null ? setup.lineEnd : '\\n'\n this.indentLevel =\n setup.startingIndentLevel != null ? setup.startingIndentLevel : 0\n this.writeComments = setup.comments ? setup.comments : false\n // Source map\n if (setup.sourceMap != null) {\n this.write =\n setup.output == null ? this.writeAndMap : this.writeToStreamAndMap\n this.sourceMap = setup.sourceMap\n this.line = 1\n this.column = 0\n this.lineEndSize = this.lineEnd.split('\\n').length - 1\n this.mapping = {\n original: null,\n generated: this,\n name: undefined,\n source: setup.sourceMap.file || setup.sourceMap._file,\n }\n }\n }\n\n write(code) {\n this.output += code\n }\n\n writeToStream(code) {\n this.output.write(code)\n }\n\n writeAndMap(code, node) {\n this.output += code\n this.map(code, node)\n }\n\n writeToStreamAndMap(code, node) {\n this.output.write(code)\n this.map(code, node)\n }\n\n map(code, node) {\n if (node != null && node.loc != null) {\n const { mapping } = this\n mapping.original = node.loc.start\n mapping.name = node.name\n this.sourceMap.addMapping(mapping)\n }\n if (code.length > 0) {\n if (this.lineEndSize > 0) {\n if (code.endsWith(this.lineEnd)) {\n this.line += this.lineEndSize\n this.column = 0\n } else if (code[code.length - 1] === '\\n') {\n // Case of inline comment\n this.line++\n this.column = 0\n } else {\n this.column += code.length\n }\n } else {\n if (code[code.length - 1] === '\\n') {\n // Case of inline comment\n this.line++\n this.column = 0\n } else {\n this.column += code.length\n }\n }\n }\n }\n\n toString() {\n return this.output\n }\n}\n\nexport function generate(node, options) {\n /*\n Returns a string representing the rendered code of the provided AST `node`.\n The `options` are:\n\n - `indent`: string to use for indentation (defaults to `␣␣`)\n - `lineEnd`: string to use for line endings (defaults to `\\n`)\n - `startingIndentLevel`: indent level to start from (defaults to `0`)\n - `comments`: generate comments if `true` (defaults to `false`)\n - `output`: output stream to write the rendered code to (defaults to `null`)\n - `generator`: custom code generator (defaults to `baseGenerator`)\n */\n const state = new State(options)\n // Travel through the AST node and generate the code\n state.generator[node.type](node, state)\n return state.output\n}\n"]} \ No newline at end of file +{"version":3,"sources":["../src/astring.js"],"names":[],"mappings":"6NAaK,MAAM,CAAC,S,0TA4EZ,QAAS,CAAA,CAAT,CAAwB,CAAxB,CAA+B,CAA/B,CAAsC,IAI5B,CAAA,CAJ4B,CAId,CAJc,CAI5B,SAJ4B,CAMpC,GADA,CAAK,CAAC,KAAN,CAAY,GAAZ,CACA,CAAa,IAAT,EAAA,CAAK,EAA2B,CAAf,CAAA,CAAK,CAAC,MAA3B,CAAuC,CACrC,CAAS,CAAC,CAAK,CAAC,CAAD,CAAL,CAAS,IAAV,CAAT,CAAyB,CAAK,CAAC,CAAD,CAA9B,CAAmC,CAAnC,CADqC,CAGrC,O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,CApBE,EAsBR,KAAK,IAAL,EAtBQ,CAuBR,KAAK,MAAL,CAAc,CAvBN,EAyBR,KAAK,MAAL,EAAe,CAAI,CAAC,MAzBZ,CA6Bf,C,2CAEU,CACT,MAAO,MAAK,MACb,C","file":"astring.min.js","sourcesContent":["// Astring is a tiny and fast JavaScript code generator from an ESTree-compliant AST.\n//\n// Astring was written by David Bonnet and released under an MIT license.\n//\n// The Git repository for Astring is available at:\n// https://github.com/davidbonnet/astring.git\n//\n// Please use the GitHub bug tracker to report issues:\n// https://github.com/davidbonnet/astring/issues\n\nconst { stringify } = JSON\n\n/* istanbul ignore if */\nif (!String.prototype.repeat) {\n /* istanbul ignore next */\n throw new Error(\n 'String.prototype.repeat is undefined, see https://github.com/davidbonnet/astring#installation',\n )\n}\n\n/* istanbul ignore if */\nif (!String.prototype.endsWith) {\n /* istanbul ignore next */\n throw new Error(\n 'String.prototype.endsWith is undefined, see https://github.com/davidbonnet/astring#installation',\n )\n}\n\nconst OPERATOR_PRECEDENCE = {\n '||': 3,\n '&&': 4,\n '|': 5,\n '^': 6,\n '&': 7,\n '==': 8,\n '!=': 8,\n '===': 8,\n '!==': 8,\n '<': 9,\n '>': 9,\n '<=': 9,\n '>=': 9,\n in: 9,\n instanceof: 9,\n '<<': 10,\n '>>': 10,\n '>>>': 10,\n '+': 11,\n '-': 11,\n '*': 12,\n '%': 12,\n '/': 12,\n '**': 13,\n}\n\n// Enables parenthesis regardless of precedence\nconst NEEDS_PARENTHESES = 17\n\nconst EXPRESSIONS_PRECEDENCE = {\n // Definitions\n ArrayExpression: 20,\n TaggedTemplateExpression: 20,\n ThisExpression: 20,\n Identifier: 20,\n Literal: 18,\n TemplateLiteral: 20,\n Super: 20,\n SequenceExpression: 20,\n // Operations\n MemberExpression: 19,\n CallExpression: 19,\n NewExpression: 19,\n // Other definitions\n ArrowFunctionExpression: NEEDS_PARENTHESES,\n ClassExpression: NEEDS_PARENTHESES,\n FunctionExpression: NEEDS_PARENTHESES,\n ObjectExpression: NEEDS_PARENTHESES,\n // Other operations\n UpdateExpression: 16,\n UnaryExpression: 15,\n BinaryExpression: 14,\n LogicalExpression: 13,\n ConditionalExpression: 4,\n AssignmentExpression: 3,\n AwaitExpression: 2,\n YieldExpression: 2,\n RestElement: 1,\n}\n\nfunction formatSequence(state, nodes) {\n /*\n Writes into `state` a sequence of `nodes`.\n */\n const { generator } = state\n state.write('(')\n if (nodes != null && nodes.length > 0) {\n generator[nodes[0].type](nodes[0], state)\n const { length } = nodes\n for (let i = 1; i < length; i++) {\n const param = nodes[i]\n state.write(', ')\n generator[param.type](param, state)\n }\n }\n state.write(')')\n}\n\nfunction expressionNeedsParenthesis(node, parentNode, isRightHand) {\n const nodePrecedence = EXPRESSIONS_PRECEDENCE[node.type]\n if (nodePrecedence === NEEDS_PARENTHESES) {\n return true\n }\n const parentNodePrecedence = EXPRESSIONS_PRECEDENCE[parentNode.type]\n if (nodePrecedence !== parentNodePrecedence) {\n // Different node types\n return (\n (!isRightHand &&\n nodePrecedence === 15 &&\n parentNodePrecedence === 14 &&\n parentNode.operator === '**') ||\n nodePrecedence < parentNodePrecedence\n )\n }\n if (nodePrecedence !== 13 && nodePrecedence !== 14) {\n // Not a `LogicalExpression` or `BinaryExpression`\n return false\n }\n if (node.operator === '**' && parentNode.operator === '**') {\n // Exponentiation operator has right-to-left associativity\n return !isRightHand\n }\n if (isRightHand) {\n // Parenthesis are used if both operators have the same precedence\n return (\n OPERATOR_PRECEDENCE[node.operator] <=\n OPERATOR_PRECEDENCE[parentNode.operator]\n )\n }\n return (\n OPERATOR_PRECEDENCE[node.operator] <\n OPERATOR_PRECEDENCE[parentNode.operator]\n )\n}\n\nfunction formatBinaryExpressionPart(state, node, parentNode, isRightHand) {\n /*\n Writes into `state` a left-hand or right-hand expression `node`\n from a binary expression applying the provided `operator`.\n The `isRightHand` parameter should be `true` if the `node` is a right-hand argument.\n */\n const { generator } = state\n if (expressionNeedsParenthesis(node, parentNode, isRightHand)) {\n state.write('(')\n generator[node.type](node, state)\n state.write(')')\n } else {\n generator[node.type](node, state)\n }\n}\n\nfunction reindent(state, text, indent, lineEnd) {\n /*\n Writes into `state` the `text` string reindented with the provided `indent`.\n */\n const lines = text.split('\\n')\n const end = lines.length - 1\n state.write(lines[0].trim())\n if (end > 0) {\n state.write(lineEnd)\n for (let i = 1; i < end; i++) {\n state.write(indent + lines[i].trim() + lineEnd)\n }\n state.write(indent + lines[end].trim())\n }\n}\n\nfunction formatComments(state, comments, indent, lineEnd) {\n /*\n Writes into `state` the provided list of `comments`, with the given `indent` and `lineEnd` strings.\n Line comments will end with `\"\\n\"` regardless of the value of `lineEnd`.\n Expects to start on a new unindented line.\n */\n const { length } = comments\n for (let i = 0; i < length; i++) {\n const comment = comments[i]\n state.write(indent)\n if (comment.type[0] === 'L') {\n // Line comment\n state.write('// ' + comment.value.trim() + '\\n')\n } else {\n // Block comment\n state.write('/*')\n reindent(state, comment.value, indent, lineEnd)\n state.write('*/' + lineEnd)\n }\n }\n}\n\nfunction hasCallExpression(node) {\n /*\n Returns `true` if the provided `node` contains a call expression and `false` otherwise.\n */\n let currentNode = node\n while (currentNode != null) {\n const { type } = currentNode\n if (type[0] === 'C' && type[1] === 'a') {\n // Is CallExpression\n return true\n } else if (type[0] === 'M' && type[1] === 'e' && type[2] === 'm') {\n // Is MemberExpression\n currentNode = currentNode.object\n } else {\n return false\n }\n }\n}\n\nfunction formatVariableDeclaration(state, node) {\n /*\n Writes into `state` a variable declaration.\n */\n const { generator } = state\n const { declarations } = node\n state.write(node.kind + ' ')\n const { length } = declarations\n if (length > 0) {\n generator.VariableDeclarator(declarations[0], state)\n for (let i = 1; i < length; i++) {\n state.write(', ')\n generator.VariableDeclarator(declarations[i], state)\n }\n }\n}\n\nlet ForInStatement,\n FunctionDeclaration,\n RestElement,\n BinaryExpression,\n ArrayExpression,\n BlockStatement\n\nexport const baseGenerator = {\n Program(node, state) {\n const indent = state.indent.repeat(state.indentLevel)\n const { lineEnd, writeComments } = state\n if (writeComments && node.comments != null) {\n formatComments(state, node.comments, indent, lineEnd)\n }\n const statements = node.body\n const { length } = statements\n for (let i = 0; i < length; i++) {\n const statement = statements[i]\n if (writeComments && statement.comments != null) {\n formatComments(state, statement.comments, indent, lineEnd)\n }\n state.write(indent)\n this[statement.type](statement, state)\n state.write(lineEnd)\n }\n if (writeComments && node.trailingComments != null) {\n formatComments(state, node.trailingComments, indent, lineEnd)\n }\n },\n BlockStatement: (BlockStatement = function(node, state) {\n const indent = state.indent.repeat(state.indentLevel++)\n const { lineEnd, writeComments } = state\n const statementIndent = indent + state.indent\n state.write('{')\n const statements = node.body\n if (statements != null && statements.length > 0) {\n state.write(lineEnd)\n if (writeComments && node.comments != null) {\n formatComments(state, node.comments, statementIndent, lineEnd)\n }\n const { length } = statements\n for (let i = 0; i < length; i++) {\n const statement = statements[i]\n if (writeComments && statement.comments != null) {\n formatComments(state, statement.comments, statementIndent, lineEnd)\n }\n state.write(statementIndent)\n this[statement.type](statement, state)\n state.write(lineEnd)\n }\n state.write(indent)\n } else {\n if (writeComments && node.comments != null) {\n state.write(lineEnd)\n formatComments(state, node.comments, statementIndent, lineEnd)\n state.write(indent)\n }\n }\n if (writeComments && node.trailingComments != null) {\n formatComments(state, node.trailingComments, statementIndent, lineEnd)\n }\n state.write('}')\n state.indentLevel--\n }),\n ClassBody: BlockStatement,\n EmptyStatement(node, state) {\n state.write(';')\n },\n ExpressionStatement(node, state) {\n const precedence = EXPRESSIONS_PRECEDENCE[node.expression.type]\n if (\n precedence === NEEDS_PARENTHESES ||\n (precedence === 3 && node.expression.left.type[0] === 'O')\n ) {\n // Should always have parentheses or is an AssignmentExpression to an ObjectPattern\n state.write('(')\n this[node.expression.type](node.expression, state)\n state.write(')')\n } else {\n this[node.expression.type](node.expression, state)\n }\n state.write(';')\n },\n IfStatement(node, state) {\n state.write('if (')\n this[node.test.type](node.test, state)\n state.write(') ')\n this[node.consequent.type](node.consequent, state)\n if (node.alternate != null) {\n state.write(' else ')\n this[node.alternate.type](node.alternate, state)\n }\n },\n LabeledStatement(node, state) {\n this[node.label.type](node.label, state)\n state.write(': ')\n this[node.body.type](node.body, state)\n },\n BreakStatement(node, state) {\n state.write('break')\n if (node.label != null) {\n state.write(' ')\n this[node.label.type](node.label, state)\n }\n state.write(';')\n },\n ContinueStatement(node, state) {\n state.write('continue')\n if (node.label != null) {\n state.write(' ')\n this[node.label.type](node.label, state)\n }\n state.write(';')\n },\n WithStatement(node, state) {\n state.write('with (')\n this[node.object.type](node.object, state)\n state.write(') ')\n this[node.body.type](node.body, state)\n },\n SwitchStatement(node, state) {\n const indent = state.indent.repeat(state.indentLevel++)\n const { lineEnd, writeComments } = state\n state.indentLevel++\n const caseIndent = indent + state.indent\n const statementIndent = caseIndent + state.indent\n state.write('switch (')\n this[node.discriminant.type](node.discriminant, state)\n state.write(') {' + lineEnd)\n const { cases: occurences } = node\n const { length: occurencesCount } = occurences\n for (let i = 0; i < occurencesCount; i++) {\n const occurence = occurences[i]\n if (writeComments && occurence.comments != null) {\n formatComments(state, occurence.comments, caseIndent, lineEnd)\n }\n if (occurence.test) {\n state.write(caseIndent + 'case ')\n this[occurence.test.type](occurence.test, state)\n state.write(':' + lineEnd)\n } else {\n state.write(caseIndent + 'default:' + lineEnd)\n }\n const { consequent } = occurence\n const { length: consequentCount } = consequent\n for (let i = 0; i < consequentCount; i++) {\n const statement = consequent[i]\n if (writeComments && statement.comments != null) {\n formatComments(state, statement.comments, statementIndent, lineEnd)\n }\n state.write(statementIndent)\n this[statement.type](statement, state)\n state.write(lineEnd)\n }\n }\n state.indentLevel -= 2\n state.write(indent + '}')\n },\n ReturnStatement(node, state) {\n state.write('return')\n if (node.argument) {\n state.write(' ')\n this[node.argument.type](node.argument, state)\n }\n state.write(';')\n },\n ThrowStatement(node, state) {\n state.write('throw ')\n this[node.argument.type](node.argument, state)\n state.write(';')\n },\n TryStatement(node, state) {\n state.write('try ')\n this[node.block.type](node.block, state)\n if (node.handler) {\n const { handler } = node\n if (handler.param == null) {\n state.write(' catch ')\n } else {\n state.write(' catch (')\n this[handler.param.type](handler.param, state)\n state.write(') ')\n }\n this[handler.body.type](handler.body, state)\n }\n if (node.finalizer) {\n state.write(' finally ')\n this[node.finalizer.type](node.finalizer, state)\n }\n },\n WhileStatement(node, state) {\n state.write('while (')\n this[node.test.type](node.test, state)\n state.write(') ')\n this[node.body.type](node.body, state)\n },\n DoWhileStatement(node, state) {\n state.write('do ')\n this[node.body.type](node.body, state)\n state.write(' while (')\n this[node.test.type](node.test, state)\n state.write(');')\n },\n ForStatement(node, state) {\n state.write('for (')\n if (node.init != null) {\n const { init } = node\n if (init.type[0] === 'V') {\n formatVariableDeclaration(state, init)\n } else {\n this[init.type](init, state)\n }\n }\n state.write('; ')\n if (node.test) {\n this[node.test.type](node.test, state)\n }\n state.write('; ')\n if (node.update) {\n this[node.update.type](node.update, state)\n }\n state.write(') ')\n this[node.body.type](node.body, state)\n },\n ForInStatement: (ForInStatement = function(node, state) {\n state.write(`for ${node.await ? 'await ' : ''}(`)\n const { left } = node\n if (left.type[0] === 'V') {\n formatVariableDeclaration(state, left)\n } else {\n this[left.type](left, state)\n }\n // Identifying whether node.type is `ForInStatement` or `ForOfStatement`\n state.write(node.type[3] === 'I' ? ' in ' : ' of ')\n this[node.right.type](node.right, state)\n state.write(') ')\n this[node.body.type](node.body, state)\n }),\n ForOfStatement: ForInStatement,\n DebuggerStatement(node, state) {\n state.write('debugger;' + state.lineEnd)\n },\n FunctionDeclaration: (FunctionDeclaration = function(node, state) {\n state.write(\n (node.async ? 'async ' : '') +\n (node.generator ? 'function* ' : 'function ') +\n (node.id ? node.id.name : ''),\n node,\n )\n formatSequence(state, node.params)\n state.write(' ')\n this[node.body.type](node.body, state)\n }),\n FunctionExpression: FunctionDeclaration,\n VariableDeclaration(node, state) {\n formatVariableDeclaration(state, node)\n state.write(';')\n },\n VariableDeclarator(node, state) {\n this[node.id.type](node.id, state)\n if (node.init != null) {\n state.write(' = ')\n this[node.init.type](node.init, state)\n }\n },\n ClassDeclaration(node, state) {\n state.write('class ' + (node.id ? `${node.id.name} ` : ''), node)\n if (node.superClass) {\n state.write('extends ')\n this[node.superClass.type](node.superClass, state)\n state.write(' ')\n }\n this.ClassBody(node.body, state)\n },\n ImportDeclaration(node, state) {\n state.write('import ')\n const { specifiers } = node\n const { length } = specifiers\n // NOTE: Once babili is fixed, put this after condition\n // https://github.com/babel/babili/issues/430\n let i = 0\n if (length > 0) {\n for (; i < length; ) {\n if (i > 0) {\n state.write(', ')\n }\n const specifier = specifiers[i]\n const type = specifier.type[6]\n if (type === 'D') {\n // ImportDefaultSpecifier\n state.write(specifier.local.name, specifier)\n i++\n } else if (type === 'N') {\n // ImportNamespaceSpecifier\n state.write('* as ' + specifier.local.name, specifier)\n i++\n } else {\n // ImportSpecifier\n break\n }\n }\n if (i < length) {\n state.write('{')\n for (;;) {\n const specifier = specifiers[i]\n const { name } = specifier.imported\n state.write(name, specifier)\n if (name !== specifier.local.name) {\n state.write(' as ' + specifier.local.name)\n }\n if (++i < length) {\n state.write(', ')\n } else {\n break\n }\n }\n state.write('}')\n }\n state.write(' from ')\n }\n this.Literal(node.source, state)\n state.write(';')\n },\n ExportDefaultDeclaration(node, state) {\n state.write('export default ')\n this[node.declaration.type](node.declaration, state)\n if (\n EXPRESSIONS_PRECEDENCE[node.declaration.type] &&\n node.declaration.type[0] !== 'F'\n ) {\n // All expression nodes except `FunctionExpression`\n state.write(';')\n }\n },\n ExportNamedDeclaration(node, state) {\n state.write('export ')\n if (node.declaration) {\n this[node.declaration.type](node.declaration, state)\n } else {\n state.write('{')\n const { specifiers } = node,\n { length } = specifiers\n if (length > 0) {\n for (let i = 0; ; ) {\n const specifier = specifiers[i]\n const { name } = specifier.local\n state.write(name, specifier)\n if (name !== specifier.exported.name) {\n state.write(' as ' + specifier.exported.name)\n }\n if (++i < length) {\n state.write(', ')\n } else {\n break\n }\n }\n }\n state.write('}')\n if (node.source) {\n state.write(' from ')\n this.Literal(node.source, state)\n }\n state.write(';')\n }\n },\n ExportAllDeclaration(node, state) {\n state.write('export * from ')\n this.Literal(node.source, state)\n state.write(';')\n },\n MethodDefinition(node, state) {\n if (node.static) {\n state.write('static ')\n }\n const kind = node.kind[0]\n if (kind === 'g' || kind === 's') {\n // Getter or setter\n state.write(node.kind + ' ')\n }\n if (node.value.async) {\n state.write('async ')\n }\n if (node.value.generator) {\n state.write('*')\n }\n if (node.computed) {\n state.write('[')\n this[node.key.type](node.key, state)\n state.write(']')\n } else {\n this[node.key.type](node.key, state)\n }\n formatSequence(state, node.value.params)\n state.write(' ')\n this[node.value.body.type](node.value.body, state)\n },\n ClassExpression(node, state) {\n this.ClassDeclaration(node, state)\n },\n ArrowFunctionExpression(node, state) {\n state.write(node.async ? 'async ' : '', node)\n const { params } = node\n if (params != null) {\n // Omit parenthesis if only one named parameter\n if (params.length === 1 && params[0].type[0] === 'I') {\n // If params[0].type[0] starts with 'I', it can't be `ImportDeclaration` nor `IfStatement` and thus is `Identifier`\n state.write(params[0].name, params[0])\n } else {\n formatSequence(state, node.params)\n }\n }\n state.write(' => ')\n if (node.body.type[0] === 'O') {\n // Body is an object expression\n state.write('(')\n this.ObjectExpression(node.body, state)\n state.write(')')\n } else {\n this[node.body.type](node.body, state)\n }\n },\n ThisExpression(node, state) {\n state.write('this', node)\n },\n Super(node, state) {\n state.write('super', node)\n },\n RestElement: (RestElement = function(node, state) {\n state.write('...')\n this[node.argument.type](node.argument, state)\n }),\n SpreadElement: RestElement,\n YieldExpression(node, state) {\n state.write(node.delegate ? 'yield*' : 'yield')\n if (node.argument) {\n state.write(' ')\n this[node.argument.type](node.argument, state)\n }\n },\n AwaitExpression(node, state) {\n state.write('await ')\n if (node.argument) {\n this[node.argument.type](node.argument, state)\n }\n },\n TemplateLiteral(node, state) {\n const { quasis, expressions } = node\n state.write('`')\n const { length } = expressions\n for (let i = 0; i < length; i++) {\n const expression = expressions[i]\n state.write(quasis[i].value.raw)\n state.write('${')\n this[expression.type](expression, state)\n state.write('}')\n }\n state.write(quasis[quasis.length - 1].value.raw)\n state.write('`')\n },\n TaggedTemplateExpression(node, state) {\n this[node.tag.type](node.tag, state)\n this[node.quasi.type](node.quasi, state)\n },\n ArrayExpression: (ArrayExpression = function(node, state) {\n state.write('[')\n if (node.elements.length > 0) {\n const { elements } = node,\n { length } = elements\n for (let i = 0; ; ) {\n const element = elements[i]\n if (element != null) {\n this[element.type](element, state)\n }\n if (++i < length) {\n state.write(', ')\n } else {\n if (element == null) {\n state.write(', ')\n }\n break\n }\n }\n }\n state.write(']')\n }),\n ArrayPattern: ArrayExpression,\n ObjectExpression(node, state) {\n const indent = state.indent.repeat(state.indentLevel++)\n const { lineEnd, writeComments } = state\n const propertyIndent = indent + state.indent\n state.write('{')\n if (node.properties.length > 0) {\n state.write(lineEnd)\n if (writeComments && node.comments != null) {\n formatComments(state, node.comments, propertyIndent, lineEnd)\n }\n const comma = ',' + lineEnd\n const { properties } = node,\n { length } = properties\n for (let i = 0; ; ) {\n const property = properties[i]\n if (writeComments && property.comments != null) {\n formatComments(state, property.comments, propertyIndent, lineEnd)\n }\n state.write(propertyIndent)\n this[property.type](property, state)\n if (++i < length) {\n state.write(comma)\n } else {\n break\n }\n }\n state.write(lineEnd)\n if (writeComments && node.trailingComments != null) {\n formatComments(state, node.trailingComments, propertyIndent, lineEnd)\n }\n state.write(indent + '}')\n } else if (writeComments) {\n if (node.comments != null) {\n state.write(lineEnd)\n formatComments(state, node.comments, propertyIndent, lineEnd)\n if (node.trailingComments != null) {\n formatComments(state, node.trailingComments, propertyIndent, lineEnd)\n }\n state.write(indent + '}')\n } else if (node.trailingComments != null) {\n state.write(lineEnd)\n formatComments(state, node.trailingComments, propertyIndent, lineEnd)\n state.write(indent + '}')\n } else {\n state.write('}')\n }\n } else {\n state.write('}')\n }\n state.indentLevel--\n },\n Property(node, state) {\n if (node.method || node.kind[0] !== 'i') {\n // Either a method or of kind `set` or `get` (not `init`)\n this.MethodDefinition(node, state)\n } else {\n if (!node.shorthand) {\n if (node.computed) {\n state.write('[')\n this[node.key.type](node.key, state)\n state.write(']')\n } else {\n this[node.key.type](node.key, state)\n }\n state.write(': ')\n }\n this[node.value.type](node.value, state)\n }\n },\n ObjectPattern(node, state) {\n state.write('{')\n if (node.properties.length > 0) {\n const { properties } = node,\n { length } = properties\n for (let i = 0; ; ) {\n this[properties[i].type](properties[i], state)\n if (++i < length) {\n state.write(', ')\n } else {\n break\n }\n }\n }\n state.write('}')\n },\n SequenceExpression(node, state) {\n formatSequence(state, node.expressions)\n },\n UnaryExpression(node, state) {\n if (node.prefix) {\n state.write(node.operator)\n if (node.operator.length > 1) {\n state.write(' ')\n }\n if (\n EXPRESSIONS_PRECEDENCE[node.argument.type] <\n EXPRESSIONS_PRECEDENCE.UnaryExpression\n ) {\n state.write('(')\n this[node.argument.type](node.argument, state)\n state.write(')')\n } else {\n this[node.argument.type](node.argument, state)\n }\n } else {\n // FIXME: This case never occurs\n this[node.argument.type](node.argument, state)\n state.write(node.operator)\n }\n },\n UpdateExpression(node, state) {\n // Always applied to identifiers or members, no parenthesis check needed\n if (node.prefix) {\n state.write(node.operator)\n this[node.argument.type](node.argument, state)\n } else {\n this[node.argument.type](node.argument, state)\n state.write(node.operator)\n }\n },\n AssignmentExpression(node, state) {\n this[node.left.type](node.left, state)\n state.write(' ' + node.operator + ' ')\n this[node.right.type](node.right, state)\n },\n AssignmentPattern(node, state) {\n this[node.left.type](node.left, state)\n state.write(' = ')\n this[node.right.type](node.right, state)\n },\n BinaryExpression: (BinaryExpression = function(node, state) {\n const isIn = node.operator === 'in'\n if (isIn) {\n // Avoids confusion in `for` loops initializers\n state.write('(')\n }\n formatBinaryExpressionPart(state, node.left, node, false)\n state.write(' ' + node.operator + ' ')\n formatBinaryExpressionPart(state, node.right, node, true)\n if (isIn) {\n state.write(')')\n }\n }),\n LogicalExpression: BinaryExpression,\n ConditionalExpression(node, state) {\n if (\n EXPRESSIONS_PRECEDENCE[node.test.type] >\n EXPRESSIONS_PRECEDENCE.ConditionalExpression\n ) {\n this[node.test.type](node.test, state)\n } else {\n state.write('(')\n this[node.test.type](node.test, state)\n state.write(')')\n }\n state.write(' ? ')\n this[node.consequent.type](node.consequent, state)\n state.write(' : ')\n this[node.alternate.type](node.alternate, state)\n },\n NewExpression(node, state) {\n state.write('new ')\n if (\n EXPRESSIONS_PRECEDENCE[node.callee.type] <\n EXPRESSIONS_PRECEDENCE.CallExpression ||\n hasCallExpression(node.callee)\n ) {\n state.write('(')\n this[node.callee.type](node.callee, state)\n state.write(')')\n } else {\n this[node.callee.type](node.callee, state)\n }\n formatSequence(state, node['arguments'])\n },\n CallExpression(node, state) {\n if (\n EXPRESSIONS_PRECEDENCE[node.callee.type] <\n EXPRESSIONS_PRECEDENCE.CallExpression\n ) {\n state.write('(')\n this[node.callee.type](node.callee, state)\n state.write(')')\n } else {\n this[node.callee.type](node.callee, state)\n }\n formatSequence(state, node['arguments'])\n },\n MemberExpression(node, state) {\n if (\n EXPRESSIONS_PRECEDENCE[node.object.type] <\n EXPRESSIONS_PRECEDENCE.MemberExpression\n ) {\n state.write('(')\n this[node.object.type](node.object, state)\n state.write(')')\n } else {\n this[node.object.type](node.object, state)\n }\n if (node.computed) {\n state.write('[')\n this[node.property.type](node.property, state)\n state.write(']')\n } else {\n state.write('.')\n this[node.property.type](node.property, state)\n }\n },\n MetaProperty(node, state) {\n state.write(node.meta.name + '.' + node.property.name, node)\n },\n Identifier(node, state) {\n state.write(node.name, node)\n },\n Literal(node, state) {\n if (node.raw != null) {\n state.write(node.raw, node)\n } else if (node.regex != null) {\n this.RegExpLiteral(node, state)\n } else {\n state.write(stringify(node.value), node)\n }\n },\n RegExpLiteral(node, state) {\n const { regex } = node\n state.write(`/${regex.pattern}/${regex.flags}`, node)\n },\n}\n\nconst EMPTY_OBJECT = {}\n\nclass State {\n constructor(options) {\n const setup = options == null ? EMPTY_OBJECT : options\n this.output = ''\n // Functional options\n if (setup.output != null) {\n this.output = setup.output\n this.write = this.writeToStream\n } else {\n this.output = ''\n }\n this.generator = setup.generator != null ? setup.generator : baseGenerator\n // Formating setup\n this.indent = setup.indent != null ? setup.indent : ' '\n this.lineEnd = setup.lineEnd != null ? setup.lineEnd : '\\n'\n this.indentLevel =\n setup.startingIndentLevel != null ? setup.startingIndentLevel : 0\n this.writeComments = setup.comments ? setup.comments : false\n // Source map\n if (setup.sourceMap != null) {\n this.write =\n setup.output == null ? this.writeAndMap : this.writeToStreamAndMap\n this.sourceMap = setup.sourceMap\n this.line = 1\n this.column = 0\n this.lineEndSize = this.lineEnd.split('\\n').length - 1\n this.mapping = {\n original: null,\n generated: this,\n name: undefined,\n source: setup.sourceMap.file || setup.sourceMap._file,\n }\n }\n }\n\n write(code) {\n this.output += code\n }\n\n writeToStream(code) {\n this.output.write(code)\n }\n\n writeAndMap(code, node) {\n this.output += code\n this.map(code, node)\n }\n\n writeToStreamAndMap(code, node) {\n this.output.write(code)\n this.map(code, node)\n }\n\n map(code, node) {\n if (node != null && node.loc != null) {\n const { mapping } = this\n mapping.original = node.loc.start\n mapping.name = node.name\n this.sourceMap.addMapping(mapping)\n }\n if (code.length > 0) {\n if (this.lineEndSize > 0) {\n if (code.endsWith(this.lineEnd)) {\n this.line += this.lineEndSize\n this.column = 0\n } else if (code[code.length - 1] === '\\n') {\n // Case of inline comment\n this.line++\n this.column = 0\n } else {\n this.column += code.length\n }\n } else {\n if (code[code.length - 1] === '\\n') {\n // Case of inline comment\n this.line++\n this.column = 0\n } else {\n this.column += code.length\n }\n }\n }\n }\n\n toString() {\n return this.output\n }\n}\n\nexport function generate(node, options) {\n /*\n Returns a string representing the rendered code of the provided AST `node`.\n The `options` are:\n\n - `indent`: string to use for indentation (defaults to `␣␣`)\n - `lineEnd`: string to use for line endings (defaults to `\\n`)\n - `startingIndentLevel`: indent level to start from (defaults to `0`)\n - `comments`: generate comments if `true` (defaults to `false`)\n - `output`: output stream to write the rendered code to (defaults to `null`)\n - `generator`: custom code generator (defaults to `baseGenerator`)\n */\n const state = new State(options)\n // Travel through the AST node and generate the code\n state.generator[node.type](node, state)\n return state.output\n}\n"]} \ No newline at end of file diff --git a/src/astring.js b/src/astring.js index 84f930ca..b3400c17 100644 --- a/src/astring.js +++ b/src/astring.js @@ -113,7 +113,13 @@ function expressionNeedsParenthesis(node, parentNode, isRightHand) { const parentNodePrecedence = EXPRESSIONS_PRECEDENCE[parentNode.type] if (nodePrecedence !== parentNodePrecedence) { // Different node types - return nodePrecedence < parentNodePrecedence + return ( + (!isRightHand && + nodePrecedence === 15 && + parentNodePrecedence === 14 && + parentNode.operator === '**') || + nodePrecedence < parentNodePrecedence + ) } if (nodePrecedence !== 13 && nodePrecedence !== 14) { // Not a `LogicalExpression` or `BinaryExpression` @@ -843,17 +849,16 @@ export const baseGenerator = { this[node.right.type](node.right, state) }, BinaryExpression: (BinaryExpression = function(node, state) { - if (node.operator === 'in') { + const isIn = node.operator === 'in' + if (isIn) { // Avoids confusion in `for` loops initializers state.write('(') - formatBinaryExpressionPart(state, node.left, node, false) - state.write(' ' + node.operator + ' ') - formatBinaryExpressionPart(state, node.right, node, true) + } + formatBinaryExpressionPart(state, node.left, node, false) + state.write(' ' + node.operator + ' ') + formatBinaryExpressionPart(state, node.right, node, true) + if (isIn) { state.write(')') - } else { - formatBinaryExpressionPart(state, node.left, node, false) - state.write(' ' + node.operator + ' ') - formatBinaryExpressionPart(state, node.right, node, true) } }), LogicalExpression: BinaryExpression, diff --git a/src/tests/fixtures/syntax/precedence.js b/src/tests/fixtures/syntax/precedence.js index 60aec560..08312f35 100644 --- a/src/tests/fixtures/syntax/precedence.js +++ b/src/tests/fixtures/syntax/precedence.js @@ -24,6 +24,8 @@ var r = (/ab+c/i).exec('abc'); a = b ** 2 * 3; c = (d ** 2) ** 3; e = f ** 2 ** 3; +e = (+2) ** 3; +e = 2 ** +3; f = a + (b = 3); g = 1 && (() => {}); g = (() => {}) && 1; diff --git a/src/tests/index.js b/src/tests/index.js index 2ec3bc4f..913f287b 100644 --- a/src/tests/index.js +++ b/src/tests/index.js @@ -39,7 +39,12 @@ test('Syntax check', assert => { files.forEach(filename => { const code = readFile(path.join(dirname, filename)) const ast = parse(code, options) - assert.is(generate(ast), code, filename.substring(0, filename.length - 3)) + assert.is( + generate(ast), + code, + filename.substring(0, filename.length - 3), + 'Generates code with the expected format', + ) }) }) @@ -60,6 +65,7 @@ test('Tree comparison', assert => { formattedAst, ast, filename.substring(0, filename.length - 3), + 'Generates code with the same meaning', ) }) })