miniscript-languageserver 1.3.4 → 1.3.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/index.js +1 -1
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -164,7 +164,7 @@ ${e}`;for(let a=0;a<this.details.length;++a){let u=a+1;o=`${o}
164
164
  `,ref:{start:i.start,end:i.start}});for(let o of i.body){let a=this.tokens.length;this.process(o),a<this.tokens.length&&this.tokens.push({type:$.TokenType.EndOfLine,value:`
165
165
  `,ref:{start:o.end,end:o.end}})}},ContinueStatement:function(i,s){this.tokens.push({type:$.TokenType.Text,value:"continue",ref:i})},BreakStatement:function(i,s){this.tokens.push({type:$.TokenType.Text,value:"break",ref:i})},CallStatement:function(i,s){this.process(i.expression)},FeatureInjectExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:$.TokenType.Text,value:`#inject "${i.path}";`,ref:i});return}if(this.currentDependency===null){this.tokens.push({type:$.TokenType.Text,value:`#inject "${i.path}";`,ref:i});return}let o=this.currentDependency.injections.get(i.path);if(o==null){this.tokens.push({type:$.TokenType.Text,value:"null",ref:i});return}this.tokens.push({type:$.TokenType.Text,value:`"${o.replace(/"/g,'""')}"`,ref:i})},FeatureImportExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:$.TokenType.Text,value:"#import ",ref:i}),this.process(i.name),this.tokens.push({type:$.TokenType.Text,value:` from "${i.path}";`,ref:i});return}if(!i.chunk){this.tokens.push({type:$.TokenType.Text,value:"#import ",ref:i}),this.process(i.name),this.tokens.push({type:$.TokenType.Text,value:` from "${i.path}";`,ref:i});return}if(this.process(i.name),this.disableNamespacesOptimization){this.tokens.push({type:$.TokenType.Text,value:`=__REQUIRE("${i.namespace}")`,ref:i});return}let o=this.transformer.context.variables.get("__REQUIRE");this.tokens.push({type:$.TokenType.Text,value:`=${o}("${i.namespace}")`,ref:i})},FeatureIncludeExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:$.TokenType.Text,value:`#include "${i.path}";`,ref:i});return}if(!i.chunk){this.tokens.push({type:$.TokenType.Text,value:`#include "${i.path}";`,ref:i});return}this.process(i.chunk)},ListConstructorExpression:function(i,s){this.tokens.push({type:$.TokenType.Text,value:"[",ref:i});for(let o=0;o<i.fields.length;o++){let a=i.fields[o];this.process(a),o!==i.fields.length-1&&this.tokens.push({type:$.TokenType.Text,value:",",ref:a})}this.tokens.push({type:$.TokenType.Text,value:"]",ref:i})},ListValue:function(i,s){this.process(i.value)},BooleanLiteral:function(i,s){if(this.disableLiteralsOptimization){this.tokens.push({type:$.TokenType.Text,value:(i.negated?"-":"")+i.raw.toString(),ref:i});return}let o=this.transformer.context.literals.get(i);if(!this.isWithinArgument&&o!==null&&o.namespace!==null){this.tokens.push({type:$.TokenType.Text,value:o.namespace,ref:i});return}this.tokens.push({type:$.TokenType.Text,value:(i.negated?"-":"")+i.raw.toString(),ref:i})},EmptyExpression:function(i,s){this.tokens.push({type:$.TokenType.Text,value:"",ref:i})},IsaExpression:function(i,s){this.process(i.left),this.tokens.push({type:$.TokenType.Text,value:" "+i.operator+" ",ref:i}),this.process(i.right)},LogicalExpression:function(i,s){this.process(i.left),this.tokens.push({type:$.TokenType.Text,value:" "+i.operator+" ",ref:i}),this.process(i.right)},BinaryExpression:function(i,s){if(i.operator==="|"){this.tokens.push({type:$.TokenType.Text,value:"bitOr(",ref:i}),this.process(i.left),this.tokens.push({type:$.TokenType.Text,value:",",ref:i}),this.process(i.right),this.tokens.push({type:$.TokenType.Text,value:")",ref:i});return}else if(i.operator==="&"){this.tokens.push({type:$.TokenType.Text,value:"bitAnd(",ref:i}),this.process(i.left),this.tokens.push({type:$.TokenType.Text,value:",",ref:i}),this.process(i.right),this.tokens.push({type:$.TokenType.Text,value:")",ref:i});return}else if(i.operator==="<<"||i.operator===">>"||i.operator===">>>")throw new Error("Operators in binary expression are not supported");this.process(i.left),this.tokens.push({type:$.TokenType.Text,value:i.operator,ref:i}),this.process(i.right)},BinaryNegatedExpression:function(i,s){this.tokens.push({type:$.TokenType.Text,value:i.operator,ref:i}),this.process(i.argument)},ComparisonGroupExpression:function(i,s){this.process(i.expressions[0]);for(let o=0;o<i.operators.length;o++)this.tokens.push({type:$.TokenType.Text,value:i.operators[o],ref:i}),this.process(i.expressions[o+1])},Chunk:function(i,s){for(let o of i.body){let a=this.tokens.length;this.process(o),a<this.tokens.length&&this.tokens.push({type:$.TokenType.EndOfLine,value:`
