This repository has been archived on 2023-03-25. You can view files and clone it, but cannot push or open issues or pull requests.
mightyscape-1.1-deprecated/extensions/fablabchemnitz/papercraft/openjscad/node_modules/astring/dist/astring.min.js

3 lines
15 KiB
JavaScript

(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<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,c.key,c)}function d(a,b,d){return b&&c(a.prototype,b),d&&c(a,d),a}function e(a,b){var c=a.generator;if(a.write("("),null!=b&&0<b.length){c[b[0].type](b[0],a);for(var d,e=b.length,f=1;f<e;f++)d=b[f],a.write(", "),c[d.type](d,a)}a.write(")")}function f(a,b,c){var d=w[a.type];if(d===17)return!0;var e=w[b.type];return d===e?(13===d||14===d)&&("**"===a.operator&&"**"===b.operator?!c:c?u[a.operator]<=u[b.operator]:u[a.operator]<u[b.operator]):!c&&15===d&&14===e&&"**"===b.operator||d<e}function g(a,b,c,d){var e=a.generator;f(b,c,d)?(a.write("("),e[b.type](b,a),a.write(")")):e[b.type](b,a)}function h(a,b,c,d){var e=b.split("\n"),f=e.length-1;if(a.write(e[0].trim()),0<f){a.write(d);for(var g=1;g<f;g++)a.write(c+e[g].trim()+d);a.write(c+e[f].trim())}}function j(a,b,c,d){for(var e,f=b.length,g=0;g<f;g++)e=b[g],a.write(c),"L"===e.type[0]?a.write("// "+e.value.trim()+"\n"):(a.write("/*"),h(a,e.value,c,d),a.write("*/"+d))}function k(a){for(var d=a;null!=d;){var b=d,c=b.type;if("C"===c[0]&&"a"===c[1])return!0;if("M"===c[0]&&"e"===c[1]&&"m"===c[2])d=d.object;else return!1}}function l(a,b){var c=a.generator,d=b.declarations;a.write(b.kind+" ");var e=d.length;if(0<e){c.VariableDeclarator(d[0],a);for(var f=1;f<e;f++)a.write(", "),c.VariableDeclarator(d[f],a)}}Object.defineProperty(a,"__esModule",{value:!0}),a.generate=function(a,b){var c=new z(b);return c.generator[a.type](a,c),c.output},a.baseGenerator=void 0;var n=JSON.stringify;if(!m.repeat)throw new Error("String.prototype.repeat is undefined, see https://github.com/davidbonnet/astring#installation");if(!m.endsWith)throw new Error("String.prototype.endsWith is undefined, see https://github.com/davidbonnet/astring#installation");var o,p,q,r,s,t,u={"||":3,"&&":4,"|":5,"^":6,"&":7,"==":8,"!=":8,"===":8,"!==":8,"<":9,">":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<h;k++)f=g[k],e&&null!=f.comments&&j(b,f.comments,c,d),b.write(c),this[f.type](f,b),b.write(d);e&&null!=a.trailingComments&&j(b,a.trailingComments,c,d)},BlockStatement:t=function(a,b){var c=b.indent.repeat(b.indentLevel++),d=b.lineEnd,e=b.writeComments,f=c+b.indent;b.write("{");var g=a.body;if(null!=g&&0<g.length){b.write(d),e&&null!=a.comments&&j(b,a.comments,f,d);for(var h,k=g.length,l=0;l<k;l++)h=g[l],e&&null!=h.comments&&j(b,h.comments,f,d),b.write(f),this[h.type](h,b),b.write(d);b.write(c)}else e&&null!=a.comments&&(b.write(d),j(b,a.comments,f,d),b.write(c));e&&null!=a.trailingComments&&j(b,a.trailingComments,f,d),b.write("}"),b.indentLevel--},ClassBody:t,EmptyStatement:function EmptyStatement(a,b){b.write(";")},ExpressionStatement:function ExpressionStatement(a,b){var c=w[a.expression.type];c===v||3===c&&"O"===a.expression.left.type[0]?(b.write("("),this[a.expression.type](a.expression,b),b.write(")")):this[a.expression.type](a.expression,b),b.write(";")},IfStatement:function IfStatement(a,b){b.write("if ("),this[a.test.type](a.test,b),b.write(") "),this[a.consequent.type](a.consequent,b),null!=a.alternate&&(b.write(" else "),this[a.alternate.type](a.alternate,b))},LabeledStatement:function LabeledStatement(a,b){this[a.label.type](a.label,b),b.write(": "),this[a.body.type](a.body,b)},BreakStatement:function BreakStatement(a,b){b.write("break"),null!=a.label&&(b.write(" "),this[a.label.type](a.label,b)),b.write(";")},ContinueStatement:function ContinueStatement(a,b){b.write("continue"),null!=a.label&&(b.write(" "),this[a.label.type](a.label,b)),b.write(";")},WithStatement:function WithStatement(a,b){b.write("with ("),this[a.object.type](a.object,b),b.write(") "),this[a.body.type](a.body,b)},SwitchStatement:function SwitchStatement(a,b){var c=b.indent.repeat(b.indentLevel++),d=b.lineEnd,e=b.writeComments;b.indentLevel++;var f=c+b.indent,g=f+b.indent;b.write("switch ("),this[a.discriminant.type](a.discriminant,b),b.write(") {"+d);for(var h,k=a.cases,l=k.length,m=0;m<l;m++){h=k[m],e&&null!=h.comments&&j(b,h.comments,f,d),h.test?(b.write(f+"case "),this[h.test.type](h.test,b),b.write(":"+d)):b.write(f+"default:"+d);for(var n,o=h.consequent,p=o.length,q=0;q<p;q++)n=o[q],e&&null!=n.comments&&j(b,n.comments,g,d),b.write(g),this[n.type](n,b),b.write(d)}b.indentLevel-=2,b.write(c+"}")},ReturnStatement:function ReturnStatement(a,b){b.write("return"),a.argument&&(b.write(" "),this[a.argument.type](a.argument,b)),b.write(";")},ThrowStatement:function ThrowStatement(a,b){b.write("throw "),this[a.argument.type](a.argument,b),b.write(";")},TryStatement:function TryStatement(a,b){if(b.write("try "),this[a.block.type](a.block,b),a.handler){var c=a.handler;null==c.param?b.write(" catch "):(b.write(" catch ("),this[c.param.type](c.param,b),b.write(") ")),this[c.body.type](c.body,b)}a.finalizer&&(b.write(" finally "),this[a.finalizer.type](a.finalizer,b))},WhileStatement:function WhileStatement(a,b){b.write("while ("),this[a.test.type](a.test,b),b.write(") "),this[a.body.type](a.body,b)},DoWhileStatement:function DoWhileStatement(a,b){b.write("do "),this[a.body.type](a.body,b),b.write(" while ("),this[a.test.type](a.test,b),b.write(");")},ForStatement:function ForStatement(a,b){if(b.write("for ("),null!=a.init){var c=a.init;"V"===c.type[0]?l(b,c):this[c.type](c,b)}b.write("; "),a.test&&this[a.test.type](a.test,b),b.write("; "),a.update&&this[a.update.type](a.update,b),b.write(") "),this[a.body.type](a.body,b)},ForInStatement:o=function(a,b){b.write("for ".concat(a["await"]?"await ":"","("));var c=a.left;"V"===c.type[0]?l(b,c):this[c.type](c,b),b.write("I"===a.type[3]?" in ":" of "),this[a.right.type](a.right,b),b.write(") "),this[a.body.type](a.body,b)},ForOfStatement:o,DebuggerStatement:function DebuggerStatement(a,b){b.write("debugger;"+b.lineEnd)},FunctionDeclaration:p=function(a,b){b.write((a.async?"async ":"")+(a.generator?"function* ":"function ")+(a.id?a.id.name:""),a),e(b,a.params),b.write(" "),this[a.body.type](a.body,b)},FunctionExpression:p,VariableDeclaration:function VariableDeclaration(a,b){l(b,a),b.write(";")},VariableDeclarator:function VariableDeclarator(a,b){this[a.id.type](a.id,b),null!=a.init&&(b.write(" = "),this[a.init.type](a.init,b))},ClassDeclaration:function ClassDeclaration(a,b){b.write("class "+(a.id?"".concat(a.id.name," "):""),a),a.superClass&&(b.write("extends "),this[a.superClass.type](a.superClass,b),b.write(" ")),this.ClassBody(a.body,b)},ImportDeclaration:function ImportDeclaration(a,b){b.write("import ");var c=a.specifiers,d=c.length,e=0;if(0<d){for(;e<d;){0<e&&b.write(", ");var f=c[e],g=f.type[6];if("D"===g)b.write(f.local.name,f),e++;else if("N"===g)b.write("* as "+f.local.name,f),e++;else break}if(e<d){for(b.write("{");;){var h=c[e],j=h.imported.name;if(b.write(j,h),j!==h.local.name&&b.write(" as "+h.local.name),++e<d)b.write(", ");else break}b.write("}")}b.write(" from ")}this.Literal(a.source,b),b.write(";")},ExportDefaultDeclaration:function ExportDefaultDeclaration(a,b){b.write("export default "),this[a.declaration.type](a.declaration,b),w[a.declaration.type]&&"F"!==a.declaration.type[0]&&b.write(";")},ExportNamedDeclaration:function ExportNamedDeclaration(a,b){if(b.write("export "),a.declaration)this[a.declaration.type](a.declaration,b);else{b.write("{");var c=a.specifiers,d=c.length;if(0<d)for(var g=0;;){var e=c[g],f=e.local.name;if(b.write(f,e),f!==e.exported.name&&b.write(" as "+e.exported.name),++g<d)b.write(", ");else break}b.write("}"),a.source&&(b.write(" from "),this.Literal(a.source,b)),b.write(";")}},ExportAllDeclaration:function ExportAllDeclaration(a,b){b.write("export * from "),this.Literal(a.source,b),b.write(";")},MethodDefinition:function MethodDefinition(a,b){a["static"]&&b.write("static ");var c=a.kind[0];("g"===c||"s"===c)&&b.write(a.kind+" "),a.value.async&&b.write("async "),a.value.generator&&b.write("*"),a.computed?(b.write("["),this[a.key.type](a.key,b),b.write("]")):this[a.key.type](a.key,b),e(b,a.value.params),b.write(" "),this[a.value.body.type](a.value.body,b)},ClassExpression:function ClassExpression(a,b){this.ClassDeclaration(a,b)},ArrowFunctionExpression:function ArrowFunctionExpression(a,b){b.write(a.async?"async ":"",a);var c=a.params;null!=c&&(1===c.length&&"I"===c[0].type[0]?b.write(c[0].name,c[0]):e(b,a.params)),b.write(" => "),"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;g<f;g++)e=d[g],this.TemplateElement(c[g],b),b.write("${"),this[e.type](e,b),b.write("}");b.write(c[c.length-1].value.raw),b.write("`")},TemplateElement:function TemplateElement(a,b){b.write(a.value.raw)},TaggedTemplateExpression:function TaggedTemplateExpression(a,b){this[a.tag.type](a.tag,b),this[a.quasi.type](a.quasi,b)},ArrayExpression:s=function(a,b){if(b.write("["),0<a.elements.length)for(var c,d=a.elements,e=d.length,f=0;;)if(c=d[f],null!=c&&this[c.type](c,b),++f<e)b.write(", ");else{null==c&&b.write(", ");break}b.write("]")},ArrayPattern:s,ObjectExpression:function ObjectExpression(a,b){var c=b.indent.repeat(b.indentLevel++),d=b.lineEnd,e=b.writeComments,f=c+b.indent;if(b.write("{"),0<a.properties.length){b.write(d),e&&null!=a.comments&&j(b,a.comments,f,d);for(var g,h=a.properties,k=h.length,l=0;;)if(g=h[l],e&&null!=g.comments&&j(b,g.comments,f,d),b.write(f),this[g.type](g,b),++l<k)b.write(","+d);else break;b.write(d),e&&null!=a.trailingComments&&j(b,a.trailingComments,f,d),b.write(c+"}")}else e?null==a.comments?null==a.trailingComments?b.write("}"):(b.write(d),j(b,a.trailingComments,f,d),b.write(c+"}")):(b.write(d),j(b,a.comments,f,d),null!=a.trailingComments&&j(b,a.trailingComments,f,d),b.write(c+"}")):b.write("}");b.indentLevel--},Property:function Property(a,b){a.method||"i"!==a.kind[0]?this.MethodDefinition(a,b):(!a.shorthand&&(a.computed?(b.write("["),this[a.key.type](a.key,b),b.write("]")):this[a.key.type](a.key,b),b.write(": ")),this[a.value.type](a.value,b))},ObjectPattern:function ObjectPattern(a,b){if(b.write("{"),0<a.properties.length)for(var c=a.properties,d=c.length,e=0;;)if(this[c[e].type](c[e],b),++e<d)b.write(", ");else break;b.write("}")},SequenceExpression:function SequenceExpression(a,b){e(b,a.expressions)},UnaryExpression:function UnaryExpression(a,b){a.prefix?(b.write(a.operator),1<a.operator.length&&b.write(" "),w[a.argument.type]<w.UnaryExpression?(b.write("("),this[a.argument.type](a.argument,b),b.write(")")):this[a.argument.type](a.argument,b)):(this[a.argument.type](a.argument,b),b.write(a.operator))},UpdateExpression:function UpdateExpression(a,b){a.prefix?(b.write(a.operator),this[a.argument.type](a.argument,b)):(this[a.argument.type](a.argument,b),b.write(a.operator))},AssignmentExpression:function AssignmentExpression(a,b){this[a.left.type](a.left,b),b.write(" "+a.operator+" "),this[a.right.type](a.right,b)},AssignmentPattern:function AssignmentPattern(a,b){this[a.left.type](a.left,b),b.write(" = "),this[a.right.type](a.right,b)},BinaryExpression:r=function(a,b){var c="in"===a.operator;c&&b.write("("),g(b,a.left,a,!1),b.write(" "+a.operator+" "),g(b,a.right,a,!0),c&&b.write(")")},LogicalExpression:r,ConditionalExpression:function ConditionalExpression(a,b){w[a.test.type]>w.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]<w.CallExpression||k(a.callee)?(b.write("("),this[a.callee.type](a.callee,b),b.write(")")):this[a.callee.type](a.callee,b),e(b,a.arguments)},CallExpression:function CallExpression(a,b){w[a.callee.type]<w.CallExpression?(b.write("("),this[a.callee.type](a.callee,b),b.write(")")):this[a.callee.type](a.callee,b),e(b,a.arguments)},MemberExpression:function MemberExpression(a,b){w[a.object.type]<w.MemberExpression?(b.write("("),this[a.object.type](a.object,b),b.write(")")):this[a.object.type](a.object,b),a.computed?(b.write("["),this[a.property.type](a.property,b),b.write("]")):(b.write("."),this[a.property.type](a.property,b))},MetaProperty:function MetaProperty(a,b){b.write(a.meta.name+"."+a.property.name,a)},Identifier:function Identifier(a,b){b.write(a.name,a)},Literal:function Literal(a,b){null==a.raw?null==a.regex?b.write(n(a.value),a):this.RegExpLiteral(a,b):b.write(a.raw,a)},RegExpLiteral:function RegExpLiteral(a,b){var c=a.regex;b.write("/".concat(c.pattern,"/").concat(c.flags),a)}};a.baseGenerator=x;var y={},z=function(){function a(c){b(this,a);var d=null==c?y:c;this.output="",null==d.output?this.output="":(this.output=d.output,this.write=this.writeToStream),this.generator=null==d.generator?x:d.generator,this.indent=null==d.indent?" ":d.indent,this.lineEnd=null==d.lineEnd?"\n":d.lineEnd,this.indentLevel=null==d.startingIndentLevel?0:d.startingIndentLevel,this.writeComments=!!d.comments&&d.comments,null!=d.sourceMap&&(this.write=null==d.output?this.writeAndMap:this.writeToStreamAndMap,this.sourceMap=d.sourceMap,this.line=1,this.column=0,this.lineEndSize=this.lineEnd.split("\n").length-1,this.mapping={original:null,generated:this,name:void 0,source:d.sourceMap.file||d.sourceMap._file})}return d(a,[{key:"write",value:function write(a){this.output+=a}},{key:"writeToStream",value:function writeToStream(a){this.output.write(a)}},{key:"writeAndMap",value:function writeAndMap(a,b){this.output+=a,this.map(a,b)}},{key:"writeToStreamAndMap",value:function writeToStreamAndMap(a,b){this.output.write(a),this.map(a,b)}},{key:"map",value:function map(a,b){if(null!=b&&null!=b.loc){var c=this.mapping;c.original=b.loc.start,c.name=b.name,this.sourceMap.addMapping(c)}0<a.length&&(0<this.lineEndSize?a.endsWith(this.lineEnd)?(this.line+=this.lineEndSize,this.column=0):"\n"===a[a.length-1]?(this.line++,this.column=0):this.column+=a.length:"\n"===a[a.length-1]?(this.line++,this.column=0):this.column+=a.length)}},{key:"toString",value:function toString(){return this.output}}]),a}()});
//# sourceMappingURL=astring.min.js.map