Skip to content
This repository
Browse code

Fixes imports which deferred failed

  • Loading branch information...
commit 789a911e599ce97f597bb14956c7332d8f72275d 1 parent 23a1514
Xavier Cambar authored
3  build/shepherd.dev.js
@@ -1439,8 +1439,7 @@
1439 1439 var _importName = declaration.vars[i];
1440 1440 moduleConf.imports[_importName] = module[_importName];
1441 1441 }
1442   - }, errorFn);
1443   - modules[declaration.from.path] = _p;
  1442 + });
1444 1443 confPromises.push(_p);
1445 1444 }
1446 1445 }
2  build/shepherd.min.js
... ... @@ -1 +1 @@
1   -(function(a,b,c,d){function e(a,b){return Object.prototype.toString.call(a).toLowerCase()=="[object "+b.toLowerCase()+"]"}function l(a){var b=a.format;if(b==="commonJS")return{fn:function(c){return a.deps&&a.deps.hasOwnProperty(c)?a.deps[c]:require(c)},name:"require"};if(b==="amd"){var c="define";return{name:c,fn:function(c,d,e){var f,g,h;switch(arguments.length){case 1:f=a.name,h=c;break;case 2:g=c,h=d;break;default:f=c,g=d,h=e}if(g){var i={};for(var j=0,k=g.length;j<k;j++)i[g[j]]={format:"amd",ref:g[j]};g=i}var l={};g&&(l.import=g),f&&(l.name=f),h&&(l.fn=h),l.src=a.src,s(l,function(b){throw new Error("AMD not handled yet")})}}}}function m(a,c){function d(a){var b=a.split(";"),c=/^\s*([a-zA-Z_$][0-9a-zA-Z_$]*)\!([a-zA-Z_$][0-9a-zA-Z_$]*)\s*$/;for(var d=0;d<b.length;d++){if(!b[d])continue;var f=b[d],g=f.match(c);if(!g)return!1;var h=g[1];argument=g[2];if(!k[h])return'Unknown plugin "'+h+'"';var i=k[h](argument);if(e(i,"string")||!i)return i}return!0}var f=c||{},g=d(a);if(e(g,"string"))return g;if(g)return f;try{var h=b.parse(a);return typeof true=="undefined"&&console.log(h),h}catch(i){return"Invalid declaration \n"+i.message+"\nDeclaration: "+a}}function n(b){var d=c.defer(),e="XMLHttpRequest"in a?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");return e.open("GET",b,!0),e.setRequestHeader("Accept","application/javascript, text/javascript"),e.onreadystatechange=function(){this.readyState==4&&(/^20\d$/.test(this.status)?d.resolve(e):d.reject(this.status))},e.send(),d.promise}function o(a,b){b._internals.src&&(f[b._internals.src]=a),b.name&&(f[b.name]=a)}function p(b,d){var e=b.imports||{},f,g;e.window={};for(var h in window)e.window[h]=window[h];var k=b.exports?"{"+b.exports.map(function(a){return a.dest+":("+["window."+a.src,"this."+a.src,a.src].join("||")+")"}).join(",")+"}":"{}",m=[],n=[];for(var h in e)e.hasOwnProperty(h)&&(n.push(h),m.push(e[h]));b.format&&b.format.length&&(g=l(b),n.push(g.name),m.push(g.fn));if(!j){var s;return d.apply&&d.call?s=d:s=Function.apply({},n.concat([d+";\nreturn "+k])),f=s.apply({},m),o(f,b),f}var p=document.createElement("script"),q=document.getElementsByTagName("head")[0];p.type="text/javascript";var r=i++;p.innerHTML="(function runner ("+n.join(", ")+") {\n"+d+"\n;s6d["+r+"]("+k+");\n}).apply({}, s6d["+r+"]())",b.src&&p.setAttribute("data-src",b.src),b.name&&p.setAttribute("name",b.name),a.s6d[r]=function(d){if(d){delete a.s6d[r];var e=c.defer();return o(f,b,function(a){return e.resolve(a),a}),e.promise}return m},q.appendChild(p)}function q(a,b,d){var e,f,g=require("vm"),h=a.imports||{};a.format&&a.format.length&&(f=l(a),h[f.name]=f.fn),h.returns={},h.console=console,h.exports={},h.module={exports:{}},h.require=function(a){return h[a]?h[a]:require(a)};var i=a.exports?a.exports.map(function(a){return"returns."+a.dest+" = "+a.src}).join(";\n"):"";g.runInNewContext(b+";\n"+i,h,a._internals.src+".vm"),e=h.returns;for(var j in h.exports)h.exports.hasOwnProperty(j)&&(e[j]=h.exports[j]);for(var j in h.module.exports)h.module.exports.hasOwnProperty(j)&&(e[j]=h.module.exports[j]);var k=c.defer();return o(e,a,function(){k.resolve()}),k}function r(a,b){!a&&(a={});if(!h)return p(a,b);q(a,b,callback)}function s(a){function e(a){b.imports=b.imports||{};var e=f[a.from.path];if(e)if(c.isPromise(e))e.then(function(a){b.imports[i]=a}),d.push(e);else for(var g=0,h=a.vars.length;g<h;g++){var i=a.vars[g];b.imports[i]=e[i]}else{var j=v(a.from.path,function(c){for(var d=0,e=a.vars.length;d<e;d++){var f=a.vars[d];b.imports[f]=c[f]}},errorFn);f[a.from.path]=j,d.push(j)}}function g(a){for(var c=0,d=a.length;c<d;c++)b.exports=b.exports||[],b.exports.push({src:a[c],dest:a[c]})}function i(j){b.name=a.decl.id;if(j.expressions)for(var k=0,l=j.expressions.length;k<l;k++){var m=j.expressions[k];m.type==="export"?g(m.decl):m.type==="import"?e(m.decl):m.type==="module"&&i(m.decl)}else{b.imports=b.imports||{};var n=j.path||j.src||j.id,o=f[n];if(o)c.isPromise(o)?(o.then(function(a){return b.imports[j.id]=a,a}),d.push(o)):b.imports[j.id]=o;else if(j.path){var p=v(j.path,function(a){return b.imports[j.id]=a,b});d.push(p)}else{if(!h)throw new Error("The required module %1 doesn't exist".replace("%1",j.src));var q;try{q=require(j.src)}catch(r){throw new Error("The required module %1 doesn't exist".replace("%1",j.src))}b.imports[j.id]=q}}}var b={},d=[];b._internals=a._internals,a.type==="module"?(b.name=a.decl.id,i(a.decl)):a.type==="export"?g(a.decl):a.type==="import"&&e(a.decl);var j=c.all(d).then(function(){return b},function(){throw new Error("Error while loading "+b._internals.src)});return j}function t(a){var b=c.defer();moduleConf=a||{},rawText=a.contents?a.contents:"",declaration="";var d=rawText.match(/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg);if(!d){var f=r({_internals:{src:a.src}},rawText);return b.resolve(f)}var g=d[0].split("\n");for(var h=0,i=g.length;h<i;h++)declaration+=g[h].trim().replace(/(^\/\*+)|(\*+\/?)/,"");if(!declaration.length){var f=r({_internals:{src:a.src}},rawText);return b.resolve(f),f}moduleConf=m(declaration,moduleConf);if(e(moduleConf,"string"))b.reject(moduleConf);else{var j=moduleConf[0];j._internals={src:a.src,contents:rawText},c(s(j)).then(function(a){return a},function(a){b.reject(a)}).then(function(a){var c=r(a,a._internals.contents);return b.resolve(c),c})}return b.promise}function u(a){var b;try{b=require.resolve(a)}catch(c){}try{b=b?b:require("fs").statSync(__dirname+"/"+a).isFile()&&__dirname+"/"+a}catch(c){}try{b=b?b:require("fs").statSync(process.cwd()+"/"+a).isFile()&&process.cwd()+"/"+a}catch(c){}return b}function v(a,b,d){function i(b){g=g||[],g.indexOf(a)===-1&&g.push(a);if(!e(d,"function"))throw new Error("("+a+") "+b);d()}if(f.hasOwnProperty(a))return b(f[a]);i.origFn=d;var j=c.defer();j.then(b,i);var k=e(a,"string")?{src:a}:a;!k.format&&h&&(k.format="commonJS");var l=e(a,"string")?a:a.name;if(!l)return e(a,"object")&&t(a,function(a){return j.resolve(a),a},function(a){j.reject(a)}),j;if(!h)return c(n(l)).then(function(b){var d=b.responseText;k.contents=d,c(t(k)).then(function(a){return j.resolve(a),a},function(a){j.reject(a)})},function(c){i('Unable to fetch the module "'+a+'" (status code: '+c+")")}),j.promise;var m,o=require("url"),p=o.parse(l);if(p.host){var q=require(p.protocol.indexOf("https")!==-1?"https":"http").get,r={host:p.host,path:p.pathname};p.port&&(r.port=p.port),q(r,function(a){var c="";a.on("data",function(a){c+=a}),a.on("end",function(){k.contents=c,t(k,b,i)}),a.on("error",i)})}else{m=u(l);if(!m){i("Unable to locate file "+l);return}if(e(m,"object"))k.deps=k.deps||{},k.deps[m.uri]=m.node_module;else try{k.contents=require("fs").readFileSync(m,"utf-8")}catch(s){i(s.message);return}t(k,b,i)}}function w(a){for(var b=0;b<a.length;b++){var c=a[b],d;if(e(JSON,"object"))d=JSON.parse(c);else{var f=new Function("return "+c);d=f()}for(var g in d){if(!d.hasOwnProperty(g))continue;g in k?k[g](d[g]):g=="debug"&&(j=d[g])}}}function x(a){for(var b=0;b<a.length;b++){var c=a[b],d=c.getAttribute("data-src");d&&!a.hasOwnProperty(d)&&v(d),!d&&c.innerHTML&&t({contents:c.innerHTML})}}if(typeof b.parse!="function")throw"No parser provided.";var f={},g=null,h=typeof window=="undefined",i=0,j,k={modularize:function(c){function d(b){return a.hasOwnProperty(b)?(f[b]=a[b],!0):'No global "'+b+'"'}if(e(c,"array"))for(var g=0;g<c.length;g++)d(c[g]);else d(c)},noGlobal:function(c){var d=function(b){return a.hasOwnProperty(b)?(delete a[b],!0):'No global "'+b+'"'};if(e(c,"array"))for(var f=0;f<c.length;f++)d(c[f]);else d(c)}};!h&&a.addEventListener&&a.addEventListener("load",function(){var b=[],c=[];for(var d=0;d<document.scripts.length;d++){var e=document.scripts[d],f=e.getAttribute("type");f=="text/shepherd-js"?c.push(e):f=="text/shepherd-js/config"&&b.push(e.innerHTML.trim())}w(b),x(c)});if(typeof true=="undefined"){var y;a.s6d=function(a,b){e(a,"object")?w([a]):v(a,b,y)},a.s6d.src=function(a,b){t({contents:a},b,y)},a.s6d.get=function(a){return a?f[a]:f},a.s6d.error=function(a){if(arguments.length===0)return g;y=a},a.s6d.reset=function(){y=d,f={},g=null},h&&(exports=module.exports=a.s6d)}})(this,(function(){var a,b=function(){var a={trace:function(){},yy:{},symbols_:{error:2,Program:3,ProgramNext:4,ProgramElement:5,ModuleDeclaration:6,ImportDeclaration:7,ExportDeclaration:8,EOF:9,ModuleSpecifier:10,Path:11,String:12,module:13,Id:14,at:15,SEMICOLON:16,IS:17,ImportSource:18,OPEN_BRACE:19,ModuleBody:20,CLOSE_BRACE:21,from:22,"import":23,ImportSpecifierSet:24,WILDCARD:25,ImportSpecifier:26,ImportSpecifierNext:27,COMMA:28,COLON:29,"export":30,ExportSpecifierSet:31,ExportSpecifierSetNext:32,ExportSpecifier:33,ExportSpecifierNext:34,ModuleElement:35,PERIOD:36,$accept:0,$end:1},terminals_:{2:"error",9:"EOF",12:"String",13:"module",14:"Id",15:"at",16:"SEMICOLON",17:"IS",19:"OPEN_BRACE",21:"CLOSE_BRACE",22:"from",23:"import",25:"WILDCARD",28:"COMMA",29:"COLON",30:"export",36:"PERIOD"},productions_:[0,[3,1],[4,1],[4,2],[5,1],[5,1],[5,1],[5,1],[10,1],[10,1],[6,5],[6,5],[6,5],[18,1],[18,3],[7,5],[24,1],[24,1],[24,4],[27,3],[27,0],[26,1],[26,3],[8,4],[32,3],[32,0],[31,4],[31,1],[31,1],[31,3],[33,1],[33,3],[34,3],[34,0],[20,2],[20,2],[20,2],[20,0],[35,1],[35,1],[11,1],[11,3]],performAction:function(b,c,d,e,f,g,h){var i=g.length-1;switch(f){case 1:return g[i];case 2:this.$=g[i];break;case 3:this.$=g[i].length?g[i-1].concat(g[i]):g[i-1];break;case 4:this.$=[{type:"module",decl:g[i]}];break;case 5:this.$=[{type:"import",decl:g[i]}];break;case 6:this.$=[{type:"export",decl:g[i]}];break;case 7:this.$=[];break;case 8:this.$={type:"module",path:g[i]};break;case 9:this.$={type:"uri",path:g[i].trim().replace(/^(['"])(.*)\1$/,function(a,b,c,d){return c})};break;case 10:this.$={id:g[i-3],path:g[i-1].trim().replace(/^(['"])(.*)\1$/,function(a,b,c,d){return c})};break;case 11:this.$={id:g[i-3],src:g[i-1]};break;case 12:this.$={id:g[i-3],expressions:g[i-1]};break;case 13:this.$=g[i];break;case 14:var j={id:g[i-2]};j[g[i].type]=g[i].path,this.$=j;break;case 15:this.$={from:g[i-1],vars:g[i-3]};break;case 16:this.$=[g[i]];break;case 17:this.$=[g[i]];break;case 18:this.$=[g[i-2]].concat(g[i-1]);break;case 19:this.$=typeof g[i]!="undefined"?[g[i-1]].concat(g[i]):g[i-1];break;case 21:this.$=g[i];break;case 22:this.$={remote:g[i-2],local:g[i]};break;case 23:this.$=typeof g[i-1]!="undefined"?g[i-2].concat(g[i-1]):g[i-2];break;case 24:this.$=typeof g[i]!="undefined"?g[i-1].concat(g[i]):g[i-1];break;case 26:this.$=typeof g[i-1]!="undefined"?[g[i-2]].concat(g[i-1]):[g[i-2]];break;case 27:this.$=[g[i]];break;case 28:this.$=[g[i]];break;case 29:this.$=[{from:g[i]}];break;case 30:this.$=g[i];break;case 31:this.$={local:g[i-2],remote:g[i]};break;case 32:this.$=typeof g[i]!="undefined"?[g[i-1]].concat(g[i]):[g[i-1]];break;case 34:this.$=[{type:"module",decl:g[i-1]}].concat(g[i]);break;case 35:this.$=[{type:"import",decl:g[i-1]}].concat(g[i]);break;case 36:this.$=[{type:"export",decl:g[i-1]}].concat(g[i]);break;case 37:this.$=[];break;case 38:this.$=g[i];break;case 39:this.$=g[i];break;case 40:this.$=g[i];break;case 41:this.$=g[i-2]+"."+g[i]}},table:[{3:1,4:2,5:3,6:4,7:5,8:6,9:[1,7],13:[1,8],23:[1,9],30:[1,10]},{1:[3]},{1:[2,1]},{1:[2,2],4:11,5:3,6:4,7:5,8:6,9:[1,7],13:[1,8],23:[1,9],30:[1,10]},{1:[2,4],9:[2,4],13:[2,4],23:[2,4],30:[2,4]},{1:[2,5],9:[2,5],13:[2,5],23:[2,5],30:[2,5]},{1:[2,6],9:[2,6],13:[2,6],23:[2,6],30:[2,6]},{1:[2,7],9:[2,7],13:[2,7],23:[2,7],30:[2,7]},{14:[1,12]},{14:[1,14],19:[1,16],24:13,25:[1,15]},{14:[1,19],19:[1,18],25:[1,20],31:17},{1:[2,3]},{15:[1,21],17:[1,22],19:[1,23]},{22:[1,24]},{22:[2,16]},{22:[2,17]},{14:[1,26],26:25},{16:[2,25],28:[1,28],32:27},{14:[1,30],33:29},{16:[2,27],28:[2,27]},{16:[2,28],22:[1,31],28:[2,28]},{12:[1,32]},{14:[1,34],18:33},{6:36,7:37,8:38,13:[1,8],20:35,21:[2,37],23:[1,9],30:[1,10]},{10:39,11:40,12:[1,41],14:[1,42]},{21:[2,20],27:43,28:[1,44]},{21:[2,21],28:[2,21],29:[1,45]},{16:[1,46]},{14:[1,19],19:[1,18],25:[1,20],31:47},{21:[2,33],28:[1,49],34:48},{21:[2,30],28:[2,30],29:[1,50]},{11:51,14:[1,42]},{16:[1,52]},{16:[1,53]},{16:[2,13],22:[1,54]},{21:[1,55]},{6:36,7:37,8:38,13:[1,8],20:56,21:[2,37],23:[1,9],30:[1,10]},{6:36,7:37,8:38,13:[1,8],20:57,21:[2,37],23:[1,9],30:[1,10]},{6:36,7:37,8:38,13:[1,8],20:58,21:[2,37],23:[1,9],30:[1,10]},{16:[1,59]},{16:[2,8]},{16:[2,9]},{16:[2,40],21:[2,40],28:[2,40],36:[1,60]},{21:[1,61]},{14:[1,26],26:62},{11:63,14:[1,42]},{1:[2,23],9:[2,23],13:[2,23],21:[2,23],23:[2,23],30:[2,23]},{16:[2,25],28:[1,28],32:64},{21:[1,65]},{14:[1,30],33:66},{11:67,14:[1,42]},{16:[2,29],28:[2,29]},{1:[2,10],9:[2,10],13:[2,10],21:[2,10],23:[2,10],30:[2,10]},{1:[2,11],9:[2,11],13:[2,11],21:[2,11],23:[2,11],30:[2,11]},{10:68,11:40,12:[1,41],14:[1,42]},{1:[2,12],9:[2,12],13:[2,12],21:[2,12],23:[2,12],30:[2,12]},{21:[2,34]},{21:[2,35]},{21:[2,36]},{1:[2,15],9:[2,15],13:[2,15],21:[2,15],23:[2,15],30:[2,15]},{11:69,14:[1,42]},{22:[2,18]},{21:[2,20],27:70,28:[1,44]},{21:[2,22],28:[2,22]},{16:[2,24]},{16:[2,26],28:[2,26]},{21:[2,33],28:[1,49],34:71},{21:[2,31],28:[2,31]},{16:[2,14]},{16:[2,41],21:[2,41],28:[2,41]},{21:[2,19]},{21:[2,32]}],defaultActions:{2:[2,1],11:[2,3],14:[2,16],15:[2,17],40:[2,8],41:[2,9],56:[2,34],57:[2,35],58:[2,36],61:[2,18],64:[2,24],68:[2,14],70:[2,19],71:[2,32]},parseError:function(b,c){throw new Error(b)},parse:function(b){function o(a){d.length=d.length-2*a,e.length=e.length-a,f.length=f.length-a}function p(){var a;return a=c.lexer.lex()||1,typeof a!="number"&&(a=c.symbols_[a]||a),a}var c=this,d=[0],e=[null],f=[],g=this.table,h="",i=0,j=0,k=0,l=2,m=1;this.lexer.setInput(b),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,typeof this.lexer.yylloc=="undefined"&&(this.lexer.yylloc={});var n=this.lexer.yylloc;f.push(n),typeof this.yy.parseError=="function"&&(this.parseError=this.yy.parseError);var q,r,s,t,u,v,w={},x,y,z,A;for(;;){s=d[d.length-1],this.defaultActions[s]?t=this.defaultActions[s]:(q==null&&(q=p()),t=g[s]&&g[s][q]);if(typeof t=="undefined"||!t.length||!t[0]){if(!k){A=[];for(x in g[s])this.terminals_[x]&&x>2&&A.push("'"+this.terminals_[x]+"'");var B="";this.lexer.showPosition?B="Parse error on line "+(i+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+A.join(", ")+", got '"+this.terminals_[q]+"'":B="Parse error on line "+(i+1)+": Unexpected "+(q==1?"end of input":"'"+(this.terminals_[q]||q)+"'"),this.parseError(B,{text:this.lexer.match,token:this.terminals_[q]||q,line:this.lexer.yylineno,loc:n,expected:A})}if(k==3){if(q==m)throw new Error(B||"Parsing halted.");j=this.lexer.yyleng,h=this.lexer.yytext,i=this.lexer.yylineno,n=this.lexer.yylloc,q=p()}for(;;){if(l.toString()in g[s])break;if(s==0)throw new Error(B||"Parsing halted.");o(1),s=d[d.length-1]}r=q,q=l,s=d[d.length-1],t=g[s]&&g[s][l],k=3}if(t[0]instanceof Array&&t.length>1)throw new Error("Parse Error: multiple actions possible at state: "+s+", token: "+q);switch(t[0]){case 1:d.push(q),e.push(this.lexer.yytext),f.push(this.lexer.yylloc),d.push(t[1]),q=null,r?(q=r,r=null):(j=this.lexer.yyleng,h=this.lexer.yytext,i=this.lexer.yylineno,n=this.lexer.yylloc,k>0&&k--);break;case 2:y=this.productions_[t[1]][1],w.$=e[e.length-y],w._$={first_line:f[f.length-(y||1)].first_line,last_line:f[f.length-1].last_line,first_column:f[f.length-(y||1)].first_column,last_column:f[f.length-1].last_column},v=this.performAction.call(w,h,j,i,this.yy,t[1],e,f);if(typeof v!="undefined")return v;y&&(d=d.slice(0,-1*y*2),e=e.slice(0,-1*y),f=f.slice(0,-1*y)),d.push(this.productions_[t[1]][0]),e.push(w.$),f.push(w._$),z=g[d[d.length-2]][d[d.length-1]],d.push(z);break;case 3:return!0}}return!0}},b=function(){var a={EOF:1,parseError:function(b,c){if(!this.yy.parseError)throw new Error(b);this.yy.parseError(b,c)},setInput:function(a){return this._input=a,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this},input:function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.match+=a,this.matched+=a;var b=a.match(/\n/);return b&&this.yylineno++,this._input=this._input.slice(1),a},unput:function(a){return this._input=a+this._input,this},more:function(){return this._more=!0,this},pastInput:function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var a=this.pastInput(),b=(new Array(a.length+1)).join("-");return a+this.upcomingInput()+"\n"+b+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,b,c,d,e,f;this._more||(this.yytext="",this.match="");var g=this._currentRules();for(var h=0;h<g.length;h++){c=this._input.match(this.rules[g[h]]);if(c&&(!b||c[0].length>b[0].length)){b=c,d=h;if(!this.options.flex)break}}if(b){f=b[0].match(/\n.*/g),f&&(this.yylineno+=f.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:f?f[f.length-1].length-1:this.yylloc.last_column+b[0].length},this.yytext+=b[0],this.match+=b[0],this.yyleng=this.yytext.length,this._more=!1,this._input=this._input.slice(b[0].length),this.matched+=b[0],a=this.performAction.call(this,this.yy,this,g[d],this.conditionStack[this.conditionStack.length-1]);if(a)return a;return}if(this._input==="")return this.EOF;this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var b=this.next();return typeof b!="undefined"?b:this.lex()},begin:function(b){this.conditionStack.push(b)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(b){this.begin(b)}};return a.options={},a.performAction=function(b,c,d,e){var f=e;switch(d){case 0:break;case 1:break;case 2:break;case 3:return"SEMICOLON";case 4:return"COLON";case 5:return"OPEN_BRACE";case 6:return"CLOSE_BRACE";case 7:return"module";case 8:return"import";case 9:return"export";case 10:return 15;case 11:return 17;case 12:return 22;case 13:return"WILDCARD";case 14:return 28;case 15:return 36;case 16:return"Id";case 17:return"String";case 18:return"String";case 19:return 9}},a.rules=[/^\n+/,/^\s+/,/^\t+/,/^;/,/^:/,/^\{/,/^\}/,/^module\b/,/^import\b/,/^export\b/,/^at\b/,/^is\b/,/^from\b/,/^\*/,/^,/,/^\./,/^[a-zA-Z_$][0-9a-zA-Z_$]*/,/^'[^\']+'/,/^"[^\"]+"/,/^$/],a.conditions={INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19],inclusive:!0}},a}();return a.lexer=b,a}();return typeof undefined!="undefined"&&typeof a!="undefined"&&(a.parser=b,a.parse=function(){return b.parse.apply(b,arguments)},a.main=function(c){if(!c[1])throw new Error("Usage: "+c[0]+" FILE");if(typeof process!="undefined")var d=undefined("fs").readFileSync(undefined("path").join(process.cwd(),c[1]),"utf8");else var e=undefined("file").path(undefined("file").cwd()),d=e.join(c[1]).read({charset:"utf-8"});return a.parser.parse(d)},typeof module!="undefined"&&undefined.main===module&&a.main(typeof process!="undefined"?process.argv.slice(1):undefined("system").args)),b})(),(function(){var a={};return function(a){a(function(){function d(){}function e(a){return new Array(a)}function f(){}function g(b){var d=new f;return d.then=function(a){i(arguments);var d;try{return a&&(d=a(b)),m(d===c?b:d)}catch(e){return h(e)}},a(d)}function h(b){var d=new f;return d.then=function(a,d){i(arguments);var e;try{return d?(e=d(b),m(e===c?b:e)):h(b)}catch(f){return h(f)}},a(d)}function i(a){var b,c=a.length;while(c){b=a[--c];if(b!=null&&typeof b!="function")throw new Error("callback is not a function")}}function j(){function o(a,b,c){return l(a,b,c)}function p(a){n(g(a))}function q(a){n(h(a))}function r(a){m(a)}var b,d,e,k,l,m,n;return e=[],k=[],l=function(b,c,d){i(arguments);var f=j();return e.push(function(a){a.then(b,c).then(f.resolve,f.reject,f.progress)}),d&&k.push(d),f.promise},m=function(a){var b,c=0;while(b=k[c++])b(a)},n=function(a){var b,d=0;l=a.then,n=m=function(){throw new Error("already completed")},k=c;while(b=e[d++])b(a);e=[]},b={},d=new f,d.then=b.then=o,b.promise=a(d),b.resolver=a({resolve:b.resolve=p,reject:b.reject=q,progress:b.progress=r}),b}function k(a){return a&&typeof a.then=="function"}function l(a,b,c,d){var e=m(a);return e.then(b,c,d)}function m(a){var b,c;return a instanceof f?b=a:(c=j(),k(a)?(a.then(c.resolve,c.reject,c.progress),b=c.promise):(c.resolve(a),b=c.promise)),b}function n(a,b,c,e,f){function r(a){m(a)}function s(a){n(a)}function t(a){o(a)}function u(){m=n=o=d}var g,h,i,k,m,n,o,p,q;p=a.length>>>0,g=Math.max(0,Math.min(b,p)),h=[],k=j(),i=l(k,c,e,f);if(!g)k.resolve(h);else{m=function(a){h.push(a),--g||(u(),k.resolve(h))},n=function(a){u(),k.reject(a)},o=k.progress;for(q=0;q<p;++q)q in a&&l(a[q],r,s,t)}return i}function o(a,b,c,d){var f,g;return f=e(a.length),g=s(a,p,f),l(g,b,c,d)}function p(a,b,c){return a[c]=b,a}function q(a,b,c,d){function e(a){return b(a[0])}return n(a,1,e,c,d)}function r(a,b){var c,d;d=a.length,c=e(d);for(;d>=0;--d)d in a&&(c[d]=l(a[d],b));return s(c,p,c)}function s(a,c,d){var e,f;return e=a.length,f=[function(a,b,d){return l(a,function(a){return l(b,function(b){return c(a,b,d,e)})})}],arguments.length>=3&&f.push(d),m(b.apply(a,f))}function t(a,b,c){var d=arguments.length>2;return l(a,function(a){return d&&(a=c),b.resolve(a),a},function(a){return b.reject(a),h(a)},b.progress)}var a,b,c;return a=Object.freeze||function(a){return a},b=[].reduce||function(a){var b,c,d,e,f;f=0,b=Object(this),e=b.length>>>0,c=arguments;if(c.length<=1)for(;;){if(f in b){d=b[f++];break}if(++f>=e)throw new TypeError}else d=c[1];for(;f<e;++f)f in b&&(d=a(d,b[f],f,b));return d},l.defer=j,l.isPromise=k,l.some=n,l.all=o,l.any=q,l.reduce=s,l.map=r,l.chain=t,l})}(typeof define=="function"?define:function(b){typeof a!="undefined"?a.exports=b():this.when=b()}),a.exports})())
  1 +(function(a,b,c,d){function e(a,b){return Object.prototype.toString.call(a).toLowerCase()=="[object "+b.toLowerCase()+"]"}function l(a){var b=a.format;if(b==="commonJS")return{fn:function(c){return a.deps&&a.deps.hasOwnProperty(c)?a.deps[c]:require(c)},name:"require"};if(b==="amd"){var c="define";return{name:c,fn:function(c,d,e){var f,g,h;switch(arguments.length){case 1:f=a.name,h=c;break;case 2:g=c,h=d;break;default:f=c,g=d,h=e}if(g){var i={};for(var j=0,k=g.length;j<k;j++)i[g[j]]={format:"amd",ref:g[j]};g=i}var l={};g&&(l.import=g),f&&(l.name=f),h&&(l.fn=h),l.src=a.src,s(l,function(b){throw new Error("AMD not handled yet")})}}}}function m(a,c){function d(a){var b=a.split(";"),c=/^\s*([a-zA-Z_$][0-9a-zA-Z_$]*)\!([a-zA-Z_$][0-9a-zA-Z_$]*)\s*$/;for(var d=0;d<b.length;d++){if(!b[d])continue;var f=b[d],g=f.match(c);if(!g)return!1;var h=g[1];argument=g[2];if(!k[h])return'Unknown plugin "'+h+'"';var i=k[h](argument);if(e(i,"string")||!i)return i}return!0}var f=c||{},g=d(a);if(e(g,"string"))return g;if(g)return f;try{var h=b.parse(a);return typeof true=="undefined"&&console.log(h),h}catch(i){return"Invalid declaration \n"+i.message+"\nDeclaration: "+a}}function n(b){var d=c.defer(),e="XMLHttpRequest"in a?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");return e.open("GET",b,!0),e.setRequestHeader("Accept","application/javascript, text/javascript"),e.onreadystatechange=function(){this.readyState==4&&(/^20\d$/.test(this.status)?d.resolve(e):d.reject(this.status))},e.send(),d.promise}function o(a,b){b._internals.src&&(f[b._internals.src]=a),b.name&&(f[b.name]=a)}function p(b,d){var e=b.imports||{},f,g;e.window={};for(var h in window)e.window[h]=window[h];var k=b.exports?"{"+b.exports.map(function(a){return a.dest+":("+["window."+a.src,"this."+a.src,a.src].join("||")+")"}).join(",")+"}":"{}",m=[],n=[];for(var h in e)e.hasOwnProperty(h)&&(n.push(h),m.push(e[h]));b.format&&b.format.length&&(g=l(b),n.push(g.name),m.push(g.fn));if(!j){var s;return d.apply&&d.call?s=d:s=Function.apply({},n.concat([d+";\nreturn "+k])),f=s.apply({},m),o(f,b),f}var p=document.createElement("script"),q=document.getElementsByTagName("head")[0];p.type="text/javascript";var r=i++;p.innerHTML="(function runner ("+n.join(", ")+") {\n"+d+"\n;s6d["+r+"]("+k+");\n}).apply({}, s6d["+r+"]())",b.src&&p.setAttribute("data-src",b.src),b.name&&p.setAttribute("name",b.name),a.s6d[r]=function(d){if(d){delete a.s6d[r];var e=c.defer();return o(f,b,function(a){return e.resolve(a),a}),e.promise}return m},q.appendChild(p)}function q(a,b,d){var e,f,g=require("vm"),h=a.imports||{};a.format&&a.format.length&&(f=l(a),h[f.name]=f.fn),h.returns={},h.console=console,h.exports={},h.module={exports:{}},h.require=function(a){return h[a]?h[a]:require(a)};var i=a.exports?a.exports.map(function(a){return"returns."+a.dest+" = "+a.src}).join(";\n"):"";g.runInNewContext(b+";\n"+i,h,a._internals.src+".vm"),e=h.returns;for(var j in h.exports)h.exports.hasOwnProperty(j)&&(e[j]=h.exports[j]);for(var j in h.module.exports)h.module.exports.hasOwnProperty(j)&&(e[j]=h.module.exports[j]);var k=c.defer();return o(e,a,function(){k.resolve()}),k}function r(a,b){!a&&(a={});if(!h)return p(a,b);q(a,b,callback)}function s(a){function e(a){b.imports=b.imports||{};var e=f[a.from.path];if(e)if(c.isPromise(e))e.then(function(a){b.imports[i]=a}),d.push(e);else for(var g=0,h=a.vars.length;g<h;g++){var i=a.vars[g];b.imports[i]=e[i]}else{var j=v(a.from.path,function(c){for(var d=0,e=a.vars.length;d<e;d++){var f=a.vars[d];b.imports[f]=c[f]}});d.push(j)}}function g(a){for(var c=0,d=a.length;c<d;c++)b.exports=b.exports||[],b.exports.push({src:a[c],dest:a[c]})}function i(j){b.name=a.decl.id;if(j.expressions)for(var k=0,l=j.expressions.length;k<l;k++){var m=j.expressions[k];m.type==="export"?g(m.decl):m.type==="import"?e(m.decl):m.type==="module"&&i(m.decl)}else{b.imports=b.imports||{};var n=j.path||j.src||j.id,o=f[n];if(o)c.isPromise(o)?(o.then(function(a){return b.imports[j.id]=a,a}),d.push(o)):b.imports[j.id]=o;else if(j.path){var p=v(j.path,function(a){return b.imports[j.id]=a,b});d.push(p)}else{if(!h)throw new Error("The required module %1 doesn't exist".replace("%1",j.src));var q;try{q=require(j.src)}catch(r){throw new Error("The required module %1 doesn't exist".replace("%1",j.src))}b.imports[j.id]=q}}}var b={},d=[];b._internals=a._internals,a.type==="module"?(b.name=a.decl.id,i(a.decl)):a.type==="export"?g(a.decl):a.type==="import"&&e(a.decl);var j=c.all(d).then(function(){return b},function(){throw new Error("Error while loading "+b._internals.src)});return j}function t(a){var b=c.defer();moduleConf=a||{},rawText=a.contents?a.contents:"",declaration="";var d=rawText.match(/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg);if(!d){var f=r({_internals:{src:a.src}},rawText);return b.resolve(f)}var g=d[0].split("\n");for(var h=0,i=g.length;h<i;h++)declaration+=g[h].trim().replace(/(^\/\*+)|(\*+\/?)/,"");if(!declaration.length){var f=r({_internals:{src:a.src}},rawText);return b.resolve(f),f}moduleConf=m(declaration,moduleConf);if(e(moduleConf,"string"))b.reject(moduleConf);else{var j=moduleConf[0];j._internals={src:a.src,contents:rawText},c(s(j)).then(function(a){return a},function(a){b.reject(a)}).then(function(a){var c=r(a,a._internals.contents);return b.resolve(c),c})}return b.promise}function u(a){var b;try{b=require.resolve(a)}catch(c){}try{b=b?b:require("fs").statSync(__dirname+"/"+a).isFile()&&__dirname+"/"+a}catch(c){}try{b=b?b:require("fs").statSync(process.cwd()+"/"+a).isFile()&&process.cwd()+"/"+a}catch(c){}return b}function v(a,b,d){function i(b){g=g||[],g.indexOf(a)===-1&&g.push(a);if(!e(d,"function"))throw new Error("("+a+") "+b);d()}if(f.hasOwnProperty(a))return b(f[a]);i.origFn=d;var j=c.defer();j.then(b,i);var k=e(a,"string")?{src:a}:a;!k.format&&h&&(k.format="commonJS");var l=e(a,"string")?a:a.name;if(!l)return e(a,"object")&&t(a,function(a){return j.resolve(a),a},function(a){j.reject(a)}),j;if(!h)return c(n(l)).then(function(b){var d=b.responseText;k.contents=d,c(t(k)).then(function(a){return j.resolve(a),a},function(a){j.reject(a)})},function(c){i('Unable to fetch the module "'+a+'" (status code: '+c+")")}),j.promise;var m,o=require("url"),p=o.parse(l);if(p.host){var q=require(p.protocol.indexOf("https")!==-1?"https":"http").get,r={host:p.host,path:p.pathname};p.port&&(r.port=p.port),q(r,function(a){var c="";a.on("data",function(a){c+=a}),a.on("end",function(){k.contents=c,t(k,b,i)}),a.on("error",i)})}else{m=u(l);if(!m){i("Unable to locate file "+l);return}if(e(m,"object"))k.deps=k.deps||{},k.deps[m.uri]=m.node_module;else try{k.contents=require("fs").readFileSync(m,"utf-8")}catch(s){i(s.message);return}t(k,b,i)}}function w(a){for(var b=0;b<a.length;b++){var c=a[b],d;if(e(JSON,"object"))d=JSON.parse(c);else{var f=new Function("return "+c);d=f()}for(var g in d){if(!d.hasOwnProperty(g))continue;g in k?k[g](d[g]):g=="debug"&&(j=d[g])}}}function x(a){for(var b=0;b<a.length;b++){var c=a[b],d=c.getAttribute("data-src");d&&!a.hasOwnProperty(d)&&v(d),!d&&c.innerHTML&&t({contents:c.innerHTML})}}if(typeof b.parse!="function")throw"No parser provided.";var f={},g=null,h=typeof window=="undefined",i=0,j,k={modularize:function(c){function d(b){return a.hasOwnProperty(b)?(f[b]=a[b],!0):'No global "'+b+'"'}if(e(c,"array"))for(var g=0;g<c.length;g++)d(c[g]);else d(c)},noGlobal:function(c){var d=function(b){return a.hasOwnProperty(b)?(delete a[b],!0):'No global "'+b+'"'};if(e(c,"array"))for(var f=0;f<c.length;f++)d(c[f]);else d(c)}};!h&&a.addEventListener&&a.addEventListener("load",function(){var b=[],c=[];for(var d=0;d<document.scripts.length;d++){var e=document.scripts[d],f=e.getAttribute("type");f=="text/shepherd-js"?c.push(e):f=="text/shepherd-js/config"&&b.push(e.innerHTML.trim())}w(b),x(c)});if(typeof true=="undefined"){var y;a.s6d=function(a,b){e(a,"object")?w([a]):v(a,b,y)},a.s6d.src=function(a,b){t({contents:a},b,y)},a.s6d.get=function(a){return a?f[a]:f},a.s6d.error=function(a){if(arguments.length===0)return g;y=a},a.s6d.reset=function(){y=d,f={},g=null},h&&(exports=module.exports=a.s6d)}})(this,(function(){var a,b=function(){var a={trace:function(){},yy:{},symbols_:{error:2,Program:3,ProgramNext:4,ProgramElement:5,ModuleDeclaration:6,ImportDeclaration:7,ExportDeclaration:8,EOF:9,ModuleSpecifier:10,Path:11,String:12,module:13,Id:14,at:15,SEMICOLON:16,IS:17,ImportSource:18,OPEN_BRACE:19,ModuleBody:20,CLOSE_BRACE:21,from:22,"import":23,ImportSpecifierSet:24,WILDCARD:25,ImportSpecifier:26,ImportSpecifierNext:27,COMMA:28,COLON:29,"export":30,ExportSpecifierSet:31,ExportSpecifierSetNext:32,ExportSpecifier:33,ExportSpecifierNext:34,ModuleElement:35,PERIOD:36,$accept:0,$end:1},terminals_:{2:"error",9:"EOF",12:"String",13:"module",14:"Id",15:"at",16:"SEMICOLON",17:"IS",19:"OPEN_BRACE",21:"CLOSE_BRACE",22:"from",23:"import",25:"WILDCARD",28:"COMMA",29:"COLON",30:"export",36:"PERIOD"},productions_:[0,[3,1],[4,1],[4,2],[5,1],[5,1],[5,1],[5,1],[10,1],[10,1],[6,5],[6,5],[6,5],[18,1],[18,3],[7,5],[24,1],[24,1],[24,4],[27,3],[27,0],[26,1],[26,3],[8,4],[32,3],[32,0],[31,4],[31,1],[31,1],[31,3],[33,1],[33,3],[34,3],[34,0],[20,2],[20,2],[20,2],[20,0],[35,1],[35,1],[11,1],[11,3]],performAction:function(b,c,d,e,f,g,h){var i=g.length-1;switch(f){case 1:return g[i];case 2:this.$=g[i];break;case 3:this.$=g[i].length?g[i-1].concat(g[i]):g[i-1];break;case 4:this.$=[{type:"module",decl:g[i]}];break;case 5:this.$=[{type:"import",decl:g[i]}];break;case 6:this.$=[{type:"export",decl:g[i]}];break;case 7:this.$=[];break;case 8:this.$={type:"module",path:g[i]};break;case 9:this.$={type:"uri",path:g[i].trim().replace(/^(['"])(.*)\1$/,function(a,b,c,d){return c})};break;case 10:this.$={id:g[i-3],path:g[i-1].trim().replace(/^(['"])(.*)\1$/,function(a,b,c,d){return c})};break;case 11:this.$={id:g[i-3],src:g[i-1]};break;case 12:this.$={id:g[i-3],expressions:g[i-1]};break;case 13:this.$=g[i];break;case 14:var j={id:g[i-2]};j[g[i].type]=g[i].path,this.$=j;break;case 15:this.$={from:g[i-1],vars:g[i-3]};break;case 16:this.$=[g[i]];break;case 17:this.$=[g[i]];break;case 18:this.$=[g[i-2]].concat(g[i-1]);break;case 19:this.$=typeof g[i]!="undefined"?[g[i-1]].concat(g[i]):g[i-1];break;case 21:this.$=g[i];break;case 22:this.$={remote:g[i-2],local:g[i]};break;case 23:this.$=typeof g[i-1]!="undefined"?g[i-2].concat(g[i-1]):g[i-2];break;case 24:this.$=typeof g[i]!="undefined"?g[i-1].concat(g[i]):g[i-1];break;case 26:this.$=typeof g[i-1]!="undefined"?[g[i-2]].concat(g[i-1]):[g[i-2]];break;case 27:this.$=[g[i]];break;case 28:this.$=[g[i]];break;case 29:this.$=[{from:g[i]}];break;case 30:this.$=g[i];break;case 31:this.$={local:g[i-2],remote:g[i]};break;case 32:this.$=typeof g[i]!="undefined"?[g[i-1]].concat(g[i]):[g[i-1]];break;case 34:this.$=[{type:"module",decl:g[i-1]}].concat(g[i]);break;case 35:this.$=[{type:"import",decl:g[i-1]}].concat(g[i]);break;case 36:this.$=[{type:"export",decl:g[i-1]}].concat(g[i]);break;case 37:this.$=[];break;case 38:this.$=g[i];break;case 39:this.$=g[i];break;case 40:this.$=g[i];break;case 41:this.$=g[i-2]+"."+g[i]}},table:[{3:1,4:2,5:3,6:4,7:5,8:6,9:[1,7],13:[1,8],23:[1,9],30:[1,10]},{1:[3]},{1:[2,1]},{1:[2,2],4:11,5:3,6:4,7:5,8:6,9:[1,7],13:[1,8],23:[1,9],30:[1,10]},{1:[2,4],9:[2,4],13:[2,4],23:[2,4],30:[2,4]},{1:[2,5],9:[2,5],13:[2,5],23:[2,5],30:[2,5]},{1:[2,6],9:[2,6],13:[2,6],23:[2,6],30:[2,6]},{1:[2,7],9:[2,7],13:[2,7],23:[2,7],30:[2,7]},{14:[1,12]},{14:[1,14],19:[1,16],24:13,25:[1,15]},{14:[1,19],19:[1,18],25:[1,20],31:17},{1:[2,3]},{15:[1,21],17:[1,22],19:[1,23]},{22:[1,24]},{22:[2,16]},{22:[2,17]},{14:[1,26],26:25},{16:[2,25],28:[1,28],32:27},{14:[1,30],33:29},{16:[2,27],28:[2,27]},{16:[2,28],22:[1,31],28:[2,28]},{12:[1,32]},{14:[1,34],18:33},{6:36,7:37,8:38,13:[1,8],20:35,21:[2,37],23:[1,9],30:[1,10]},{10:39,11:40,12:[1,41],14:[1,42]},{21:[2,20],27:43,28:[1,44]},{21:[2,21],28:[2,21],29:[1,45]},{16:[1,46]},{14:[1,19],19:[1,18],25:[1,20],31:47},{21:[2,33],28:[1,49],34:48},{21:[2,30],28:[2,30],29:[1,50]},{11:51,14:[1,42]},{16:[1,52]},{16:[1,53]},{16:[2,13],22:[1,54]},{21:[1,55]},{6:36,7:37,8:38,13:[1,8],20:56,21:[2,37],23:[1,9],30:[1,10]},{6:36,7:37,8:38,13:[1,8],20:57,21:[2,37],23:[1,9],30:[1,10]},{6:36,7:37,8:38,13:[1,8],20:58,21:[2,37],23:[1,9],30:[1,10]},{16:[1,59]},{16:[2,8]},{16:[2,9]},{16:[2,40],21:[2,40],28:[2,40],36:[1,60]},{21:[1,61]},{14:[1,26],26:62},{11:63,14:[1,42]},{1:[2,23],9:[2,23],13:[2,23],21:[2,23],23:[2,23],30:[2,23]},{16:[2,25],28:[1,28],32:64},{21:[1,65]},{14:[1,30],33:66},{11:67,14:[1,42]},{16:[2,29],28:[2,29]},{1:[2,10],9:[2,10],13:[2,10],21:[2,10],23:[2,10],30:[2,10]},{1:[2,11],9:[2,11],13:[2,11],21:[2,11],23:[2,11],30:[2,11]},{10:68,11:40,12:[1,41],14:[1,42]},{1:[2,12],9:[2,12],13:[2,12],21:[2,12],23:[2,12],30:[2,12]},{21:[2,34]},{21:[2,35]},{21:[2,36]},{1:[2,15],9:[2,15],13:[2,15],21:[2,15],23:[2,15],30:[2,15]},{11:69,14:[1,42]},{22:[2,18]},{21:[2,20],27:70,28:[1,44]},{21:[2,22],28:[2,22]},{16:[2,24]},{16:[2,26],28:[2,26]},{21:[2,33],28:[1,49],34:71},{21:[2,31],28:[2,31]},{16:[2,14]},{16:[2,41],21:[2,41],28:[2,41]},{21:[2,19]},{21:[2,32]}],defaultActions:{2:[2,1],11:[2,3],14:[2,16],15:[2,17],40:[2,8],41:[2,9],56:[2,34],57:[2,35],58:[2,36],61:[2,18],64:[2,24],68:[2,14],70:[2,19],71:[2,32]},parseError:function(b,c){throw new Error(b)},parse:function(b){function o(a){d.length=d.length-2*a,e.length=e.length-a,f.length=f.length-a}function p(){var a;return a=c.lexer.lex()||1,typeof a!="number"&&(a=c.symbols_[a]||a),a}var c=this,d=[0],e=[null],f=[],g=this.table,h="",i=0,j=0,k=0,l=2,m=1;this.lexer.setInput(b),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,typeof this.lexer.yylloc=="undefined"&&(this.lexer.yylloc={});var n=this.lexer.yylloc;f.push(n),typeof this.yy.parseError=="function"&&(this.parseError=this.yy.parseError);var q,r,s,t,u,v,w={},x,y,z,A;for(;;){s=d[d.length-1],this.defaultActions[s]?t=this.defaultActions[s]:(q==null&&(q=p()),t=g[s]&&g[s][q]);if(typeof t=="undefined"||!t.length||!t[0]){if(!k){A=[];for(x in g[s])this.terminals_[x]&&x>2&&A.push("'"+this.terminals_[x]+"'");var B="";this.lexer.showPosition?B="Parse error on line "+(i+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+A.join(", ")+", got '"+this.terminals_[q]+"'":B="Parse error on line "+(i+1)+": Unexpected "+(q==1?"end of input":"'"+(this.terminals_[q]||q)+"'"),this.parseError(B,{text:this.lexer.match,token:this.terminals_[q]||q,line:this.lexer.yylineno,loc:n,expected:A})}if(k==3){if(q==m)throw new Error(B||"Parsing halted.");j=this.lexer.yyleng,h=this.lexer.yytext,i=this.lexer.yylineno,n=this.lexer.yylloc,q=p()}for(;;){if(l.toString()in g[s])break;if(s==0)throw new Error(B||"Parsing halted.");o(1),s=d[d.length-1]}r=q,q=l,s=d[d.length-1],t=g[s]&&g[s][l],k=3}if(t[0]instanceof Array&&t.length>1)throw new Error("Parse Error: multiple actions possible at state: "+s+", token: "+q);switch(t[0]){case 1:d.push(q),e.push(this.lexer.yytext),f.push(this.lexer.yylloc),d.push(t[1]),q=null,r?(q=r,r=null):(j=this.lexer.yyleng,h=this.lexer.yytext,i=this.lexer.yylineno,n=this.lexer.yylloc,k>0&&k--);break;case 2:y=this.productions_[t[1]][1],w.$=e[e.length-y],w._$={first_line:f[f.length-(y||1)].first_line,last_line:f[f.length-1].last_line,first_column:f[f.length-(y||1)].first_column,last_column:f[f.length-1].last_column},v=this.performAction.call(w,h,j,i,this.yy,t[1],e,f);if(typeof v!="undefined")return v;y&&(d=d.slice(0,-1*y*2),e=e.slice(0,-1*y),f=f.slice(0,-1*y)),d.push(this.productions_[t[1]][0]),e.push(w.$),f.push(w._$),z=g[d[d.length-2]][d[d.length-1]],d.push(z);break;case 3:return!0}}return!0}},b=function(){var a={EOF:1,parseError:function(b,c){if(!this.yy.parseError)throw new Error(b);this.yy.parseError(b,c)},setInput:function(a){return this._input=a,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this},input:function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.match+=a,this.matched+=a;var b=a.match(/\n/);return b&&this.yylineno++,this._input=this._input.slice(1),a},unput:function(a){return this._input=a+this._input,this},more:function(){return this._more=!0,this},pastInput:function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var a=this.pastInput(),b=(new Array(a.length+1)).join("-");return a+this.upcomingInput()+"\n"+b+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,b,c,d,e,f;this._more||(this.yytext="",this.match="");var g=this._currentRules();for(var h=0;h<g.length;h++){c=this._input.match(this.rules[g[h]]);if(c&&(!b||c[0].length>b[0].length)){b=c,d=h;if(!this.options.flex)break}}if(b){f=b[0].match(/\n.*/g),f&&(this.yylineno+=f.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:f?f[f.length-1].length-1:this.yylloc.last_column+b[0].length},this.yytext+=b[0],this.match+=b[0],this.yyleng=this.yytext.length,this._more=!1,this._input=this._input.slice(b[0].length),this.matched+=b[0],a=this.performAction.call(this,this.yy,this,g[d],this.conditionStack[this.conditionStack.length-1]);if(a)return a;return}if(this._input==="")return this.EOF;this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var b=this.next();return typeof b!="undefined"?b:this.lex()},begin:function(b){this.conditionStack.push(b)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(b){this.begin(b)}};return a.options={},a.performAction=function(b,c,d,e){var f=e;switch(d){case 0:break;case 1:break;case 2:break;case 3:return"SEMICOLON";case 4:return"COLON";case 5:return"OPEN_BRACE";case 6:return"CLOSE_BRACE";case 7:return"module";case 8:return"import";case 9:return"export";case 10:return 15;case 11:return 17;case 12:return 22;case 13:return"WILDCARD";case 14:return 28;case 15:return 36;case 16:return"Id";case 17:return"String";case 18:return"String";case 19:return 9}},a.rules=[/^\n+/,/^\s+/,/^\t+/,/^;/,/^:/,/^\{/,/^\}/,/^module\b/,/^import\b/,/^export\b/,/^at\b/,/^is\b/,/^from\b/,/^\*/,/^,/,/^\./,/^[a-zA-Z_$][0-9a-zA-Z_$]*/,/^'[^\']+'/,/^"[^\"]+"/,/^$/],a.conditions={INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19],inclusive:!0}},a}();return a.lexer=b,a}();return typeof undefined!="undefined"&&typeof a!="undefined"&&(a.parser=b,a.parse=function(){return b.parse.apply(b,arguments)},a.main=function(c){if(!c[1])throw new Error("Usage: "+c[0]+" FILE");if(typeof process!="undefined")var d=undefined("fs").readFileSync(undefined("path").join(process.cwd(),c[1]),"utf8");else var e=undefined("file").path(undefined("file").cwd()),d=e.join(c[1]).read({charset:"utf-8"});return a.parser.parse(d)},typeof module!="undefined"&&undefined.main===module&&a.main(typeof process!="undefined"?process.argv.slice(1):undefined("system").args)),b})(),(function(){var a={};return function(a){a(function(){function d(){}function e(a){return new Array(a)}function f(){}function g(b){var d=new f;return d.then=function(a){i(arguments);var d;try{return a&&(d=a(b)),m(d===c?b:d)}catch(e){return h(e)}},a(d)}function h(b){var d=new f;return d.then=function(a,d){i(arguments);var e;try{return d?(e=d(b),m(e===c?b:e)):h(b)}catch(f){return h(f)}},a(d)}function i(a){var b,c=a.length;while(c){b=a[--c];if(b!=null&&typeof b!="function")throw new Error("callback is not a function")}}function j(){function o(a,b,c){return l(a,b,c)}function p(a){n(g(a))}function q(a){n(h(a))}function r(a){m(a)}var b,d,e,k,l,m,n;return e=[],k=[],l=function(b,c,d){i(arguments);var f=j();return e.push(function(a){a.then(b,c).then(f.resolve,f.reject,f.progress)}),d&&k.push(d),f.promise},m=function(a){var b,c=0;while(b=k[c++])b(a)},n=function(a){var b,d=0;l=a.then,n=m=function(){throw new Error("already completed")},k=c;while(b=e[d++])b(a);e=[]},b={},d=new f,d.then=b.then=o,b.promise=a(d),b.resolver=a({resolve:b.resolve=p,reject:b.reject=q,progress:b.progress=r}),b}function k(a){return a&&typeof a.then=="function"}function l(a,b,c,d){var e=m(a);return e.then(b,c,d)}function m(a){var b,c;return a instanceof f?b=a:(c=j(),k(a)?(a.then(c.resolve,c.reject,c.progress),b=c.promise):(c.resolve(a),b=c.promise)),b}function n(a,b,c,e,f){function r(a){m(a)}function s(a){n(a)}function t(a){o(a)}function u(){m=n=o=d}var g,h,i,k,m,n,o,p,q;p=a.length>>>0,g=Math.max(0,Math.min(b,p)),h=[],k=j(),i=l(k,c,e,f);if(!g)k.resolve(h);else{m=function(a){h.push(a),--g||(u(),k.resolve(h))},n=function(a){u(),k.reject(a)},o=k.progress;for(q=0;q<p;++q)q in a&&l(a[q],r,s,t)}return i}function o(a,b,c,d){var f,g;return f=e(a.length),g=s(a,p,f),l(g,b,c,d)}function p(a,b,c){return a[c]=b,a}function q(a,b,c,d){function e(a){return b(a[0])}return n(a,1,e,c,d)}function r(a,b){var c,d;d=a.length,c=e(d);for(;d>=0;--d)d in a&&(c[d]=l(a[d],b));return s(c,p,c)}function s(a,c,d){var e,f;return e=a.length,f=[function(a,b,d){return l(a,function(a){return l(b,function(b){return c(a,b,d,e)})})}],arguments.length>=3&&f.push(d),m(b.apply(a,f))}function t(a,b,c){var d=arguments.length>2;return l(a,function(a){return d&&(a=c),b.resolve(a),a},function(a){return b.reject(a),h(a)},b.progress)}var a,b,c;return a=Object.freeze||function(a){return a},b=[].reduce||function(a){var b,c,d,e,f;f=0,b=Object(this),e=b.length>>>0,c=arguments;if(c.length<=1)for(;;){if(f in b){d=b[f++];break}if(++f>=e)throw new TypeError}else d=c[1];for(;f<e;++f)f in b&&(d=a(d,b[f],f,b));return d},l.defer=j,l.isPromise=k,l.some=n,l.all=o,l.any=q,l.reduce=s,l.map=r,l.chain=t,l})}(typeof define=="function"?define:function(b){typeof a!="undefined"?a.exports=b():this.when=b()}),a.exports})())