166
166
  `,ref:{start:o.end,end:o.end}})}}},this.disableLiteralsOptimization=(n=e.buildOptions.disableLiteralsOptimization)!==null&&n!==void 0?n:!1,this.disableNamespacesOptimization=(r=e.buildOptions.disableNamespacesOptimization)!==null&&r!==void 0?r:!1,this.isWithinArgument=!1}transform(e,n){this._tokens=[],this._currentDependency=n,this.process(e);let r="";for(let i=0;i<this.tokens.length-1;i++){let s=this.tokens[i];if(s.type===$.TokenType.Text||s.type===$.TokenType.Comment)r+=s.value;else if(s.type===$.TokenType.EndOfLine)r+=`
167
- `;else throw new Error("Unknown token type!")}return r}generateOptimizations(){let e=this.transformer.context,n=Array.from(e.literals.getMapping().values()).filter(s=>s.namespace!=null),r=e.variables.get("globals"),i=[];return(this.disableLiteralsOptimization||n.length>0)&&i.push(`globals.${r}=globals`),n.length>0&&i.push(...n.map(s=>`${r}.${s.namespace}=${s.literal.raw}`)),i}};wd.UglifyFactory=Zy});var Ed=g(ls=>{"use strict";Object.defineProperty(ls,"__esModule",{value:!0});ls.getFactory=ls.BuildType=void 0;var wN=Xy(),EN=Jy(),AN=eb(),Za;(function(t){t[t.DEFAULT=0]="DEFAULT",t[t.UGLIFY=1]="UGLIFY",t[t.BEAUTIFY=2]="BEAUTIFY"})(Za=ls.BuildType||(ls.BuildType={}));var ON={[Za.DEFAULT]:EN.DefaultFactory,[Za.UGLIFY]:AN.UglifyFactory,[Za.BEAUTIFY]:wN.BeautifyFactory};function CN(t=Za.DEFAULT){let e=ON[t];if(!e)throw new Error("Unknown build type.");return e}ls.getFactory=CN});var tb=g(($E,Ad)=>{(function(t){"use strict";function e(v,F){var C=(v&65535)+(F&65535),V=(v>>16)+(F>>16)+(C>>16);return V<<16|C&65535}function n(v,F){return v<<F|v>>>32-F}function r(v,F,C,V,ae,ge){return e(n(e(e(F,v),e(V,ge)),ae),C)}function i(v,F,C,V,ae,ge,G){return r(F&C|~F&V,v,F,ae,ge,G)}function s(v,F,C,V,ae,ge,G){return r(F&V|C&~V,v,F,ae,ge,G)}function o(v,F,C,V,ae,ge,G){return r(F^C^V,v,F,ae,ge,G)}function a(v,F,C,V,ae,ge,G){return r(C^(F|~V),v,F,ae,ge,G)}function u(v,F){v[F>>5]|=128<<F%32,v[(F+64>>>9<<4)+14]=F;var C,V,ae,ge,G,A=1732584193,P=-271733879,I=-1732584194,j=271733878;for(C=0;C<v.length;C+=16)V=A,ae=P,ge=I,G=j,A=i(A,P,I,j,v[C],7,-680876936),j=i(j,A,P,I,v[C+1],12,-389564586),I=i(I,j,A,P,v[C+2],17,606105819),P=i(P,I,j,A,v[C+3],22,-1044525330),A=i(A,P,I,j,v[C+4],7,-176418897),j=i(j,A,P,I,v[C+5],12,1200080426),I=i(I,j,A,P,v[C+6],17,-1473231341),P=i(P,I,j,A,v[C+7],22,-45705983),A=i(A,P,I,j,v[C+8],7,1770035416),j=i(j,A,P,I,v[C+9],12,-1958414417),I=i(I,j,A,P,v[C+10],17,-42063),P=i(P,I,j,A,v[C+11],22,-1990404162),A=i(A,P,I,j,v[C+12],7,1804603682),j=i(j,A,P,I,v[C+13],12,-40341101),I=i(I,j,A,P,v[C+14],17,-1502002290),P=i(P,I,j,A,v[C+15],22,1236535329),A=s(A,P,I,j,v[C+1],5,-165796510),j=s(j,A,P,I,v[C+6],9,-1069501632),I=s(I,j,A,P,v[C+11],14,643717713),P=s(P,I,j,A,v[C],20,-373897302),A=s(A,P,I,j,v[C+5],5,-701558691),j=s(j,A,P,I,v[C+10],9,38016083),I=s(I,j,A,P,v[C+15],14,-660478335),P=s(P,I,j,A,v[C+4],20,-405537848),A=s(A,P,I,j,v[C+9],5,568446438),j=s(j,A,P,I,v[C+14],9,-1019803690),I=s(I,j,A,P,v[C+3],14,-187363961),P=s(P,I,j,A,v[C+8],20,1163531501),A=s(A,P,I,j,v[C+13],5,-1444681467),j=s(j,A,P,I,v[C+2],9,-51403784),I=s(I,j,A,P,v[C+7],14,1735328473),P=s(P,I,j,A,v[C+12],20,-1926607734),A=o(A,P,I,j,v[C+5],4,-378558),j=o(j,A,P,I,v[C+8],11,-2022574463),I=o(I,j,A,P,v[C+11],16,1839030562),P=o(P,I,j,A,v[C+14],23,-35309556),A=o(A,P,I,j,v[C+1],4,-1530992060),j=o(j,A,P,I,v[C+4],11,1272893353),I=o(I,j,A,P,v[C+7],16,-155497632),P=o(P,I,j,A,v[C+10],23,-1094730640),A=o(A,P,I,j,v[C+13],4,681279174),j=o(j,A,P,I,v[C],11,-358537222),I=o(I,j,A,P,v[C+3],16,-722521979),P=o(P,I,j,A,v[C+6],23,76029189),A=o(A,P,I,j,v[C+9],4,-640364487),j=o(j,A,P,I,v[C+12],11,-421815835),I=o(I,j,A,P,v[C+15],16,530742520),P=o(P,I,j,A,v[C+2],23,-995338651),A=a(A,P,I,j,v[C],6,-198630844),j=a(j,A,P,I,v[C+7],10,1126891415),I=a(I,j,A,P,v[C+14],15,-1416354905),P=a(P,I,j,A,v[C+5],21,-57434055),A=a(A,P,I,j,v[C+12],6,1700485571),j=a(j,A,P,I,v[C+3],10,-1894986606),I=a(I,j,A,P,v[C+10],15,-1051523),P=a(P,I,j,A,v[C+1],21,-2054922799),A=a(A,P,I,j,v[C+8],6,1873313359),j=a(j,A,P,I,v[C+15],10,-30611744),I=a(I,j,A,P,v[C+6],15,-1560198380),P=a(P,I,j,A,v[C+13],21,1309151649),A=a(A,P,I,j,v[C+4],6,-145523070),j=a(j,A,P,I,v[C+11],10,-1120210379),I=a(I,j,A,P,v[C+2],15,718787259),P=a(P,I,j,A,v[C+9],21,-343485551),A=e(A,V),P=e(P,ae),I=e(I,ge),j=e(j,G);return[A,P,I,j]}function c(v){var F,C="",V=v.length*32;for(F=0;F<V;F+=8)C+=String.fromCharCode(v[F>>5]>>>F%32&255);return C}function l(v){var F,C=[];for(C[(v.length>>2)-1]=void 0,F=0;F<C.length;F+=1)C[F]=0;var V=v.length*8;for(F=0;F<V;F+=8)C[F>>5]|=(v.charCodeAt(F/8)&255)<<F%32;return C}function d(v){return c(u(l(v),v.length*8))}function p(v,F){var C,V=l(v),ae=[],ge=[],G;for(ae[15]=ge[15]=void 0,V.length>16&&(V=u(V,v.length*8)),C=0;C<16;C+=1)ae[C]=V[C]^909522486,ge[C]=V[C]^1549556828;return G=u(ae.concat(l(F)),512+F.length*8),c(u(ge.concat(G),640))}function b(v){var F="0123456789abcdef",C="",V,ae;for(ae=0;ae<v.length;ae+=1)V=v.charCodeAt(ae),C+=F.charAt(V>>>4&15)+F.charAt(V&15);return C}function T(v){return unescape(encodeURIComponent(v))}function E(v){return d(T(v))}function L(v){return b(E(v))}function M(v,F){return p(T(v),T(F))}function x(v,F){return b(M(v,F))}function k(v,F,C){return F?C?M(F,v):x(F,v):C?E(v):L(v)}typeof define=="function"&&define.amd?define(function(){return k}):typeof Ad=="object"&&Ad.exports?Ad.exports=k:t.md5=k})($E)});var rb=g(To=>{"use strict";var RN=To&&To.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(To,"__esModule",{value:!0});To.LiteralsMapper=void 0;var DN=RN(tb()),nb=class{constructor(e){let n=this;n.mapping=new Map,n.variableNamespacesGenerator=e}reset(){let e=this;return e.mapping=new Map,e}add(e){let n=this,r=e.raw.toString();if(!n.mapping.has(r))n.mapping.set(r,{literal:e,amount:1,length:r.length,namespace:null});else{let i=n.mapping.get(r),s=i.amount+1,o=i.length+r.length;i.amount=s,i.length=o,o>10&&s>2&&i.namespace==null&&(i.namespace=n.variableNamespacesGenerator.createNamespace((0,DN.default)(r)))}return n}get(e){let n=this,r=e.raw.toString();return n.mapping.has(r)?n.mapping.get(r):null}getMapping(){return this.mapping}};To.LiteralsMapper=nb});var sb=g(Od=>{"use strict";Object.defineProperty(Od,"__esModule",{value:!0});Od.NamespaceGenerator=void 0;var ib=class{constructor(e){let n=this;n.buffer=[0],n.mapping=new Map,n.rmapping=new Map,n.forbidden=e.forbidden||[],n.characters=e.characters||null,n.defaultNamespaces=e.defaultNamespaces||[];for(let r of n.defaultNamespaces)n.createNamespace(r)}exclude(e){let n=this;return Array.isArray(e)?n.forbidden=n.forbidden.concat(e):n.forbidden.push(e),n}setCharset(e){let n=this;return n.characters=e,n}reset(){let e=this;return e.buffer=[0],e.mapping=new Map,e.rmapping=new Map,e}get(e){let n=this.mapping;return n.has(e)?n.get(e):null}increaseBuffer(e){let n=this,r=n.buffer,i=n.characters.length;e==null&&(e=r.length-1);let s=r[e];return s=s+1,r[e]=s,s===i&&(r[e]=0,e===0?r.push(0):n.increaseBuffer(e-1)),n}generateNamespace(){let e=this,n=e.buffer,r=e.characters,i=e.forbidden,s="",o=0,a;for(;o<n.length;)a=n[o],s=s+r[a],o===n.length-1&&e.increaseBuffer(),o=o+1;return i.indexOf(s)!==-1||e.mapping.has(s)?e.generateNamespace():s}createNamespace(e,n=!1){let r=this,i=r.mapping,s=r.rmapping;if(r.forbidden.indexOf(e)!==-1)return e;if(i.has(e)&&!n)return i.get(e);let a=r.generateNamespace();if(i.set(e,a),s.set(a,e),s.has(e)){let u=s.get(e);s.delete(e),a=r.createNamespace(u,!0)}return a}};Od.NamespaceGenerator=ib});var eu=g(ds=>{"use strict";Object.defineProperty(ds,"__esModule",{value:!0});ds.Context=ds.ContextDataProperty=void 0;var PN=rb(),BE=sb(),IN;(function(t){t.ResourceDependencyMap="resourceDependencyMap",t.DependencyCallStack="dependencyCallStack"})(IN=ds.ContextDataProperty||(ds.ContextDataProperty={}));var ob=class{constructor(e){let n=this;n.modules=new BE.NamespaceGenerator({characters:e.modulesCharset}),n.variables=new BE.NamespaceGenerator({characters:e.variablesCharset,defaultNamespaces:["BACKSLASH_CODE","NEW_LINE_OPERATOR","MODULES","EXPORTED","__REQUIRE","MAIN","module","globals"],forbidden:["locals","outer","self","super","string","list","map","number","funcRef",...e.variablesExcluded||[]]}),n.literals=new PN.LiteralsMapper(n.variables),n.data=new Map}createModuleNamespace(e){return this.modules.createNamespace(e)}getOrCreateData(e,n){let r=this;if(r.data.has(e))return r.data.get(e);let i=n();return r.data.set(e,i),i}set(e,n){return this.data.set(e,n),this}get(e){return this.data.get(e)}};ds.Context=ob});var ab=g(tu=>{"use strict";Object.defineProperty(tu,"__esModule",{value:!0});tu.DependencyType=void 0;var MN;(function(t){t[t.Main=0]="Main",t[t.Import=1]="Import",t[t.Include=2]="Include"})(MN=tu.DependencyType||(tu.DependencyType={}))});var Rd=g(Cd=>{"use strict";Object.defineProperty(Cd,"__esModule",{value:!0});Cd.BuildError=void 0;var ub=class extends Error{constructor(e,n){super(e),this.target=n.target,this.range=n.range}};Cd.BuildError=ub});var Pd=g(Dd=>{"use strict";Object.defineProperty(Dd,"__esModule",{value:!0});Dd.fetchNamespaces=void 0;function LN(t){let e=new Set(t.namespaces);return t.scopes.reduce((n,r)=>(r.namespaces.forEach(i=>e.add(i)),n),e),Array.from(e)}Dd.fetchNamespaces=LN});var fb=g(Ei=>{"use strict";var cb=Ei&&Ei.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(l){try{c(r.next(l))}catch(d){o(d)}}function u(l){try{c(r.throw(l))}catch(d){o(d)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((r=r.apply(t,e||[])).next())})},GE=Ei&&Ei.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ei,"__esModule",{value:!0});Ei.Dependency=void 0;var UE=GE(tb()),NN=GE(require("events")),HE=Br(),Id=eu(),lb=ab(),WE=Rd(),qN=Pd(),db=class t extends NN.default{constructor(e){super();let n=this;n.target=e.target,n.id=(0,UE.default)(e.target),n.resourceHandler=e.resourceHandler,n.chunk=e.chunk,n.dependencies=new Set,n.injections=new Map,n.type=e.type||lb.DependencyType.Main,n.context=e.context,n.ref=e.ref;let r=n.context.createModuleNamespace(n.id);n.context.getOrCreateData(Id.ContextDataProperty.ResourceDependencyMap,()=>new Map).set(r,n),n.context.getOrCreateData(Id.ContextDataProperty.DependencyCallStack,()=>[])}getId(){return this.id}getNamespace(){let e=this;return e.context.modules.get(e.id)}resolve(e,n,r){return cb(this,void 0,void 0,function*(){let i=this,s=i.context,{modules:o}=s,a=s.get(Id.ContextDataProperty.ResourceDependencyMap),u=i.resourceHandler,c=yield u.getTargetRelativeTo(i.target,e),l=(0,UE.default)(c),d=o.get(l);if(a.has(d))return a.get(d);if(!(yield u.has(c)))throw new Error("Dependency "+c+" does not exist...");let p=yield u.get(c);i.emit("parse-before",c);try{let T=new HE.Parser(p,{filename:c}).parseChunk(),E=new t({target:c,resourceHandler:u,chunk:T,type:n,context:s,ref:r});return i.emit("parse-after",E),E}catch(b){throw b instanceof WE.BuildError?b:new WE.BuildError(b.message,{target:c,range:b.range})}})}findInjections(){return cb(this,void 0,void 0,function*(){let e=this,{injects:n}=e.chunk,r=new Map;for(let i of n){let s=yield e.resourceHandler.getTargetRelativeTo(e.target,i.path);if(!(yield e.resourceHandler.has(s)))throw new Error("Injection "+s+" does not exist...");let o=yield e.resourceHandler.get(s);r.set(i.path,o)}return e.injections=r,r})}findDependencies(){return cb(this,void 0,void 0,function*(){let e=this,{imports:n,includes:r}=e.chunk,i=e.getNamespace(),s=e.context.get(Id.ContextDataProperty.DependencyCallStack),o=[...(0,qN.fetchNamespaces)(e.chunk)],a=[...e.chunk.literals],u=[];s.push(i);let c=[...n,...r];for(let d of c){let p=d instanceof HE.ASTFeatureIncludeExpression?lb.DependencyType.Include:lb.DependencyType.Import,b=yield e.resolve(d.path,p,d),T=b.getNamespace();if(s.includes(T))throw new Error(`Circular dependency from ${e.target} to ${b.target} detected.`);let E=b.chunk;d.chunk=E,d.namespace=T;let L=yield b.findDependencies();o.push(...L.namespaces),a.push(...L.literals),u.push(b)}yield this.findInjections();let l=new Set(u);return e.dependencies=l,s.pop(),{dependencies:l,namespaces:o,literals:a}})}};Ei.Dependency=db});var Ld=g(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0});Md.Transformer=void 0;var pb=class{get factory(){return this._factory}get buildOptions(){return this._buildOptions}get context(){return this._context}get environmentVariables(){return this._environmentVariables}get resourceHandler(){return this._resourceHandler}constructor({buildOptions:e,factoryConstructor:n,context:r,environmentVariables:i,resourceHandler:s}){let o=this;o._buildOptions=e,o._context=r,o._environmentVariables=i,o._factory=new n(o),o._resourceHandler=s??null}transform(e,n=null){let r=this;if(e.type!=="Chunk")throw new Error("Expects chunk");return r._factory.transform(e,n)}};Md.Transformer=pb});var jd=g(qd=>{"use strict";Object.defineProperty(qd,"__esModule",{value:!0});qd.generateCharsetMap=void 0;function Nd(t,e){let n="";for(;t<=e;)n=n+String.fromCharCode(t),t=t+1;return n}function jN(t=!1){let e=Nd(65,90),n=Nd(97,122),r=Nd(48,57),i="_";return t&&(i=i+Nd(1e3,2e3)),{variables:e+n+i,modules:e+n+r+i}}qd.generateCharsetMap=jN});var gb=g(Ai=>{"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});Ai.MAIN_BOILERPLATE=Ai.MODULE_BOILERPLATE=Ai.HEADER_BOILERPLATE=void 0;var hb=Br();Ai.HEADER_BOILERPLATE=new hb.Parser(`MODULES={}
167
+ `;else throw new Error("Unknown token type!")}return r}generateOptimizations(){let e=this.transformer.context,n=Array.from(e.literals.getMapping().values()).filter(s=>s.namespace!=null),r=e.variables.get("globals"),i=[];return(!this.disableNamespacesOptimization||n.length>0)&&i.push(`globals.${r}=globals`),n.length>0&&i.push(...n.map(s=>`${r}.${s.namespace}=${s.literal.raw}`)),i}};wd.UglifyFactory=Zy});var Ed=g(ls=>{"use strict";Object.defineProperty(ls,"__esModule",{value:!0});ls.getFactory=ls.BuildType=void 0;var wN=Xy(),EN=Jy(),AN=eb(),Za;(function(t){t[t.DEFAULT=0]="DEFAULT",t[t.UGLIFY=1]="UGLIFY",t[t.BEAUTIFY=2]="BEAUTIFY"})(Za=ls.BuildType||(ls.BuildType={}));var ON={[Za.DEFAULT]:EN.DefaultFactory,[Za.UGLIFY]:AN.UglifyFactory,[Za.BEAUTIFY]:wN.BeautifyFactory};function CN(t=Za.DEFAULT){let e=ON[t];if(!e)throw new Error("Unknown build type.");return e}ls.getFactory=CN});var tb=g(($E,Ad)=>{(function(t){"use strict";function e(v,F){var C=(v&65535)+(F&65535),V=(v>>16)+(F>>16)+(C>>16);return V<<16|C&65535}function n(v,F){return v<<F|v>>>32-F}function r(v,F,C,V,ae,ge){return e(n(e(e(F,v),e(V,ge)),ae),C)}function i(v,F,C,V,ae,ge,G){return r(F&C|~F&V,v,F,ae,ge,G)}function s(v,F,C,V,ae,ge,G){return r(F&V|C&~V,v,F,ae,ge,G)}function o(v,F,C,V,ae,ge,G){return r(F^C^V,v,F,ae,ge,G)}function a(v,F,C,V,ae,ge,G){return r(C^(F|~V),v,F,ae,ge,G)}function u(v,F){v[F>>5]|=128<<F%32,v[(F+64>>>9<<4)+14]=F;var C,V,ae,ge,G,A=1732584193,P=-271733879,I=-1732584194,j=271733878;for(C=0;C<v.length;C+=16)V=A,ae=P,ge=I,G=j,A=i(A,P,I,j,v[C],7,-680876936),j=i(j,A,P,I,v[C+1],12,-389564586),I=i(I,j,A,P,v[C+2],17,606105819),P=i(P,I,j,A,v[C+3],22,-1044525330),A=i(A,P,I,j,v[C+4],7,-176418897),j=i(j,A,P,I,v[C+5],12,1200080426),I=i(I,j,A,P,v[C+6],17,-1473231341),P=i(P,I,j,A,v[C+7],22,-45705983),A=i(A,P,I,j,v[C+8],7,1770035416),j=i(j,A,P,I,v[C+9],12,-1958414417),I=i(I,j,A,P,v[C+10],17,-42063),P=i(P,I,j,A,v[C+11],22,-1990404162),A=i(A,P,I,j,v[C+12],7,1804603682),j=i(j,A,P,I,v[C+13],12,-40341101),I=i(I,j,A,P,v[C+14],17,-1502002290),P=i(P,I,j,A,v[C+15],22,1236535329),A=s(A,P,I,j,v[C+1],5,-165796510),j=s(j,A,P,I,v[C+6],9,-1069501632),I=s(I,j,A,P,v[C+11],14,643717713),P=s(P,I,j,A,v[C],20,-373897302),A=s(A,P,I,j,v[C+5],5,-701558691),j=s(j,A,P,I,v[C+10],9,38016083),I=s(I,j,A,P,v[C+15],14,-660478335),P=s(P,I,j,A,v[C+4],20,-405537848),A=s(A,P,I,j,v[C+9],5,568446438),j=s(j,A,P,I,v[C+14],9,-1019803690),I=s(I,j,A,P,v[C+3],14,-187363961),P=s(P,I,j,A,v[C+8],20,1163531501),A=s(A,P,I,j,v[C+13],5,-1444681467),j=s(j,A,P,I,v[C+2],9,-51403784),I=s(I,j,A,P,v[C+7],14,1735328473),P=s(P,I,j,A,v[C+12],20,-1926607734),A=o(A,P,I,j,v[C+5],4,-378558),j=o(j,A,P,I,v[C+8],11,-2022574463),I=o(I,j,A,P,v[C+11],16,1839030562),P=o(P,I,j,A,v[C+14],23,-35309556),A=o(A,P,I,j,v[C+1],4,-1530992060),j=o(j,A,P,I,v[C+4],11,1272893353),I=o(I,j,A,P,v[C+7],16,-155497632),P=o(P,I,j,A,v[C+10],23,-1094730640),A=o(A,P,I,j,v[C+13],4,681279174),j=o(j,A,P,I,v[C],11,-358537222),I=o(I,j,A,P,v[C+3],16,-722521979),P=o(P,I,j,A,v[C+6],23,76029189),A=o(A,P,I,j,v[C+9],4,-640364487),j=o(j,A,P,I,v[C+12],11,-421815835),I=o(I,j,A,P,v[C+15],16,530742520),P=o(P,I,j,A,v[C+2],23,-995338651),A=a(A,P,I,j,v[C],6,-198630844),j=a(j,A,P,I,v[C+7],10,1126891415),I=a(I,j,A,P,v[C+14],15,-1416354905),P=a(P,I,j,A,v[C+5],21,-57434055),A=a(A,P,I,j,v[C+12],6,1700485571),j=a(j,A,P,I,v[C+3],10,-1894986606),I=a(I,j,A,P,v[C+10],15,-1051523),P=a(P,I,j,A,v[C+1],21,-2054922799),A=a(A,P,I,j,v[C+8],6,1873313359),j=a(j,A,P,I,v[C+15],10,-30611744),I=a(I,j,A,P,v[C+6],15,-1560198380),P=a(P,I,j,A,v[C+13],21,1309151649),A=a(A,P,I,j,v[C+4],6,-145523070),j=a(j,A,P,I,v[C+11],10,-1120210379),I=a(I,j,A,P,v[C+2],15,718787259),P=a(P,I,j,A,v[C+9],21,-343485551),A=e(A,V),P=e(P,ae),I=e(I,ge),j=e(j,G);return[A,P,I,j]}function c(v){var F,C="",V=v.length*32;for(F=0;F<V;F+=8)C+=String.fromCharCode(v[F>>5]>>>F%32&255);return C}function l(v){var F,C=[];for(C[(v.length>>2)-1]=void 0,F=0;F<C.length;F+=1)C[F]=0;var V=v.length*8;for(F=0;F<V;F+=8)C[F>>5]|=(v.charCodeAt(F/8)&255)<<F%32;return C}function d(v){return c(u(l(v),v.length*8))}function p(v,F){var C,V=l(v),ae=[],ge=[],G;for(ae[15]=ge[15]=void 0,V.length>16&&(V=u(V,v.length*8)),C=0;C<16;C+=1)ae[C]=V[C]^909522486,ge[C]=V[C]^1549556828;return G=u(ae.concat(l(F)),512+F.length*8),c(u(ge.concat(G),640))}function b(v){var F="0123456789abcdef",C="",V,ae;for(ae=0;ae<v.length;ae+=1)V=v.charCodeAt(ae),C+=F.charAt(V>>>4&15)+F.charAt(V&15);return C}function T(v){return unescape(encodeURIComponent(v))}function E(v){return d(T(v))}function L(v){return b(E(v))}function M(v,F){return p(T(v),T(F))}function x(v,F){return b(M(v,F))}function k(v,F,C){return F?C?M(F,v):x(F,v):C?E(v):L(v)}typeof define=="function"&&define.amd?define(function(){return k}):typeof Ad=="object"&&Ad.exports?Ad.exports=k:t.md5=k})($E)});var rb=g(To=>{"use strict";var RN=To&&To.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(To,"__esModule",{value:!0});To.LiteralsMapper=void 0;var DN=RN(tb()),nb=class{constructor(e){let n=this;n.mapping=new Map,n.variableNamespacesGenerator=e}reset(){let e=this;return e.mapping=new Map,e}add(e){let n=this,r=e.raw.toString();if(!n.mapping.has(r))n.mapping.set(r,{literal:e,amount:1,length:r.length,namespace:null});else{let i=n.mapping.get(r),s=i.amount+1,o=i.length+r.length;i.amount=s,i.length=o,o>10&&s>2&&i.namespace==null&&(i.namespace=n.variableNamespacesGenerator.createNamespace((0,DN.default)(r)))}return n}get(e){let n=this,r=e.raw.toString();return n.mapping.has(r)?n.mapping.get(r):null}getMapping(){return this.mapping}};To.LiteralsMapper=nb});var sb=g(Od=>{"use strict";Object.defineProperty(Od,"__esModule",{value:!0});Od.NamespaceGenerator=void 0;var ib=class{constructor(e){let n=this;n.buffer=[0],n.mapping=new Map,n.rmapping=new Map,n.forbidden=e.forbidden||[],n.characters=e.characters||null,n.defaultNamespaces=e.defaultNamespaces||[];for(let r of n.defaultNamespaces)n.createNamespace(r)}exclude(e){let n=this;return Array.isArray(e)?n.forbidden=n.forbidden.concat(e):n.forbidden.push(e),n}setCharset(e){let n=this;return n.characters=e,n}reset(){let e=this;return e.buffer=[0],e.mapping=new Map,e.rmapping=new Map,e}get(e){let n=this.mapping;return n.has(e)?n.get(e):null}increaseBuffer(e){let n=this,r=n.buffer,i=n.characters.length;e==null&&(e=r.length-1);let s=r[e];return s=s+1,r[e]=s,s===i&&(r[e]=0,e===0?r.push(0):n.increaseBuffer(e-1)),n}generateNamespace(){let e=this,n=e.buffer,r=e.characters,i=e.forbidden,s="",o=0,a;for(;o<n.length;)a=n[o],s=s+r[a],o===n.length-1&&e.increaseBuffer(),o=o+1;return i.indexOf(s)!==-1||e.mapping.has(s)?e.generateNamespace():s}createNamespace(e,n=!1){let r=this,i=r.mapping,s=r.rmapping;if(r.forbidden.indexOf(e)!==-1)return e;if(i.has(e)&&!n)return i.get(e);let a=r.generateNamespace();if(i.set(e,a),s.set(a,e),s.has(e)){let u=s.get(e);s.delete(e),a=r.createNamespace(u,!0)}return a}};Od.NamespaceGenerator=ib});var eu=g(ds=>{"use strict";Object.defineProperty(ds,"__esModule",{value:!0});ds.Context=ds.ContextDataProperty=void 0;var PN=rb(),BE=sb(),IN;(function(t){t.ResourceDependencyMap="resourceDependencyMap",t.DependencyCallStack="dependencyCallStack"})(IN=ds.ContextDataProperty||(ds.ContextDataProperty={}));var ob=class{constructor(e){let n=this;n.modules=new BE.NamespaceGenerator({characters:e.modulesCharset}),n.variables=new BE.NamespaceGenerator({characters:e.variablesCharset,defaultNamespaces:["BACKSLASH_CODE","NEW_LINE_OPERATOR","MODULES","EXPORTED","__REQUIRE","MAIN","module","globals"],forbidden:["locals","outer","self","super","string","list","map","number","funcRef",...e.variablesExcluded||[]]}),n.literals=new PN.LiteralsMapper(n.variables),n.data=new Map}createModuleNamespace(e){return this.modules.createNamespace(e)}getOrCreateData(e,n){let r=this;if(r.data.has(e))return r.data.get(e);let i=n();return r.data.set(e,i),i}set(e,n){return this.data.set(e,n),this}get(e){return this.data.get(e)}};ds.Context=ob});var ab=g(tu=>{"use strict";Object.defineProperty(tu,"__esModule",{value:!0});tu.DependencyType=void 0;var MN;(function(t){t[t.Main=0]="Main",t[t.Import=1]="Import",t[t.Include=2]="Include"})(MN=tu.DependencyType||(tu.DependencyType={}))});var Rd=g(Cd=>{"use strict";Object.defineProperty(Cd,"__esModule",{value:!0});Cd.BuildError=void 0;var ub=class extends Error{constructor(e,n){super(e),this.target=n.target,this.range=n.range}};Cd.BuildError=ub});var Pd=g(Dd=>{"use strict";Object.defineProperty(Dd,"__esModule",{value:!0});Dd.fetchNamespaces=void 0;function LN(t){let e=new Set(t.namespaces);return t.scopes.reduce((n,r)=>(r.namespaces.forEach(i=>e.add(i)),n),e),Array.from(e)}Dd.fetchNamespaces=LN});var fb=g(Ei=>{"use strict";var cb=Ei&&Ei.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(l){try{c(r.next(l))}catch(d){o(d)}}function u(l){try{c(r.throw(l))}catch(d){o(d)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((r=r.apply(t,e||[])).next())})},GE=Ei&&Ei.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ei,"__esModule",{value:!0});Ei.Dependency=void 0;var UE=GE(tb()),NN=GE(require("events")),HE=Br(),Id=eu(),lb=ab(),WE=Rd(),qN=Pd(),db=class t extends NN.default{constructor(e){super();let n=this;n.target=e.target,n.id=(0,UE.default)(e.target),n.resourceHandler=e.resourceHandler,n.chunk=e.chunk,n.dependencies=new Set,n.injections=new Map,n.type=e.type||lb.DependencyType.Main,n.context=e.context,n.ref=e.ref;let r=n.context.createModuleNamespace(n.id);n.context.getOrCreateData(Id.ContextDataProperty.ResourceDependencyMap,()=>new Map).set(r,n),n.context.getOrCreateData(Id.ContextDataProperty.DependencyCallStack,()=>[])}getId(){return this.id}getNamespace(){let e=this;return e.context.modules.get(e.id)}resolve(e,n,r){return cb(this,void 0,void 0,function*(){let i=this,s=i.context,{modules:o}=s,a=s.get(Id.ContextDataProperty.ResourceDependencyMap),u=i.resourceHandler,c=yield u.getTargetRelativeTo(i.target,e),l=(0,UE.default)(c),d=o.get(l);if(a.has(d))return a.get(d);if(!(yield u.has(c)))throw new Error("Dependency "+c+" does not exist...");let p=yield u.get(c);i.emit("parse-before",c);try{let T=new HE.Parser(p,{filename:c}).parseChunk(),E=new t({target:c,resourceHandler:u,chunk:T,type:n,context:s,ref:r});return i.emit("parse-after",E),E}catch(b){throw b instanceof WE.BuildError?b:new WE.BuildError(b.message,{target:c,range:b.range})}})}findInjections(){return cb(this,void 0,void 0,function*(){let e=this,{injects:n}=e.chunk,r=new Map;for(let i of n){let s=yield e.resourceHandler.getTargetRelativeTo(e.target,i.path);if(!(yield e.resourceHandler.has(s)))throw new Error("Injection "+s+" does not exist...");let o=yield e.resourceHandler.get(s);r.set(i.path,o)}return e.injections=r,r})}findDependencies(){return cb(this,void 0,void 0,function*(){let e=this,{imports:n,includes:r}=e.chunk,i=e.getNamespace(),s=e.context.get(Id.ContextDataProperty.DependencyCallStack),o=[...(0,qN.fetchNamespaces)(e.chunk)],a=[...e.chunk.literals],u=[];s.push(i);let c=[...n,...r];for(let d of c){let p=d instanceof HE.ASTFeatureIncludeExpression?lb.DependencyType.Include:lb.DependencyType.Import,b=yield e.resolve(d.path,p,d),T=b.getNamespace();if(s.includes(T))throw new Error(`Circular dependency from ${e.target} to ${b.target} detected.`);let E=b.chunk;d.chunk=E,d.namespace=T;let L=yield b.findDependencies();o.push(...L.namespaces),a.push(...L.literals),u.push(b)}yield this.findInjections();let l=new Set(u);return e.dependencies=l,s.pop(),{dependencies:l,namespaces:o,literals:a}})}};Ei.Dependency=db});var Ld=g(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0});Md.Transformer=void 0;var pb=class{get factory(){return this._factory}get buildOptions(){return this._buildOptions}get context(){return this._context}get environmentVariables(){return this._environmentVariables}get resourceHandler(){return this._resourceHandler}constructor({buildOptions:e,factoryConstructor:n,context:r,environmentVariables:i,resourceHandler:s}){let o=this;o._buildOptions=e,o._context=r,o._environmentVariables=i,o._factory=new n(o),o._resourceHandler=s??null}transform(e,n=null){let r=this;if(e.type!=="Chunk")throw new Error("Expects chunk");return r._factory.transform(e,n)}};Md.Transformer=pb});var jd=g(qd=>{"use strict";Object.defineProperty(qd,"__esModule",{value:!0});qd.generateCharsetMap=void 0;function Nd(t,e){let n="";for(;t<=e;)n=n+String.fromCharCode(t),t=t+1;return n}function jN(t=!1){let e=Nd(65,90),n=Nd(97,122),r=Nd(48,57),i="_";return t&&(i=i+Nd(1e3,2e3)),{variables:e+n+i,modules:e+n+r+i}}qd.generateCharsetMap=jN});var gb=g(Ai=>{"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});Ai.MAIN_BOILERPLATE=Ai.MODULE_BOILERPLATE=Ai.HEADER_BOILERPLATE=void 0;var hb=Br();Ai.HEADER_BOILERPLATE=new hb.Parser(`MODULES={}
168
168
  EXPORTED={}
169
169
  __REQUIRE=function(r)
170
170
  if (not MODULES.hasIndex(r)) then
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "miniscript-languageserver",
3
- "version": "1.3.4",
3
+ "version": "1.3.5",
4
4
  "description": "Language server for MiniScript",
5
5
  "main": "./index.js",
6
6
  "scripts": {
@@ -69,7 +69,7 @@
69
69
  "dependencies": {
70
70
  "greybel-core": "~2.1.1",
71
71
  "miniscript-meta": "~1.2.3",
72
- "greybel-transpiler": "~3.2.2",
72
+ "greybel-transpiler": "~3.2.3",
73
73
  "miniscript-type-analyzer": "~0.9.0",
74
74
  "miniscript-languageserver-core": "^1.1.2"
75
75
  }