From 839c0509ee8f34da1bac6451994666838398a937 Mon Sep 17 00:00:00 2001 From: Pakkapon Phongtawee Date: Thu, 14 Jan 2016 07:29:13 +0700 Subject: [PATCH] release: v0.0.5 --- irin-lang.min.js | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/irin-lang.min.js b/irin-lang.min.js index b14433a..5133009 100644 --- a/irin-lang.min.js +++ b/irin-lang.min.js @@ -1 +1 @@ -(function(){var e;e=function(){function e(e,t){var n,i;!e instanceof String&&t({message:"input file path must be a string."}),this.env.runtime=this.runtime(),i=this,n=!1,this.data.files.push(e),this.parse(e,function(e,r){return r&&(i.data.graph={next:r.graph},i.data.head=i.data.graph,i.data.global=r.variable,n||(i.data.isReady=!0,t())),e?(t(e),n=!0):void 0})}var t;return e.prototype.data={graph:[],head:[],global:{},files:[],isReady:!1},e.prototype.config={includeDepth:50},e.prototype.env={runtime:"node",node:{fs:""}},e.prototype.parse=function(e,t){return this.parseWorker(e,0,t)},e.prototype.parseWorker=function(e,t,n){var i;return t>this.config.includeDepth?(console.error("stack crash"),n({message:"File reading stack more than "+this.config.includeDepth+" time. Maybe it got forever loop.",file:this.data.files.pop()})):(i=this,this.readFile(e,function(e,r){return e?n(e):i.parseProcess(r.toString(),t,n)}))},e.prototype.parseProcess=function(e,n,i){var r,o,a,s,p;return e=this.removeComment(e),e.message||(e=this.reduceIndent(e)),e.message?void i({message:e.message,file:this.data.files.pop(),line:e.line}):(o=e.split("\n"),p={line:0,indent:0,pastIndent:0,readingHeader:!1,functionObject:{},currentFuncName:"",graph:[],variable:{},headerDepth:0,isAddtoFunction:!1},p.head=p.graph,s=this,a=[],(r=function(e,h){var l,d,u,f,c,g,m;if(e&&(e.file?i(e):(p=a.pop(),s.data.files.pop(),i({message:e.message,file:s.data.files.pop(),line:p.line+1}))),h){for(s.data.files.pop(),p=a.pop(),p.indent=0,p.head=p.graph;p.indent!==p.headerDepth;)p.indent++,p.head=p.head[p.head.length-1].next;p.head.push.apply(p.head,h.graph);for(u in h.variable)p.variable[u]||(p.variable[u]=h.variable[u]);for(u in h.functionObject)p.functionObject[u]?p.functionObject[u].push.apply(p.functionObject[u],h.functionObject[u]):p.functionObject[u]=h.functionObject[u];p.pastIndent=p.headerDepth}for(;p.line-1){if(p.readingHeader)p.readingHeader=!1;else{if(0!==p.graph.length)return i({message:"Header must declare on top of file only.",file:s.data.files.pop(),line:p.line+1});p.headerDepth=p.indent,p.readingHeader=!0}p.line++}else if(p.readingHeader&&g.indexOf("<-")>-1){for(m=g.split("<-"),f=m.length-1,d=0;f>d;){if(!isNaN(parseFloat(m[d].trim())))return i({message:"Variable name must not start with number.",file:s.data.files.pop(),line:p.line+1});c=m[f].trim(),c.indexOf("{")>-1&&(c=s.compileOperator(s.mergeExpression(c,p.variable))),p.variable[m[d].trim()]||(p.variable[m[d].trim()]=c),d++}p.line++}else{if(!t(g))return i({message:"Bracket is mismatch.",file:s.data.files.pop(),line:p.line+1});if("->"===g.substring(0,2)&&".irin"===g.substring(g.length-5,g.length))return p.line++,p.headerDepth=p.indent,a.push(p),l=g.trim().substring(2,g.length).trim(),l=s.getDirPath()+"/"+l,s.data.files.push(l),void s.parseWorker(l,n+1,r);if(p.readingHeader)return i({message:"Unexpected declaration in header.",file:s.data.files.pop(),line:p.line+1});if("->"!==g.substring(0,2)){if(p.isAddtoFunction&&0===p.indent&&(p.isAddtoFunction=!1),p.indent===p.pastIndent)p.head.push({text:g,next:[]}),p.head.length>1&&0===p.head[p.head.length-2].next.length&&(p.head[p.head.length-1].next=p.head[p.head.length-2].next);else if(p.indent>p.pastIndent){for(p.pastIndent=p.indent;p.head[p.head.length-1].next.length;)p.head=p.head[p.head.length-1].next,p.indent++;p.head=p.head[p.head.length-1].next,p.head.push({text:g,next:[]})}else if(p.indentp.pastIndent&&(p.head[p.head.length-1].next=p.functionObject[g]),p.pastIndent=p.indent,p.line++}}else p.line++;return i(void 0,{graph:p.graph,variable:p.variable,functionObject:p.functionObject})})())},e.prototype.countIndent=function(e){var t,n,i;try{i=e.search(/\S/)}catch(n){return t=n,0}return i=-1===i?0:i},e.prototype.buildIndent=function(e,t){var n,i;for(i="",n=0;t>n;)i+=" ",n++;return i+e.trim()},e.prototype.reduceIndent=function(e){var t,n,i;for(i=[],e=e.split("\n"),n=0;nt){for(;i.length>0&&i.slice(-1)[0]!==t;){if(i.slice(-1)[0]-1?(e=e.split("/"),e.pop(),e=e.join("/"),""===e?"/":e):"/"},e.prototype.removeComment=function(e){var t,n,i,r,o,a,s,p,h,l;for(l=e.split("\n"),p=[],a=!1,s=0,n=0,i=0,r=l.length;r>i;i++){if(o=l[i],n++,o.indexOf("###")>-1)for(;t=o.indexOf("###")>-1;)a?(o=o.substring(h+3,o.length),a=!a):(h=o.indexOf("###",t+1))?o=o.substring(0,t-1)+o.substring(h+3,o.length):(o=o.substring(0,t+1),a=!a,s=n);else o.indexOf("#")>-1&&(o=o.substring(0,o.indexOf("#")));a||p.push(o)}return a?{message:"multiline comment must have close tag.",line:s+1}:p.join("\n")},e.prototype.toRegular=function(e){var t,n,i,r,o;for(e=this.mergeExpression(e),e=this.escape(e),o="",t=0;t0&&" "===e[t-1]){for(o=o.trim(),i=0;in;n++)t=r[n],e=e.replace(new RegExp("\\"+t,"g"),"\\"+t);return e},e.prototype.match=function(e,t){var n;return n=new RegExp(this.toRegular(t),"i"),e.match(n)},e.prototype.mergeExpression=function(e,t){var n,i,r,o,a,s,p,h,l,d;for(i="",d=0,o=0,l=0,s=0;ss;)this.data.global[h[s].trim()]=n,s++}else isNaN(parseInt(i))?""!==i&&(i=void 0===t||t instanceof Array?this.data.global[i]:t[i]):i=t[parseInt(i)];a=e.slice(0,o)+i,s=a.length-1,e=a+e.slice(l+1)}else i+="}";else i+=r;s++}return e},t=function(e){var t,n,i,r,o;for(r=[],n=0,i=e.length;i>n;n++)if(t=e[n],("{"===t||"("===t||"["===t)&&r.push(t),"}"===t||")"===t||"]"===t){if(0===r.length)return!1;if(o=r.pop(),"}"===t&&"{"!==o)return!1;if("]"===t&&"["!==o)return!1;if(")"===t&&"("!==o)return!1}return r.length>0?!1:!0},e.prototype.inlineToConditionTree=function(e){var t,n,i,r,o,a,s;for(s={data:void 0,prev:void 0},i=s,t="",r=!1,o=0,a=e.length;a>o;o++)if(n=e[o],"?"===n)i.data=t,t="",i.left={data:void 0,prev:i},i=i.left;else if(":"===n){for(i.data=t,t="",i=i.prev;i.right;)i=i.prev;i.right={data:void 0,prev:i},i=i.right}else t+=n;return i.data=t,s},e.prototype.checkOperator=function(e){var t,n,i,r;for(r=["(",")","!","&&","||","==","!=",">=","<=",">","<","*","/","+","-"],t=0,n=r.length;n>t;t++)if(i=r[t],e===i)return!0;return!1},e.prototype.tokenizeOperator=function(e){var t,n,i,r,o,a,s,p,h,l,d,u;for(e=[e],n=[],i=[],d=["(",")","!","&&","||","==","!=",">=","<=",">","<","*","/","+","-"],r=0,o=d.length;o>r;r++){for(l=d[r],p=0,a=e.length;a>p;p++)if(u=e[p],u.indexOf(l)>-1){for(i=u.split(l),h=0,s=i.length;s>h;h++)t=i[h],""!==t&&n.push(t),n.push(l);n.pop()}else n.push(u);e=n,n=[]}return e},e.prototype.convertToRPN=function(e){var t,n,i,r,o,a;for(n=this.tokenizeOperator(e),a=[],o=[],i=0,r=n.length;r>i;i++)if(t=n[i],this.checkOperator(t))if(")"===t){for(;o.length>0&&"("!==o[o.length-1];)a.push(o.pop());o.pop()}else o.push(t);else a.push(t);for(;o.length>0;)a.push(o.pop());return a},e.prototype.castBoolean=function(e){return"boolean"==typeof e?e:"string"==typeof e&&"true"===e?!0:"string"==typeof e&&"false"===e?!1:e},e.prototype.compileOperator=function(e){var t,n,i,r,o,a,s;for(a=this.convertToRPN(e),i=[],r=0,o=a.length;o>r;r++)s=a[r],"!"===s?i.push(!this.castBoolean(i.pop())):"&&"===s?i.push(this.castBoolean(i.pop())&&this.castBoolean(i.pop())):"||"===s?i.push(this.castBoolean(i.pop())||this.castBoolean(i.pop())):"=="===s?i.push(i.pop().toString()===i.pop().toString()):"!="===s?i.push(i.pop().toString()!==i.pop().toString()):">="===s?i.push(parseFloat(i.pop())<=parseFloat(i.pop())):"<="===s?i.push(parseFloat(i.pop())>=parseFloat(i.pop())):">"===s?i.push(parseFloat(i.pop())parseFloat(i.pop())):"*"===s?i.push(parseFloat(i.pop())*parseFloat(i.pop())):"/"===s?(t=parseFloat(i.pop()),n=parseFloat(i.pop()),i.push(n/t)):"-"===s?(t=parseFloat(i.pop()),n=parseFloat(i.pop()),i.push(n-t)):"+"===s?(t=i.pop(),n=i.pop(),isNaN(parseFloat(t))||isNaN(parseFloat(n))?i.push(t+n):i.push(parseFloat(t)+parseFloat(n))):i.push(s);return"undefined"===i[0]?void 0:"NaN"===i[0]?NaN:i[0]},e.prototype.conditionWorker=function(e){return e.left&&e.right?this.compileOperator(e.data)?this.conditionWorker(e.left):this.conditionWorker(e.right):e.data},e.prototype.inlineCondition=function(e){var t;return t=this.inlineToConditionTree(e),this.conditionWorker(t)},e.prototype.selectChild=function(e,t){var n,i,r,o,a,s;for(this.text=e,this.head=t,a=this.head.next,r=0,o=a.length;o>r;r++)if(i=a[r],n=this.match(this.text,i.text))return s=Math.floor(Math.random()*i.next.length),{node:i.next[s],data:n}},e.prototype.reply=function(e){var t;return this.text=e,this.data.isReady?!this.text instanceof String?"[Log:Error] reply input text must be a String.":(t=this.selectChild(this.text,this.data.head),t&&t.node?(this.data.head=t.node,this.mergeExpression(t.node.text,t.data)):(this.data.head=this.data.graph,t=this.selectChild(this.text,this.data.head),t&&t.node?(this.data.head=t.node,this.mergeExpression(t.node.text,t.data)):"[Log:Error] answer not found.")):"[Log:Error] can't use reply before Irin class callback."},e.prototype.readFile=function(e,t){var n;return"node"===this.env.runtime?this.env.node.fs.readFile(e,"utf8",function(e,n){return t(e,n)}):"browser"===this.env.runtime?(n=new XMLHttpRequest,n.onreadystatechange=function(){return 4===n.readyState&&200===n.status?t(void 0,n.responseText):4===n.readyState?t({message:"ENOENT: no such file or directory, open '"+e+"' "}):void 0},n.open("GET",e,!0),n.send()):void 0},e.prototype.runtime=function(){return"undefined"==typeof window&&"object"==typeof module?(this.env.node.fs=require("fs"),"node"):"browser"},e}(),"object"==typeof module&&module&&"object"==typeof module.exports?module.exports=e:(window.Irin=e,"function"==typeof define&&define.amd&&define("Irin",[],function(){return e}))}).call(this); \ No newline at end of file +(function(){var e;e=function(){function e(e,t){var n,i;!e instanceof String&&t({message:"input file path must be a string."}),this.env.runtime=this.runtime(),i=this,n=!1,this.data.files.push(e),this.parse(e,function(e,r){return r&&(i.data.graph={next:r.graph},i.data.head=i.data.graph,i.data.global=r.variable,n||(i.data.isReady=!0,t())),e?(t(e),n=!0):void 0})}var t;return e.prototype.data={graph:[],head:[],global:{},files:[],isReady:!1},e.prototype.config={includeDepth:50},e.prototype.env={runtime:"node",node:{fs:""}},e.prototype.parse=function(e,t){return this.parseWorker(e,0,t)},e.prototype.parseWorker=function(e,t,n){var i;return t>this.config.includeDepth?(console.error("stack crash"),n({message:"File reading stack more than "+this.config.includeDepth+" time. Maybe it got forever loop.",file:this.data.files.pop()})):(i=this,this.readFile(e,function(e,r){return e?n(e):i.parseProcess(r.toString(),t,n)}))},e.prototype.parseProcess=function(e,n,i){var r,o,a,s,p;return e=this.removeComment(e),e.message||(e=this.reduceIndent(e)),e.message?void i({message:e.message,file:this.data.files.pop(),line:e.line}):(o=e.split("\n"),p={line:0,indent:0,pastIndent:0,readingHeader:!1,functionObject:{},currentFuncName:"",graph:[],variable:{},headerDepth:0,isAddtoFunction:!1},p.head=p.graph,s=this,a=[],(r=function(e,h){var l,d,u,f,c,g,m;if(e&&(e.file?i(e):(p=a.pop(),s.data.files.pop(),i({message:e.message,file:s.data.files.pop(),line:p.line+1}))),h){for(s.data.files.pop(),p=a.pop(),p.indent=0,p.head=p.graph;p.indent!==p.headerDepth;)p.indent++,p.head=p.head[p.head.length-1].next;p.head.push.apply(p.head,h.graph);for(u in h.variable)p.variable[u]||(p.variable[u]=h.variable[u]);for(u in h.functionObject)p.functionObject[u]?p.functionObject[u].push.apply(p.functionObject[u],h.functionObject[u]):p.functionObject[u]=h.functionObject[u];p.pastIndent=p.headerDepth}for(;p.line-1){if(p.readingHeader)p.readingHeader=!1;else{if(0!==p.graph.length)return i({message:"Header must declare on top of file only.",file:s.data.files.pop(),line:p.line+1});p.headerDepth=p.indent,p.readingHeader=!0}p.line++}else if(p.readingHeader&&g.indexOf("<-")>-1){for(m=g.split("<-"),f=m.length-1,d=0;f>d;){if(!isNaN(parseFloat(m[d].trim())))return i({message:"Variable name must not start with number.",file:s.data.files.pop(),line:p.line+1});c=m[f].trim(),c.indexOf("{")>-1&&(c=s.compileOperator(s.mergeExpression(c,p.variable))),p.variable[m[d].trim()]||(p.variable[m[d].trim()]=c),d++}p.line++}else{if(!t(g))return i({message:"Bracket is mismatch.",file:s.data.files.pop(),line:p.line+1});if("->"===g.substring(0,2)&&".irin"===g.substring(g.length-5,g.length))return p.line++,p.headerDepth=p.indent,a.push(p),l=g.trim().substring(2,g.length).trim(),l=s.getDirPath()+"/"+l,s.data.files.push(l),void s.parseWorker(l,n+1,r);if(p.readingHeader)return i({message:"Unexpected declaration in header.",file:s.data.files.pop(),line:p.line+1});if("->"!==g.substring(0,2)){if(p.isAddtoFunction&&0===p.indent&&(p.isAddtoFunction=!1),p.indent===p.pastIndent)p.head.push({text:g,next:[]}),p.head.length>1&&0===p.head[p.head.length-2].next.length&&(p.head[p.head.length-1].next=p.head[p.head.length-2].next);else if(p.indent>p.pastIndent){for(p.pastIndent=p.indent;p.head[p.head.length-1].next.length;)p.head=p.head[p.head.length-1].next,p.indent++;p.head=p.head[p.head.length-1].next,p.head.push({text:g,next:[]})}else if(p.indentp.pastIndent&&(p.head[p.head.length-1].next=p.functionObject[g]),p.pastIndent=p.indent,p.line++}}else p.line++;return i(void 0,{graph:p.graph,variable:p.variable,functionObject:p.functionObject})})())},e.prototype.countIndent=function(e){var t,n,i;try{i=e.search(/\S/)}catch(n){return t=n,0}return i=-1===i?0:i},e.prototype.buildIndent=function(e,t){var n,i;for(i="",n=0;t>n;)i+=" ",n++;return i+e.trim()},e.prototype.reduceIndent=function(e){var t,n,i;for(i=[],e=e.split("\n"),n=0;nt){for(;i.length>0&&i.slice(-1)[0]!==t;){if(i.slice(-1)[0]-1?(e=e.split("/"),e.pop(),e=e.join("/"),""===e?"/":e):"/"},e.prototype.removeComment=function(e){var t,n,i,r,o,a,s,p,h,l;for(l=e.split("\n"),p=[],a=!1,s=0,n=0,i=0,r=l.length;r>i;i++){if(o=l[i],n++,o.indexOf("###")>-1)for(;t=o.indexOf("###")>-1;)a?(o=o.substring(h+3,o.length),a=!a):(h=o.indexOf("###",t+1))?o=o.substring(0,t-1)+o.substring(h+3,o.length):(o=o.substring(0,t+1),a=!a,s=n);else o.indexOf("#")>-1&&(o=o.substring(0,o.indexOf("#")));a||p.push(o)}return a?{message:"multiline comment must have close tag.",line:s+1}:p.join("\n")},e.prototype.toRegular=function(e){var t,n,i,r,o;for(e=this.mergeExpression(e),e=this.escape(e),o="",t=0;t0&&" "===e[t-1]){for(o=o.trim(),i=0;in;n++)t=r[n],e=e.replace(new RegExp("\\"+t,"g"),"\\"+t);return e},e.prototype.match=function(e,t){var n;return n=new RegExp(this.toRegular(t),"i"),e.match(n)},e.prototype.mergeExpression=function(e,t){var n,i,r,o,a,s,p,h,l,d;for(i="",d=0,o=0,l=0,s=0;ss;)this.data.global[h[s].trim()]=n,s++}else this.hasOperator(i)?i=this.compileOperator(i):isNaN(parseInt(i))?""!==i&&(i=void 0===t||t instanceof Array?this.data.global[i]:t[i]):i=t[parseInt(i)];a=e.slice(0,o)+i,s=a.length-1,e=a+e.slice(l+1)}else i+="}";else i+=r;s++}return e},t=function(e){var t,n,i,r,o;for(r=[],n=0,i=e.length;i>n;n++)if(t=e[n],("{"===t||"("===t||"["===t)&&r.push(t),"}"===t||")"===t||"]"===t){if(0===r.length)return!1;if(o=r.pop(),"}"===t&&"{"!==o)return!1;if("]"===t&&"["!==o)return!1;if(")"===t&&"("!==o)return!1}return r.length>0?!1:!0},e.prototype.inlineToConditionTree=function(e){var t,n,i,r,o,a,s;for(s={data:void 0,prev:void 0},i=s,t="",r=!1,o=0,a=e.length;a>o;o++)if(n=e[o],"?"===n)i.data=t,t="",i.left={data:void 0,prev:i},i=i.left;else if(":"===n){for(i.data=t,t="",i=i.prev;i.right;)i=i.prev;i.right={data:void 0,prev:i},i=i.right}else t+=n;return i.data=t,s},e.prototype.checkOperator=function(e){var t,n,i,r;for(r=["(",")","!","&&","||","==","!=",">=","<=",">","<","*","/","+","-"],t=0,n=r.length;n>t;t++)if(i=r[t],e===i)return!0;return!1},e.prototype.hasOperator=function(e){var t,n,i;for(n=0,i=e.length;i>n;n++)if(t=e[n],this.checkOperator(t))return!0;return!1},e.prototype.tokenizeOperator=function(e){var t,n,i,r,o,a,s,p,h,l,d,u;for(e=[e],n=[],i=[],d=["(",")","!","&&","||","==","!=",">=","<=",">","<","*","/","+","-"],r=0,o=d.length;o>r;r++){for(l=d[r],p=0,a=e.length;a>p;p++)if(u=e[p],u.indexOf(l)>-1){for(i=u.split(l),h=0,s=i.length;s>h;h++)t=i[h],""!==t&&n.push(t),n.push(l);n.pop()}else n.push(u);e=n,n=[]}return e},e.prototype.convertToRPN=function(e){var t,n,i,r,o,a;for(n=this.tokenizeOperator(e),a=[],o=[],i=0,r=n.length;r>i;i++)if(t=n[i],this.checkOperator(t))if(")"===t){for(;o.length>0&&"("!==o[o.length-1];)a.push(o.pop());o.pop()}else o.push(t);else a.push(t);for(;o.length>0;)a.push(o.pop());return a},e.prototype.castBoolean=function(e){return"boolean"==typeof e?e:"string"==typeof e&&"true"===e?!0:"string"==typeof e&&"false"===e?!1:e},e.prototype.compileOperator=function(e){var t,n,i,r,o,a,s;for(a=this.convertToRPN(e),i=[],r=0,o=a.length;o>r;r++)s=a[r],"!"===s?i.push(!this.castBoolean(i.pop())):"&&"===s?i.push(this.castBoolean(i.pop())&&this.castBoolean(i.pop())):"||"===s?i.push(this.castBoolean(i.pop())||this.castBoolean(i.pop())):"=="===s?i.push(i.pop().toString()===i.pop().toString()):"!="===s?i.push(i.pop().toString()!==i.pop().toString()):">="===s?i.push(parseFloat(i.pop())<=parseFloat(i.pop())):"<="===s?i.push(parseFloat(i.pop())>=parseFloat(i.pop())):">"===s?i.push(parseFloat(i.pop())parseFloat(i.pop())):"*"===s?i.push(parseFloat(i.pop())*parseFloat(i.pop())):"/"===s?(t=parseFloat(i.pop()),n=parseFloat(i.pop()),i.push(n/t)):"-"===s?(t=parseFloat(i.pop()),n=parseFloat(i.pop()),i.push(n-t)):"+"===s?(t=i.pop(),n=i.pop(),isNaN(parseFloat(t))||isNaN(parseFloat(n))?i.push(n+t):i.push(parseFloat(n)+parseFloat(t))):i.push(s);return"undefined"===i[0]?void 0:"NaN"===i[0]?NaN:i[0]},e.prototype.conditionWorker=function(e){return e.left&&e.right?this.compileOperator(e.data)?this.conditionWorker(e.left):this.conditionWorker(e.right):e.data},e.prototype.inlineCondition=function(e){var t;return t=this.inlineToConditionTree(e),this.conditionWorker(t)},e.prototype.selectChild=function(e,t){var n,i,r,o,a,s;for(this.text=e,this.head=t,a=this.head.next,r=0,o=a.length;o>r;r++)if(i=a[r],n=this.match(this.text,i.text))return s=Math.floor(Math.random()*i.next.length),{node:i.next[s],data:n}},e.prototype.reply=function(e){var t;return this.text=e,this.data.isReady?!this.text instanceof String?"[Log:Error] reply input text must be a String.":(t=this.selectChild(this.text,this.data.head),t&&t.node?(this.data.head=t.node,this.mergeExpression(t.node.text,t.data)):(this.data.head=this.data.graph,t=this.selectChild(this.text,this.data.head),t&&t.node?(this.data.head=t.node,this.mergeExpression(t.node.text,t.data)):"[Log:Error] answer not found.")):"[Log:Error] can't use reply before Irin class callback."},e.prototype.readFile=function(e,t){var n;return"node"===this.env.runtime?this.env.node.fs.readFile(e,"utf8",function(e,n){return t(e,n)}):"browser"===this.env.runtime?(n=new XMLHttpRequest,n.onreadystatechange=function(){return 4===n.readyState&&200===n.status?t(void 0,n.responseText):4===n.readyState?t({message:"ENOENT: no such file or directory, open '"+e+"' "}):void 0},n.open("GET",e,!0),n.send()):void 0},e.prototype.runtime=function(){return"undefined"==typeof window&&"object"==typeof module?(this.env.node.fs=require("fs"),"node"):"browser"},e}(),"object"==typeof module&&module&&"object"==typeof module.exports?module.exports=e:(window.Irin=e,"function"==typeof define&&define.amd&&define("Irin",[],function(){return e}))}).call(this); \ No newline at end of file diff --git a/package.json b/package.json index 521b332..f486980 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "irin-lang", - "version": "0.0.4", + "version": "0.0.5", "description": "IRIN (Indent to Recognize for Intelligent Natural language) is a scripting language of chatterbots, make you easier to create chatterbot.", "main": "irin-lang.min.js", "scripts": {