7 src/shepherd.js
@@ -346,7 +346,6 @@
346 346 moduleConf.imports = moduleConf.imports || {};
347 347 var _dep = modules[declaration.from.path];
348 348 if (_dep) {
349   -
350 349 if (when.isPromise(_dep)) {
351 350 _dep.then(function (module) {
352 351 moduleConf.imports[_importName] = module;
@@ -366,10 +365,8 @@
366 365 var _importName = declaration.vars[i];
367 366 moduleConf.imports[_importName] = module[_importName];
368 367 }
369   - },
370   - errorFn
  368 + }
371 369 );
372   - modules[declaration.from.path] = _p;
373 370 confPromises.push(_p);
374 371 }
375 372
@@ -425,7 +422,6 @@
425 422 return moduleConf;
426 423 }
427 424 );
428   - //modules[declaration.path] = _p;
429 425 confPromises.push(_p);
430 426 } else {
431 427 if (_isServer) {
@@ -451,7 +447,6 @@
451 447 } else if (conf.type === 'import') {
452 448 importLoader(conf.decl);
453 449 }
454   -
455 450 var defer = when.all(confPromises).then(
456 451 function () {
457 452 return moduleConf;

0 comments on commit 789a911

Please sign in to comment.
Something went wrong with that request. Please try again.